結果
問題 | No.1992 Tendon Walk |
ユーザー |
|
提出日時 | 2022-07-01 21:40:41 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 52 ms / 2,000 ms |
コード長 | 359 bytes |
コンパイル時間 | 2,530 ms |
コンパイル使用メモリ | 192,856 KB |
最終ジャッジ日時 | 2025-01-30 02:35:53 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 |
ソースコード
#include<bits/stdc++.h>using namespace std;int main(){ios::sync_with_stdio(false);cin.tie(nullptr);int X;cin>>X;int d[7]={1,1,0,0,1,0,0},p[2]={-1,2};int ans=0,t=0;for(int i=0;i<100;i++){for(int j=0;j<7;j++){t+=p[d[j]];ans+=abs(p[d[j]]);if(t==X){cout<<ans<<'\n';return 0;}}}}