結果
| 問題 |
No.1651 Removing Cards
|
| コンテスト | |
| ユーザー |
ぷら
|
| 提出日時 | 2021-08-20 23:50:34 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 455 bytes |
| コンパイル時間 | 1,924 ms |
| コンパイル使用メモリ | 195,384 KB |
| 最終ジャッジ日時 | 2025-01-24 00:54:05 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 32 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int K,Q;
cin >> K >> Q;
vector<long long>tmp1;
tmp1.push_back(1);
long long sum = 1;
for(int i = 1; sum <= 1001001001001001001; i++) {
sum += (sum+K-2)/K-1;
tmp1.push_back(sum);
}
while (Q--) {
long long N;
cin >> N;
int it = lower_bound(tmp1.begin(),tmp1.end(),N)-tmp1.begin()-1;
cout << tmp1[it] << endl;
}
}
ぷら