結果
| 問題 |
No.2324 Two Countries within UEC
|
| コンテスト | |
| ユーザー |
marble
|
| 提出日時 | 2023-05-28 14:30:51 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 690 bytes |
| コンパイル時間 | 4,868 ms |
| コンパイル使用メモリ | 228,736 KB |
| 実行使用メモリ | 13,824 KB |
| 最終ジャッジ日時 | 2024-12-27 01:44:20 |
| 合計ジャッジ時間 | 79,068 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;
break;
}
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;
}
}
marble