結果
問題 | No.1992 Tendon Walk |
ユーザー |
|
提出日時 | 2022-07-04 16:48:15 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 438 bytes |
コンパイル時間 | 2,161 ms |
コンパイル使用メモリ | 194,472 KB |
最終ジャッジ日時 | 2025-01-30 04:34:16 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define REP(i, n) for(int i = 0; i < (n); i++)using ll = long long;int main(){ll X;cin >> X;vector<ll> A{2, 2, -1, -1, 2, -1, -1};ll cnt = 0;ll pos = 0;REP(i, 100){for(auto a: A){cnt += abs(a);pos += a;if(pos == X){cout << cnt << endl;return 0;}}}}