結果

問題 No.321 (P,Q)-サンタと街の子供たち
ユーザー yuruhiyayuruhiya
提出日時 2021-01-24 14:01:14
言語 Crystal
(1.11.2)
結果
RE  
実行時間 -
コード長 315 bytes
コンパイル時間 18,641 ms
コンパイル使用メモリ 254,136 KB
実行使用メモリ 5,048 KB
最終ジャッジ日時 2023-09-13 13:20:00
合計ジャッジ時間 20,699 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 3 ms
4,440 KB
testcase_03 AC 3 ms
4,380 KB
testcase_04 AC 3 ms
4,400 KB
testcase_05 RE -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 2 ms
4,380 KB
testcase_09 WA -
testcase_10 AC 2 ms
4,460 KB
testcase_11 WA -
testcase_12 AC 3 ms
4,380 KB
testcase_13 AC 3 ms
4,380 KB
testcase_14 WA -
testcase_15 AC 37 ms
5,004 KB
testcase_16 WA -
testcase_17 AC 3 ms
4,524 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 31 ms
4,968 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 37 ms
4,916 KB
testcase_30 AC 4 ms
4,864 KB
testcase_31 WA -
testcase_32 AC 20 ms
4,900 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

lib C
  fun strtoll(s : UInt8*, p : UInt8**, b : Int32) : Int64
end

class String
  def to_i64
    C.strtoll(self, nil, 10)
  end
end

p, q = read_line.split.map(&.to_i64)
n = read_line.to_i
g = p.gcd(q)
p /= g
q /= g
puts (0...n).count {
  x, y = read_line.split.map(&.to_i64)
  x % g == p % g && y % g == q % g
}
0