結果
問題 | No.1255 ハイレーツ・オブ・ボリビアン |
ユーザー | snow39 |
提出日時 | 2020-10-09 23:03:40 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 935 bytes |
コンパイル時間 | 789 ms |
コンパイル使用メモリ | 90,504 KB |
実行使用メモリ | 8,756 KB |
最終ジャッジ日時 | 2023-09-27 19:23:27 |
合計ジャッジ時間 | 4,592 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
8,756 KB |
testcase_01 | AC | 1 ms
4,376 KB |
testcase_02 | AC | 2 ms
4,380 KB |
testcase_03 | AC | 1 ms
4,376 KB |
testcase_04 | AC | 2 ms
4,376 KB |
testcase_05 | AC | 9 ms
4,380 KB |
testcase_06 | AC | 13 ms
4,380 KB |
testcase_07 | AC | 10 ms
4,380 KB |
testcase_08 | TLE | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
ソースコード
#include <iostream> #include <algorithm> #include <string> #include <vector> #include <cmath> #include <map> #include <queue> #include <iomanip> #include <set> #include <tuple> #define mkp make_pair #define mkt make_tuple #define rep(i,n) for(int i = 0; i < (n); ++i) #define all(v) v.begin(),v.end() using namespace std; typedef long long ll; const ll MOD=1e9+7; template<class T> void chmin(T &a,const T &b){if(a>b) a=b;} template<class T> void chmax(T &a,const T &b){if(a<b) a=b;} void solve(){ ll N; cin>>N; auto next = [&](int now){ if(now<=N){ now+=now-1; }else{ now=(now-N)*2; } return now; }; int now=2; for(int i=1;;i++){ now=next(now); if(now==2){ cout<<i<<endl; return; } } } int main(){ cin.tie(0); ios::sync_with_stdio(false); int T; cin>>T; rep(i,T) solve(); return 0; }