結果

提出番号 1948
提出者 kage
言語 C++
提出日時 2018-08-04 14:42:28
問題名 (67)575ゲーム
結果 AC
点数 100%

テストケース

テストケース 結果 得点 実行時間 メモリ使用量
1 AC 100% 1ms 8720KB
2 AC 100% 1ms 7888KB
3 AC 100% 2ms 8112KB
4 AC 100% 2ms 8384KB
5 AC 100% 2ms 8400KB
6 AC 100% 2ms 8304KB
7 AC 100% 2ms 7824KB
8 AC 100% 2ms 8736KB
9 AC 100% 2ms 8080KB
10 AC 100% 1ms 8720KB
11 AC 100% 2ms 8304KB
12 AC 100% 2ms 8720KB
13 AC 100% 2ms 8144KB
14 AC 100% 2ms 7792KB
15 AC 100% 2ms 8416KB
16 AC 100% 2ms 8688KB
17 AC 100% 2ms 8064KB
18 AC 100% 2ms 8720KB
19 AC 100% 2ms 7824KB
20 AC 100% 2ms 8736KB
21 AC 100% 2ms 8432KB
22 AC 100% 2ms 8048KB
23 AC 100% 2ms 8096KB
24 AC 100% 1ms 8400KB
25 AC 100% 2ms 8432KB
26 AC 100% 1ms 8416KB
27 AC 100% 2ms 8128KB
28 AC 100% 2ms 7824KB
29 AC 100% 1ms 8304KB
30 AC 100% 2ms 8400KB

ソースコード

#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define erep(i,a,b) for(int i=a;i<=(int)(b);++i)
#define per(i,a,b) for(int i=(b);i>(a);--i)
#define eper(i,a,b) for(int i=((int)(a));i>=b;--i)
#define pb push_back
#define mp make_pair
#define INF (1<<28)-1
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a, b)*b;}

int f, s;
int main() {
 ios::sync_with_stdio ( false );
 cin.tie ( 0 );
    cin >> f >> s;
    bool winnerK = (f >= 2 && s >= 1 ? false : true);
    while(f >= 2 && s >= 1) {
        f-=2, s--;
        if (f < 2 || s < 1) break;
        winnerK ^= true;
    } 
    if (winnerK) cout << "K" << endl;
    else cout << "O" << endl;
    return 0;
}