結果
問題 |
No.321 (P,Q)-サンタと街の子供たち
|
ユーザー |
|
提出日時 | 2015-12-14 01:15:22 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 408 bytes |
コンパイル時間 | 102 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-09-15 12:01:34 |
合計ジャッジ時間 | 8,693 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 11 WA * 30 |
コンパイルメッセージ
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 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