結果
問題 |
No.2324 Two Countries within UEC
|
ユーザー |
![]() |
提出日時 | 2023-05-28 15:54:10 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 672 bytes |
コンパイル時間 | 1,796 ms |
コンパイル使用メモリ | 165,524 KB |
実行使用メモリ | 13,696 KB |
最終ジャッジ日時 | 2024-12-27 09:29:43 |
合計ジャッジ時間 | 80,606 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 WA * 9 TLE * 23 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { long long n, m, p; int q; cin >> n >> m >> p >> q; for (int i = 0; i < q; i++) { int x; long long f; cin >> x >> f; long long start_index = -1; for (int y = 1; y < p+1; y++) { long long c = (x * y) % p; if (c == f) { start_index = y; break; } } if (start_index == -1) { cout << 0 << endl; continue; } long long show = m / p; if (m % p >= start_index) { show += 1; } cout << show << endl; } }