結果
問題 | No.321 (P,Q)-サンタと街の子供たち |
ユーザー |
|
提出日時 | 2015-12-14 01:16:25 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 450 bytes |
コンパイル時間 | 259 ms |
コンパイル使用メモリ | 7,296 KB |
実行使用メモリ | 12,544 KB |
最終ジャッジ日時 | 2024-09-15 12:02:01 |
合計ジャッジ時間 | 8,805 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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 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