結果
問題 | No.1992 Tendon Walk |
ユーザー |
![]() |
提出日時 | 2022-07-01 21:21:26 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 289 bytes |
コンパイル時間 | 1,510 ms |
コンパイル使用メモリ | 168,084 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-26 03:31:55 |
合計ジャッジ時間 | 2,345 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 |
ソースコード
#include <bits/stdc++.h>using namespace std;vector<int> a = {2, 2, -1, -1, 2, -1, -1};int main(){int X;cin >> X;int p = 0, t = 0;int d = 0;while (true){d += abs(a[t % 7]);p += a[t % 7];t++;if (X == p){cout << d << endl;break;}}}