結果
| 問題 |
No.1286 Stone Skipping
|
| コンテスト | |
| ユーザー |
鴨志田卓
|
| 提出日時 | 2023-07-28 05:38:57 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 490 bytes |
| コンパイル時間 | 1,809 ms |
| コンパイル使用メモリ | 191,952 KB |
| 最終ジャッジ日時 | 2025-02-15 19:44:29 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 TLE * 1 -- * 4 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
void solve() {
i64 n;
cin >> n;
for(i64 i = n / 2; ; i ++) {
i64 sum = i, lst = i >> 1;
while(sum < n && lst > 0) {
sum += lst;
lst >>= 1;
}
if(sum == n) {
cout << i << "\n";
return;
}
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int T;
T = 1;
while(T --)
solve();
}
鴨志田卓