結果
問題 | No.249 N言っちゃダメゲーム (2) |
ユーザー |
![]() |
提出日時 | 2015-07-24 22:25:20 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 371 bytes |
コンパイル時間 | 347 ms |
コンパイル使用メモリ | 53,848 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-08 13:08:06 |
合計ジャッジ時間 | 812 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 |
ソースコード
#include <iostream>using namespace std;int main(){int T = 1000;int won = 0;int first = 0;for(int t = 0; t < T; t++){int n, k;cin >> n >> k;if(n-1 % (k+1) == 0){won += first;}else{won += 1 - first;first = 1 - first;}}cout << won << endl;return 0;}