結果
問題 |
No.2324 Two Countries within UEC
|
ユーザー |
|
提出日時 | 2023-05-28 13:57:31 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 474 bytes |
コンパイル時間 | 690 ms |
コンパイル使用メモリ | 68,468 KB |
実行使用メモリ | 16,976 KB |
最終ジャッジ日時 | 2024-12-26 22:29:11 |
合計ジャッジ時間 | 98,584 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 10 TLE * 31 |
ソースコード
#include <iostream> #include <string> #include <cmath> #define rep(i,j,n) for(int i=j;i<n;i++) using ll = long long; using namespace std; //vector<int> DX={0,1,0,-1,0,1,-1,-1,1}; //vector<int> DY={0,0,1,0,-1,1,1,-1,-1}; int main(){ ll N,M,P,Q; cin >> N >> M >> P >> Q; for(ll i = 0;i<Q;i++){ ll x,f; cin >> x >> f; ll ans=0; for(ll j=1;j<=M;j++){ if(((j%P)*(x%P))%P==f)ans++; } cout << ans << endl; } }