結果
| 問題 | No.1992 Tendon Walk |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-27 22:39:42 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 432 bytes |
| 記録 | |
| コンパイル時間 | 1,288 ms |
| コンパイル使用メモリ | 210,320 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-06-29 04:20:22 |
| 合計ジャッジ時間 | 2,259 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 |
ソースコード
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
typedef long long ll;
using namespace std;
int main() {
cin.tie(0)->sync_with_stdio(0);
int X;
cin >> X;
int cur = 0, ans = 0;
vector<int> d = {2, 2, -1, -1, 2, -1, -1};
int idx = 0;
while (cur != X) {
cur += d[idx];
ans += abs(d[idx]);
idx = (idx + 1) % 7;
}
cout << ans << "\n";
return 0;
}