結果
問題 |
No.2324 Two Countries within UEC
|
ユーザー |
![]() |
提出日時 | 2023-09-26 09:50:06 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 603 bytes |
コンパイル時間 | 1,841 ms |
コンパイル使用メモリ | 193,488 KB |
最終ジャッジ日時 | 2025-02-17 02:25:32 |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | TLE * 1 -- * 40 |
ソースコード
#include <bits/stdc++.h> #include<iostream> #include<map> #include<vector> #include <algorithm> #include<math.h> #include <iomanip> #include<set> #include <numeric> #include<string> using ll = long long; using namespace std; int main() { ll n, m, p, q; cin >> n >> m >> p >> q; for (int i = 0; i < q; i++){ ll x, f, cnt = 0; cin >> x >> f; for (int j = 0; j < p; j++){ if ((x * j)%p == f){ cnt += (m/p); if(m%p >= j) cnt++; if (j == 0) cnt--; } } cout << cnt << endl; } }