結果
問題 |
No.2324 Two Countries within UEC
|
ユーザー |
|
提出日時 | 2023-05-28 15:56:24 |
言語 | C (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 338 bytes |
コンパイル時間 | 308 ms |
コンパイル使用メモリ | 28,928 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-12-27 09:54:52 |
合計ジャッジ時間 | 89,417 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 WA * 5 TLE * 27 |
ソースコード
#include <stdio.h> int main(void) { int N, M, P, Q, x, y, f, ans; scanf("%d %d %d %d", &N, &M, &P, &Q); for (int i = 0; i < Q; i++) { scanf("%d %d", &x, &f); ans=0; for (y = 1; y <= M; y++) { if ((x*y)%P==f) { ans++; break; } } ans+=(M-y)/P; printf("%d\n", ans); } return 0; }