結果

問題 No.1992 Tendon Walk
ユーザー Kanten4205Kanten4205
提出日時 2022-02-27 15:24:55
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,195 bytes
コンパイル時間 1,604 ms
コンパイル使用メモリ 162,440 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 04:45:06
合計ジャッジ時間 2,200 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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();
}
0