結果
| 問題 | No.2324 Two Countries within UEC |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-28 14:07:34 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 569 bytes |
| 記録 | |
| コンパイル時間 | 708 ms |
| コンパイル使用メモリ | 76,756 KB |
| 実行使用メモリ | 9,600 KB |
| 最終ジャッジ日時 | 2026-06-01 18:49:25 |
| 合計ジャッジ時間 | 7,445 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 2 |
| other | TLE * 1 -- * 40 |
ソースコード
#include <iostream>
#include <vector>
int main() {
int N, M, P, Q;
std::cin >> N >> M >> P >> Q;
for (int i = 0; i < Q; i++) {
int x, f;
std::cin >> x >> f;
int ans = 0;
int modX = x % P; // x%P の結果を保持
for (int j = 1; j <= M; j++) {
if(j<P)if((j * modX) % P == f) {
ans++;
continue;
}
if (((j%P) * modX) % P == f) {
ans++;
}
}
std::cout << ans << std::endl;
}
return 0;
}