結果
| 問題 |
No.1992 Tendon Walk
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-07-01 21:24:07 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 492 bytes |
| コンパイル時間 | 1,816 ms |
| コンパイル使用メモリ | 166,904 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-26 03:37:03 |
| 合計ジャッジ時間 | 2,087 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define all(xs) xs.begin(), xs.end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
int x;
cin >> x;
int x1 = 0;
int ans = 0;
vector<int> a = {2 , 2 , -1 , -1 , 2 , -1 , -1};
for (int i = 0; ; i = (i + 1) % 7) {
x1 += a[i];
ans += abs(a[i]);
if (x1 == x) {
break;
}
}
cout << ans;
}