結果
| 問題 | No.321 (P,Q)-サンタと街の子供たち |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-12-14 01:18:32 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 460 bytes |
| 記録 | |
| コンパイル時間 | 190 ms |
| コンパイル使用メモリ | 7,296 KB |
| 実行使用メモリ | 12,672 KB |
| 最終ジャッジ日時 | 2024-09-15 12:02:26 |
| 合計ジャッジ時間 | 8,491 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 12 WA * 29 |
コンパイルメッセージ
Syntax OK
ソースコード
#! ruby
# yukicoder My Practice
# author: Leonardone @ NEETSDKASU
def gs(); gets.chomp; end
def gi(); gets.to_i; end
def gss(); gets.chomp.split; end
def gis(); gss.map(&:to_i); end
P, Q = gis
N = gi
d = P == Q ? P : (P - Q).abs
if P == 1 || Q == 1 || d == 1
p N
exit
end
c = 0
N.times do
x, y = gis.map(&:abs)
if P == 0 && Q == 0
c += 1 if x == 0 && y == 0
else
c += 1 if x % d == 0 && y % d == 0
end
end
p c