結果
問題 | No.2324 Two Countries within UEC |
ユーザー |
|
提出日時 | 2023-07-24 20:18:37 |
言語 | Kuin (KuinC++ v.2021.9.17) |
結果 |
AC
|
実行時間 | 1,640 ms / 2,000 ms |
コード長 | 541 bytes |
コンパイル時間 | 4,982 ms |
コンパイル使用メモリ | 147,380 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-01 15:31:03 |
合計ジャッジ時間 | 28,305 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 41 |
ソースコード
func main()var n: int :: cui@inputInt()var m: int :: cui@inputInt()var p: int :: cui@inputInt()var q: int :: cui@inputInt()for(1, q)var x: int :: cui@inputStr().toInt(&)var f: int :: cui@inputStr().toInt(&)var ans: int :: 0if(x % p = 0)if(f = 0)do ans :: melsedo ans :: 0end ifelsevar target: int :: f * math@modPow(x, p - 2, p) % pdo ans :: m / pif(f <> 0)do ans :+ (m % p < target ?(0, 1))end ifend ifdo cui@print(ans.toStr() ~ "\n")end forend func