結果
問題 |
No.2324 Two Countries within UEC
|
ユーザー |
![]() |
提出日時 | 2023-09-26 09:48:54 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 627 bytes |
コンパイル時間 | 2,269 ms |
コンパイル使用メモリ | 194,552 KB |
最終ジャッジ日時 | 2025-02-17 02:25:18 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | RE * 3 MLE * 1 -- * 37 |
ソースコード
#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; vector<ll> yaki(p); 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; } }