結果
問題 | No.2324 Two Countries within UEC |
ユーザー | i39 |
提出日時 | 2023-05-28 15:08:40 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 400 ms / 2,000 ms |
コード長 | 205 bytes |
コンパイル時間 | 92 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,544 KB |
最終ジャッジ日時 | 2024-06-26 23:24:35 |
合計ジャッジ時間 | 11,548 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 41 |
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n Syntax OK
ソースコード
n,m,p,q=gets.split.map(&:to_i) q.times do x,f=gets.split.map(&:to_i) if f==0 then puts (x%p==0 ? m : m/p) elsif x%p==0 then puts 0 else y=(f*x.pow(p-2,p))%p puts (m-y)/p+1 end end