結果
問題 | No.321 (P,Q)-サンタと街の子供たち |
ユーザー |
|
提出日時 | 2017-06-14 09:43:46 |
言語 | D (dmd 2.109.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 673 bytes |
コンパイル時間 | 868 ms |
コンパイル使用メモリ | 115,376 KB |
実行使用メモリ | 7,376 KB |
最終ジャッジ日時 | 2024-06-12 20:02:38 |
合計ジャッジ時間 | 5,126 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 WA * 26 RE * 2 |
コンパイルメッセージ
/home/linuxbrew/.linuxbrew/opt/dmd/include/dlang/dmd/std/numeric.d(2999): Warning: cannot inline function `std.numeric.gcdImpl!uint.gcdImpl`
ソースコード
import std.stdio, std.array, std.string, std.conv, std.algorithm; import std.typecons, std.range, std.random, std.math, std.container; import std.numeric, std.bigint, core.bitop, core.stdc.stdio; void main() { auto s = readln.split.map!(to!int); auto P = s[0]; auto Q = s[1]; auto N = readln.chomp.to!int; auto G = gcd(P, Q); P /= G; Q /= G; int ans = 0; while (N--) { s = readln.split.map!(to!int); auto x = s[0]; auto y = s[1]; if (x % G > 0 || y % G > 0) continue; x /= G; y /= G; if (P % 2 == 0 || Q % 2 == 0 || (x + y) % 2 == 0) ans += 1; } ans.writeln; }