結果
問題 |
No.2324 Two Countries within UEC
|
ユーザー |
![]() |
提出日時 | 2023-05-28 14:25:52 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 671 bytes |
コンパイル時間 | 6,810 ms |
コンパイル使用メモリ | 228,468 KB |
実行使用メモリ | 13,952 KB |
最終ジャッジ日時 | 2024-12-27 01:09:49 |
合計ジャッジ時間 | 79,996 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 8 WA * 10 TLE * 23 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; typedef long long ll; using mint = modint; int N,M,P,Q; int issue(int a){ mint ans=0; int x,f; cin >> x >> f; bool flag=false; ans += x; for(int i=1;i<=a;i++){ if(ans == f){ flag=true; } ans+=x; } if(ans == f){ flag=true; } if(flag){ return 1; }else{ return 0; } } int main(){ cin >> N >> M >> P >> Q; mint::set_mod(P); int S,A; S = M/P; A = M%P; for(int i=0;i<Q;i++){ S += issue(A); cout << S << endl; S = M/P; } }