結果
問題 | No.1992 Tendon Walk |
ユーザー | Tamego |
提出日時 | 2022-08-02 21:40:14 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 441 bytes |
コンパイル時間 | 1,618 ms |
コンパイル使用メモリ | 166,764 KB |
実行使用メモリ | 4,384 KB |
最終ジャッジ日時 | 2023-09-30 21:51:30 |
合計ジャッジ時間 | 2,263 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,376 KB |
testcase_01 | AC | 1 ms
4,380 KB |
testcase_02 | AC | 2 ms
4,380 KB |
testcase_03 | AC | 2 ms
4,380 KB |
testcase_04 | AC | 2 ms
4,380 KB |
testcase_05 | AC | 1 ms
4,380 KB |
testcase_06 | AC | 2 ms
4,384 KB |
testcase_07 | AC | 1 ms
4,376 KB |
testcase_08 | AC | 1 ms
4,376 KB |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll=long long; #define rep(i,p,n)for(ll i=(ll)p;i<(ll)n;i++) #define all(x)(x).begin(),(x).end() #define edt(x1,y1,x2,y2)sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)) int main(){ ll X; cin>>X; vector<string> vec={"A","A","B","B","A","B","B"}; ll ans=0,pos=0,cnt=0; while(pos!=X){ if(vec[cnt%7]=="A"){ pos+=2; ans+=2; } else{ pos-=1; ans+=1; } cnt++; } cout<<ans<<endl; }