結果
問題 |
No.1992 Tendon Walk
|
ユーザー |
![]() |
提出日時 | 2024-05-05 12:24:47 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 318 bytes |
コンパイル時間 | 2,924 ms |
コンパイル使用メモリ | 271,068 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-27 09:46:23 |
合計ジャッジ時間 | 3,534 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int X; cin >> X; int dx[7] = {2, 2, -1, -1, 2, -1, -1}; int ans = 0, cx = 0; while(true){ for(int i = 0; i < 7; i++){ cx += dx[i]; ans += abs(dx[i]); if(cx == X){ cout << ans; return 0; } } } }