結果
| 問題 |
No.2324 Two Countries within UEC
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-28 14:23:08 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 480 bytes |
| コンパイル時間 | 1,796 ms |
| コンパイル使用メモリ | 193,380 KB |
| 最終ジャッジ日時 | 2025-02-13 11:22:42 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 10 TLE * 31 |
ソースコード
#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 % p == f)
ans++;
}
cout << ans << endl;
}
}