結果
| 問題 |
No.1992 Tendon Walk
|
| コンテスト | |
| ユーザー |
Tamego
|
| 提出日時 | 2022-08-02 21:40:14 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 441 bytes |
| コンパイル時間 | 1,579 ms |
| コンパイル使用メモリ | 170,004 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-23 15:38:09 |
| 合計ジャッジ時間 | 2,169 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 |
ソースコード
#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;
}
Tamego