結果

問題 No.715 集合と二人ゲーム
ユーザー te-shte-sh
提出日時 2018-07-24 12:11:59
言語 D
(dmd 2.107.1)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 784 bytes
コンパイル時間 677 ms
コンパイル使用メモリ 104,296 KB
実行使用メモリ 16,088 KB
最終ジャッジ日時 2023-09-03 20:46:59
合計ジャッジ時間 5,566 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 3 ms
4,376 KB
testcase_05 AC 3 ms
4,380 KB
testcase_06 AC 3 ms
4,376 KB
testcase_07 AC 4 ms
4,384 KB
testcase_08 AC 4 ms
4,380 KB
testcase_09 AC 4 ms
4,380 KB
testcase_10 AC 4 ms
4,380 KB
testcase_11 AC 5 ms
4,376 KB
testcase_12 AC 6 ms
4,380 KB
testcase_13 AC 6 ms
4,380 KB
testcase_14 AC 7 ms
4,376 KB
testcase_15 AC 7 ms
4,500 KB
testcase_16 AC 7 ms
4,376 KB
testcase_17 AC 7 ms
4,380 KB
testcase_18 AC 8 ms
4,376 KB
testcase_19 AC 8 ms
4,384 KB
testcase_20 AC 9 ms
4,376 KB
testcase_21 AC 9 ms
4,376 KB
testcase_22 AC 9 ms
4,376 KB
testcase_23 AC 9 ms
4,376 KB
testcase_24 AC 10 ms
4,380 KB
testcase_25 AC 10 ms
4,380 KB
testcase_26 AC 11 ms
4,380 KB
testcase_27 AC 11 ms
5,452 KB
testcase_28 AC 12 ms
4,504 KB
testcase_29 AC 12 ms
4,584 KB
testcase_30 AC 11 ms
4,376 KB
testcase_31 AC 10 ms
5,704 KB
testcase_32 AC 9 ms
4,376 KB
testcase_33 AC 10 ms
4,380 KB
testcase_34 AC 9 ms
4,380 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 1 ms
4,376 KB
testcase_37 AC 1 ms
4,380 KB
testcase_38 AC 1 ms
4,376 KB
testcase_39 AC 1 ms
4,376 KB
testcase_40 AC 2 ms
4,376 KB
testcase_41 AC 2 ms
4,376 KB
testcase_42 AC 1 ms
4,376 KB
testcase_43 AC 1 ms
4,376 KB
testcase_44 AC 1 ms
4,376 KB
testcase_45 AC 1 ms
4,376 KB
testcase_46 AC 1 ms
4,380 KB
testcase_47 AC 1 ms
4,380 KB
testcase_48 AC 2 ms
4,376 KB
testcase_49 AC 2 ms
4,376 KB
testcase_50 AC 62 ms
13,580 KB
testcase_51 AC 62 ms
13,584 KB
testcase_52 AC 62 ms
14,808 KB
testcase_53 AC 60 ms
13,328 KB
testcase_54 AC 61 ms
14,748 KB
testcase_55 AC 61 ms
13,524 KB
testcase_56 AC 59 ms
13,696 KB
testcase_57 AC 55 ms
12,928 KB
testcase_58 AC 62 ms
14,024 KB
testcase_59 AC 64 ms
16,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string;

auto rdsp(){return readln.splitter;}
void pick(R,T)(ref R r,ref T t){t=r.front.to!T;r.popFront;}
void readV(T...)(ref T t){auto r=rdsp;foreach(ref v;t)pick(r,v);}
void readA(T)(size_t n,ref T[]t){t=new T[](n);auto r=rdsp;foreach(ref v;t)pick(r,v);}

const g = "011203110332240522330113021104527401120311033224455233011302110453748112031103322445593301130211045374".
  map!(gi => cast(int)(gi-'0')).array;

void main()
{
  int n; readV(n);
  int[] a; readA(n, a);

  auto grundy(int c)
  {
    return c < 68 ? g[c] : g[68+c%34];
  }

  a.sort();
  foreach (i; 0..n) a[i] -= i;
  writeln(a.group.map!"a[1]".map!(ci => grundy(ci.to!int)).reduce!"a^b" == 0 ? "Second" : "First");
}
0