結果
| 問題 |
No.1992 Tendon Walk
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-02-27 15:24:55 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,195 bytes |
| コンパイル時間 | 1,550 ms |
| コンパイル使用メモリ | 165,508 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-06 16:40:17 |
| 合計ジャッジ時間 | 2,116 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
const long long MOD1 = 1000000007;
const long long MOD2 = 998244353;
typedef long long ll;
typedef pair<ll, ll> P;
const long long INF = 1e17;
template <typename T>
void input_arr(vector<T>& A, ll N) {
for (ll i = 0; i < N; i++) {
cin >> A[i];
}
}
template <typename T, typename Q>
void input_arr(vector<pair<T, Q>>& A, ll N) {
for (ll i = 0; i < N; i++) {
cin >> A[i].first >> A[i].second;
}
}
template <typename T>
void input_arr(vector<vector<T>>& A, ll H, ll W) {
for (ll i = 0; i < H; i++) {
for (ll j = 0; j < W; j++) {
cin >> A[i][j];
}
}
}
void solve() {
ll X; cin >> X;
ll pos = 0;
ll ans = 0;
for (ll i = 0; i < 700; i++) {
if (i % 7 == 0 || i % 7 == 1 || i % 7 == 4) {
pos += 2;
ans += 2;
if (pos == X) {
cout << ans << endl;
return;
}
}
else {
pos--; ans++;
if (pos == X) {
cout << ans << endl;
return;
}
}
}
}
int main() {
ll T=1;//cin>>T;
while(T--)solve();
}