結果
| 問題 | 
                            No.1286 Stone Skipping
                             | 
                    
| コンテスト | |
| ユーザー | 
                             Example0911
                         | 
                    
| 提出日時 | 2020-11-13 21:42:42 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 570 bytes | 
| コンパイル時間 | 1,790 ms | 
| コンパイル使用メモリ | 191,496 KB | 
| 最終ジャッジ日時 | 2025-01-15 22:42:53 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 24 WA * 2 | 
ソースコード
#include "bits/stdc++.h"
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
int main() {
	ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	long long d; cin >> d;
	long long tmp = d / 2 - 1;
	for (long long i = tmp; i < tmp + 200000; i++) {
		long long now = i;
		if (now == d) {
			cout << i << endl; return 0;
		}
		long long a = i;
		while (a > 0) {
			now += a / 2;
			if (now == d) {
				cout << i << endl; return 0;
			}
			a /= 2;
		}
		now += a;
		if (now == d) {
			cout << i << endl; return 0;
		}
	}
	cout << d << endl;
	return 0;
}
            
            
            
        
            
Example0911