結果
| 問題 | No.2324 Two Countries within UEC |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-28 15:47:04 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 486 bytes |
| 記録 | |
| コンパイル時間 | 1,147 ms |
| コンパイル使用メモリ | 209,512 KB |
| 実行使用メモリ | 16,768 KB |
| 最終ジャッジ日時 | 2026-06-30 23:48:52 |
| 合計ジャッジ時間 | 8,277 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 2 |
| other | TLE * 1 -- * 40 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = unsigned long long;
using Graph = vector<vector<int>>;
int main()
{
int n, m, p, q;
cin >> n >> m >> p >> q;
rep(i, q)
{
int x, f;
cin >> x >> f;
ll ans = 0;
for (int j = 1; j < m + 1; j++)
{
ll xy = x * j;
if ((xy - f) % p == 0)
ans++;
}
cout << ans << endl;
}
}