Submission #1371682


Source Code Expand

#include <iostream>
#define int long long
#define TAKAHASHI 1
#define AOKI 0
using namespace std;

signed main() {
    int n;
    cin >> n;
    
    int depth = 0;
    for (int i = n; i > 0; i /= 2) {
        depth++;
    }

    int flag = TAKAHASHI;
    int x = 1;
    while (x <= n) {
        if (flag == TAKAHASHI) {
            x = (depth % 2) ? 2 * x + 1 : 2 * x;
            flag = AOKI;
        } else {
            x = (depth % 2) ? 2 * x : 2 * x + 1;
            flag = TAKAHASHI;
        }
    }

    if (flag == AOKI) cout << "Aoki" << endl;
    else cout << "Takahashi" << endl;
    return 0;
}

Submission Info

Submission Time
Task C - 倍々ゲーム
User madman6
Language C++14 (GCC 5.4.1)
Score 100
Code Size 638 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 5
AC × 85
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt, sample_05.txt
All sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt, sample_05.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_20.txt, subtask1_21.txt, subtask1_22.txt, subtask1_23.txt, subtask1_24.txt, subtask1_25.txt, subtask1_26.txt, subtask1_27.txt, subtask1_28.txt, subtask1_29.txt, subtask1_30.txt, subtask1_31.txt, subtask1_32.txt, subtask1_33.txt, subtask1_34.txt, subtask1_35.txt, subtask1_36.txt, subtask1_37.txt, subtask1_38.txt, subtask1_39.txt, subtask1_40.txt, subtask1_41.txt, subtask1_42.txt, subtask1_43.txt, subtask1_44.txt, subtask1_45.txt, subtask1_46.txt, subtask1_47.txt, subtask1_48.txt, subtask1_49.txt, subtask1_50.txt, subtask1_51.txt, subtask1_52.txt, subtask1_53.txt, subtask1_54.txt, subtask1_55.txt, subtask1_56.txt, subtask1_57.txt, subtask1_58.txt, subtask1_59.txt, subtask1_60.txt, subtask1_61.txt, subtask1_62.txt, subtask1_63.txt, subtask1_64.txt, subtask1_65.txt, subtask1_66.txt, subtask1_67.txt, subtask1_68.txt, subtask1_69.txt, subtask1_70.txt, subtask1_71.txt, subtask1_72.txt, subtask1_73.txt, subtask1_74.txt, subtask1_75.txt, subtask1_76.txt, subtask1_77.txt, subtask1_78.txt, subtask1_79.txt, subtask1_80.txt
Case Name Status Exec Time Memory
sample_01.txt AC 1 ms 256 KB
sample_02.txt AC 1 ms 256 KB
sample_03.txt AC 1 ms 256 KB
sample_04.txt AC 1 ms 256 KB
sample_05.txt AC 1 ms 256 KB
subtask1_01.txt AC 1 ms 256 KB
subtask1_02.txt AC 1 ms 256 KB
subtask1_03.txt AC 1 ms 256 KB
subtask1_04.txt AC 1 ms 256 KB
subtask1_05.txt AC 1 ms 256 KB
subtask1_06.txt AC 1 ms 256 KB
subtask1_07.txt AC 1 ms 256 KB
subtask1_08.txt AC 1 ms 256 KB
subtask1_09.txt AC 1 ms 256 KB
subtask1_10.txt AC 1 ms 256 KB
subtask1_11.txt AC 1 ms 256 KB
subtask1_12.txt AC 1 ms 256 KB
subtask1_13.txt AC 1 ms 256 KB
subtask1_14.txt AC 1 ms 256 KB
subtask1_15.txt AC 1 ms 256 KB
subtask1_16.txt AC 1 ms 256 KB
subtask1_17.txt AC 1 ms 256 KB
subtask1_18.txt AC 1 ms 256 KB
subtask1_19.txt AC 1 ms 256 KB
subtask1_20.txt AC 1 ms 256 KB
subtask1_21.txt AC 1 ms 256 KB
subtask1_22.txt AC 1 ms 256 KB
subtask1_23.txt AC 1 ms 256 KB
subtask1_24.txt AC 1 ms 256 KB
subtask1_25.txt AC 1 ms 256 KB
subtask1_26.txt AC 1 ms 256 KB
subtask1_27.txt AC 1 ms 256 KB
subtask1_28.txt AC 1 ms 256 KB
subtask1_29.txt AC 1 ms 256 KB
subtask1_30.txt AC 1 ms 256 KB
subtask1_31.txt AC 1 ms 256 KB
subtask1_32.txt AC 1 ms 256 KB
subtask1_33.txt AC 1 ms 256 KB
subtask1_34.txt AC 1 ms 256 KB
subtask1_35.txt AC 1 ms 256 KB
subtask1_36.txt AC 1 ms 256 KB
subtask1_37.txt AC 1 ms 256 KB
subtask1_38.txt AC 1 ms 256 KB
subtask1_39.txt AC 1 ms 256 KB
subtask1_40.txt AC 1 ms 256 KB
subtask1_41.txt AC 1 ms 256 KB
subtask1_42.txt AC 1 ms 256 KB
subtask1_43.txt AC 1 ms 256 KB
subtask1_44.txt AC 1 ms 256 KB
subtask1_45.txt AC 1 ms 256 KB
subtask1_46.txt AC 1 ms 256 KB
subtask1_47.txt AC 1 ms 256 KB
subtask1_48.txt AC 1 ms 256 KB
subtask1_49.txt AC 1 ms 256 KB
subtask1_50.txt AC 1 ms 256 KB
subtask1_51.txt AC 1 ms 256 KB
subtask1_52.txt AC 1 ms 256 KB
subtask1_53.txt AC 1 ms 256 KB
subtask1_54.txt AC 1 ms 256 KB
subtask1_55.txt AC 1 ms 256 KB
subtask1_56.txt AC 1 ms 256 KB
subtask1_57.txt AC 1 ms 256 KB
subtask1_58.txt AC 1 ms 256 KB
subtask1_59.txt AC 1 ms 256 KB
subtask1_60.txt AC 1 ms 256 KB
subtask1_61.txt AC 1 ms 256 KB
subtask1_62.txt AC 1 ms 256 KB
subtask1_63.txt AC 1 ms 256 KB
subtask1_64.txt AC 1 ms 256 KB
subtask1_65.txt AC 1 ms 256 KB
subtask1_66.txt AC 1 ms 256 KB
subtask1_67.txt AC 1 ms 256 KB
subtask1_68.txt AC 1 ms 256 KB
subtask1_69.txt AC 1 ms 256 KB
subtask1_70.txt AC 1 ms 256 KB
subtask1_71.txt AC 1 ms 256 KB
subtask1_72.txt AC 1 ms 256 KB
subtask1_73.txt AC 1 ms 256 KB
subtask1_74.txt AC 1 ms 256 KB
subtask1_75.txt AC 1 ms 256 KB
subtask1_76.txt AC 1 ms 256 KB
subtask1_77.txt AC 1 ms 256 KB
subtask1_78.txt AC 1 ms 256 KB
subtask1_79.txt AC 1 ms 256 KB
subtask1_80.txt AC 1 ms 256 KB