結果

問題 No.321 (P,Q)-サンタと街の子供たち
ユーザー nebukuro09nebukuro09
提出日時 2017-06-14 09:43:46
言語 D
(dmd 2.106.1)
結果
RE  
実行時間 -
コード長 673 bytes
コンパイル時間 1,368 ms
コンパイル使用メモリ 104,680 KB
実行使用メモリ 7,784 KB
最終ジャッジ日時 2023-09-03 14:20:21
合計ジャッジ時間 5,891 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 RE -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 2 ms
4,380 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 1 ms
4,376 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 46 ms
4,944 KB
testcase_15 AC 73 ms
4,376 KB
testcase_16 WA -
testcase_17 AC 2 ms
4,376 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 43 ms
4,380 KB
testcase_22 WA -
testcase_23 AC 61 ms
4,376 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 77 ms
7,784 KB
testcase_30 AC 3 ms
4,380 KB
testcase_31 WA -
testcase_32 AC 39 ms
4,376 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 57 ms
4,380 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 12 ms
4,384 KB
testcase_40 WA -
testcase_41 AC 20 ms
4,376 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
/dmd2/linux/bin64/../../src/phobos/std/numeric.d(2999): Warning: cannot inline function `std.numeric.gcdImpl!uint.gcdImpl`

ソースコード

diff #

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;
}
0