結果
問題 | No.257 N言っちゃダメゲーム (3) |
ユーザー |
![]() |
提出日時 | 2023-11-10 16:49:25 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 725 bytes |
コンパイル時間 | 950 ms |
コンパイル使用メモリ | 102,860 KB |
最終ジャッジ日時 | 2025-02-17 20:16:50 |
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 WA * 27 |
ソースコード
#include<iostream> #include<iomanip> #include<string> #include<algorithm> #include<vector> #include<set> #include<list> #include<queue> #include<math.h> #include<bitset> using ll = long long; using namespace std; int main(){ int n, k, s= 0; cin >> n >> k; if (n >= 3) { s = (n-1)%k; if (s == 1) cout << 0 << endl; else cout << s << endl; } else if (n == 2) { cout << 1 << endl; s = 0; return 0; } else if (n == 1) { cout << 0 << endl; s = 0; return 0; } while (s < n){ s += k; int opp; cin >> opp; if (opp >= n) return 0; if (s == opp) s += k; cout << s << endl; } }