結果

問題 No.153 石の山
ユーザー obaoba
提出日時 2015-02-16 02:14:55
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 542 bytes
コンパイル時間 1,399 ms
コンパイル使用メモリ 157,664 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-22 14:58:43
合計ジャッジ時間 2,178 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 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 1 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 WA -
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 1 ms
5,376 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 1 ms
5,376 KB
testcase_22 AC 1 ms
5,376 KB
testcase_23 AC 1 ms
5,376 KB
testcase_24 AC 2 ms
5,376 KB
testcase_25 AC 1 ms
5,376 KB
testcase_26 AC 1 ms
5,376 KB
testcase_27 WA -
testcase_28 AC 2 ms
5,376 KB
testcase_29 WA -
testcase_30 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define REP(a,b,c) for(int a=b; a<(int)c; a++)
#define rep(a,b) REP(a,0,b)
#define REPR(a,b,c) for(int a=b; a>(int)c; a++)
#define repr(a,b) REPR(a,b,0)
#define pb(a) push_back(a)
#define show(a) rep(iiixxxaaaa, a.size()) cout << a[i] << ", ";
typedef long long int llint;
using namespace std;

int f(int n){
  if(n==1) return 0;
  int rtn = f(n/2)^f((n+1)/2)^1;
  return n<3 ? rtn : (rtn | (f(n/3)^f((n+1)/3)^f((n+2)/3)^1));
}

int main(){
  int N;
  cin >> N;
  cout << (f(N)==1 ? "A" : "B") << endl;
  return 0;
}
0