提出 #73936653


ソースコード 拡げる

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,q;
    cin>>n>>q;
    vector<int> A(n);
    for(int i=0;i<n;++i)cin>>A[i];
    auto X=A;
    sort(X.begin(),X.end());
    while(q--){
        int k;
        cin>>k;
        vector<int> B(k);
        for(int i=0;i<k;++i){
            int b;
            cin>>b;
            B[i]=A[--b];
        }
        sort(B.begin(),B.end());
        int l=0,r=1000000000LL;
        while(l<r){
            int m=(l+r)/2+1;
            if(lower_bound(X.begin(),X.end(),m)-X.begin()==lower_bound(B.begin(),B.end(),m)-B.begin())l=m;
            else r=m-1;
        }
        cout<<l<<'\n';
    }
}

提出情報

提出日時
問題 C - Except and Min
ユーザ Tamiji
言語 C++23 (GCC 15.2.0)
得点 300
コード長 674 Byte
結果 AC
実行時間 322 ms
メモリ 5712 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 1
AC × 19
セット名 テストケース
Sample 00_sample_00.txt
All 00_sample_00.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 02_random_2_00.txt, 02_random_2_01.txt, 02_random_2_02.txt, 02_random_2_03.txt, 02_random_2_04.txt, 02_random_2_05.txt, 03_random_3_00.txt, 03_random_3_01.txt, 03_random_3_02.txt, 03_random_3_03.txt, 03_random_3_04.txt, 03_random_3_05.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 3440 KiB
01_random_00.txt AC 314 ms 5528 KiB
01_random_01.txt AC 255 ms 5652 KiB
01_random_02.txt AC 308 ms 5620 KiB
01_random_03.txt AC 315 ms 5572 KiB
01_random_04.txt AC 296 ms 5560 KiB
01_random_05.txt AC 290 ms 5712 KiB
02_random_2_00.txt AC 316 ms 5648 KiB
02_random_2_01.txt AC 304 ms 5528 KiB
02_random_2_02.txt AC 278 ms 5528 KiB
02_random_2_03.txt AC 311 ms 5652 KiB
02_random_2_04.txt AC 271 ms 5560 KiB
02_random_2_05.txt AC 269 ms 5692 KiB
03_random_3_00.txt AC 315 ms 5692 KiB
03_random_3_01.txt AC 319 ms 5560 KiB
03_random_3_02.txt AC 322 ms 5692 KiB
03_random_3_03.txt AC 315 ms 5648 KiB
03_random_3_04.txt AC 322 ms 5648 KiB
03_random_3_05.txt AC 318 ms 5576 KiB