結果
| 問題 | No.257 N言っちゃダメゲーム (3) |
| コンテスト | |
| ユーザー |
kurenai3110
|
| 提出日時 | 2016-12-06 16:30:56 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 41 ms / 2,000 ms |
| コード長 | 381 bytes |
| 記録 | |
| コンパイル時間 | 448 ms |
| コンパイル使用メモリ | 85,104 KB |
| 実行使用メモリ | 28,964 KB |
| 平均クエリ数 | 3.70 |
| 最終ジャッジ日時 | 2026-03-31 15:17:05 |
| 合計ジャッジ時間 | 3,161 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 30 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main() {
int n,k;cin>>n>>k;
int d = (n-1)%(k+1);
cout<<min(d,n-1)<<endl;
int e;
while(cin>>e){
if(e>=n)break;
cout<<min(d + ((e-d)/(k+1)+1)*(k+1),n-1)<<endl;
}
return 0;
}
kurenai3110