結果
問題 | No.1286 Stone Skipping |
ユーザー |
![]() |
提出日時 | 2020-11-13 21:59:02 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,122 bytes |
コンパイル時間 | 7,196 ms |
コンパイル使用メモリ | 411,584 KB |
最終ジャッジ日時 | 2025-01-15 22:55:51 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 WA * 2 |
ソースコード
#include <bits/stdc++.h> #include <boost/multiprecision/cpp_int.hpp> #include <atcoder/all> using boost::multiprecision::cpp_int; using namespace std; using namespace atcoder; #if __has_include("print.hpp") #include "print.hpp" #endif #define rep(i, n) for(ll i = 0; i < (ll)(n); i++) #define per(i, n) for(ll i = n; i >= (ll)(0); i--) #define ALL(x) (x).begin(), (x).end() #define RALL(x) (x).rbegin(), (x).rend() #define MOD 1000000007 template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } typedef long long ll; typedef pair<ll, ll> p; using mint = static_modint<3>; int main(){ ios::sync_with_stdio(false); cin.tie(0); ll d; cin >> d; // cout << d/2 << endl; // cout << d/2-1e6 << endl; for (ll i = d/2-1e6; i <= d/2+1e6; i++) { if(i <= 0) continue; ll x = i; ll count = 0; while(1){ count += x; x /= 2; if(count == d){ cout << i << endl; exit(0); } if(x == 0) break; } if(i > d) break; } }