結果
| 問題 | No.257 N言っちゃダメゲーム (3) |
| コンテスト | |
| ユーザー |
kpinkcat
|
| 提出日時 | 2023-12-08 19:25:13 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 219 ms / 2,000 ms |
| コード長 | 638 bytes |
| 記録 | |
| コンパイル時間 | 796 ms |
| コンパイル使用メモリ | 126,740 KB |
| 実行使用メモリ | 29,776 KB |
| 平均クエリ数 | 3.70 |
| 最終ジャッジ日時 | 2026-07-03 05:30:44 |
| 合計ジャッジ時間 | 5,354 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 30 |
ソースコード
#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, t;
cin >> n >> k;
if (n == 1){
cout << 0 << endl;
return 0;
}
t = (n-1)%(k+1);
if (!t) {
cout << 0 << endl;
cin >> s;
} else s = 0;
while (s < n){
for (int i = s + 1; i <= s + k; i++){
if (i%(k+1) == t) {
cout << i << endl;
break;
}
}
cin >> s;
}
}
kpinkcat