結果
| 問題 | No.2324 Two Countries within UEC |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-28 15:44:40 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 549 bytes |
| 記録 | |
| コンパイル時間 | 1,162 ms |
| コンパイル使用メモリ | 199,100 KB |
| 実行使用メモリ | 16,256 KB |
| 最終ジャッジ日時 | 2026-06-01 23:44:56 |
| 合計ジャッジ時間 | 8,406 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 2 |
| other | TLE * 1 -- * 40 |
ソースコード
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = 3.14159265359879323846264338327950288419;
const int INF = 2147483647;
using p = pair<int, int>;
int main() {
ll n, m, p, q;
cin >> n >> m >> p >> q;
for (int i = 0; i < q; i++) {
ll x, f;
cin >> x >> f;
x %= p;
ll ans = 0;
for (ll j = 1; j <= m; j++) {
ll tmp = j % p;
if (x * tmp % p == f) { ans++; }
}
cout << ans << endl;
}
return 0;
}