結果

問題 No.2324 Two Countries within UEC
ユーザー i39i39
提出日時 2023-05-29 16:59:56
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 172 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 11,316 KB
実行使用メモリ 15,468 KB
最終ジャッジ日時 2023-08-27 23:46:04
合計ジャッジ時間 11,572 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 360 ms
15,280 KB
testcase_01 AC 368 ms
15,332 KB
testcase_02 AC 127 ms
15,220 KB
testcase_03 AC 289 ms
15,252 KB
testcase_04 AC 321 ms
15,356 KB
testcase_05 AC 130 ms
15,152 KB
testcase_06 AC 175 ms
15,376 KB
testcase_07 AC 120 ms
15,388 KB
testcase_08 AC 290 ms
15,332 KB
testcase_09 AC 296 ms
15,304 KB
testcase_10 AC 362 ms
15,280 KB
testcase_11 AC 362 ms
15,200 KB
testcase_12 AC 163 ms
15,260 KB
testcase_13 AC 163 ms
15,168 KB
testcase_14 AC 132 ms
15,212 KB
testcase_15 AC 123 ms
15,308 KB
testcase_16 AC 274 ms
15,452 KB
testcase_17 AC 202 ms
15,132 KB
testcase_18 AC 136 ms
15,264 KB
testcase_19 AC 366 ms
15,276 KB
testcase_20 AC 115 ms
15,264 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 364 ms
15,300 KB
testcase_26 AC 295 ms
15,204 KB
testcase_27 AC 297 ms
15,284 KB
testcase_28 AC 295 ms
15,252 KB
testcase_29 AC 295 ms
15,272 KB
testcase_30 AC 295 ms
15,212 KB
testcase_31 AC 75 ms
15,084 KB
testcase_32 WA -
testcase_33 AC 75 ms
15,112 KB
testcase_34 AC 75 ms
15,336 KB
testcase_35 AC 75 ms
15,088 KB
testcase_36 AC 75 ms
15,248 KB
testcase_37 AC 76 ms
15,088 KB
testcase_38 AC 76 ms
15,152 KB
testcase_39 AC 76 ms
15,104 KB
testcase_40 AC 75 ms
15,084 KB
testcase_41 AC 76 ms
15,176 KB
testcase_42 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

n,m,p,q=gets.split.map(&:to_i)
q.times do
  x,f=gets.split.map(&:to_i)
  if x%p==0 then
    puts (f==0 ? m : 0)
  else
    y=(f*x.pow(p-2,p))%p
    puts (m-y)/p+1
  end
end
0