結果

問題 No.2710 How many more?
コンテスト
ユーザー vjudge1
提出日時 2025-10-23 21:59:18
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 438 bytes
コンパイル時間 1,886 ms
コンパイル使用メモリ 194,492 KB
実行使用メモリ 7,724 KB
最終ジャッジ日時 2025-10-23 21:59:25
合計ジャッジ時間 6,194 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other AC * 1 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main() {
    int N, Q;
    cin >> N >> Q;
    int A[N + 1];
    for (int i = 1; i <= N; i++) cin >> A[i];

    while (Q--) {
        int x, y, count = 0;
        cin >> x >> y;
        if (A[x] <= A[y]) cout << 0 << '\n';
        else {
            for (int i = 1; i <= N; i++)
                if (A[i] < A[y] && A[i] > A[x]) count++;
            cout << count << '\n';
        }
    }
}
0