結果
| 問題 |
No.2324 Two Countries within UEC
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-28 14:50:52 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 419 bytes |
| コンパイル時間 | 1,576 ms |
| コンパイル使用メモリ | 170,448 KB |
| 実行使用メモリ | 1,520,092 KB |
| 最終ジャッジ日時 | 2024-12-27 03:10:37 |
| 合計ジャッジ時間 | 49,545 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 9 RE * 4 TLE * 8 MLE * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, p, q;
cin >> n >> m >> p >> q;
vector<vector<int>>a(n+1, vector<int>(m+1));
for(int i=1; i<=n; i++){
for(int j=1; j<=m; j++){
a[i][j] = i*j%p;
}
}
for(int i=1; i<=q; i++){
int x, f;
cin >> x >> f;
int ans = 0;
for(int j=1; j<=m; j++){
if(a[x][j] == f) ans++;
}
cout << ans << endl;
}
}