結果
問題 | No.257 N言っちゃダメゲーム (3) |
ユーザー |
|
提出日時 | 2020-05-27 18:27:03 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 66 ms / 2,000 ms |
コード長 | 447 bytes |
コンパイル時間 | 790 ms |
コンパイル使用メモリ | 95,388 KB |
最終ジャッジ日時 | 2025-01-10 15:58:35 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
ソースコード
#include <iostream>#include <vector>#include <algorithm>#include <stack>#include <map>#include <math.h>using namespace std;typedef long long int ll;int main(){cin.tie(nullptr);ios::sync_with_stdio(false);ll n,k; cin >> n >> k;ll now=0;ll p=(n-1)%(k+1);if(p==0){cout << 0 << endl;cin >> now;if(now>=n){return 0;}}while(now<n){ll q=p-now%(k+1);if(q<0)q+=k+1;cout << now+q << endl;cin >> now;}}