結果
| 問題 | No.257 N言っちゃダメゲーム (3) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-27 18:27:03 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 45 ms / 2,000 ms |
| コード長 | 447 bytes |
| 記録 | |
| コンパイル時間 | 851 ms |
| コンパイル使用メモリ | 110,592 KB |
| 実行使用メモリ | 30,308 KB |
| 平均クエリ数 | 3.70 |
| 最終ジャッジ日時 | 2026-06-10 07:59:38 |
| 合計ジャッジ時間 | 4,060 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}
}