結果
| 問題 |
No.2710 How many more?
|
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-09-04 23:33:07 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 620 bytes |
| コンパイル時間 | 1,989 ms |
| コンパイル使用メモリ | 195,132 KB |
| 実行使用メモリ | 15,944 KB |
| 最終ジャッジ日時 | 2025-09-04 23:33:13 |
| 合計ジャッジ時間 | 6,131 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | TLE * 1 -- * 16 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, Q;
cin >> N >> Q;
long long A[100005];
for (int i = 1; i <= N; i++) {
cin >> A[i];
}
while (Q--) {
int x, y;
cin >> x >> y;
long long Ax = A[x];
long long Ay = A[y];
if (Ax >= Ay) {
cout << 0 << endl;
} else {
int count = 0;
for (int i = 1; i <= N; i++) {
if (Ax < A[i] && A[i] <= Ay) {
count++;
}
}
cout << count << endl;
}
}
return 0;
}
vjudge1