提出 #73925616


ソースコード 拡げる

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct {
    int data[10009];
    int top;
    int cost[10009];
} Stack;

Stack q[10009];

int main(){
    int i,j,k,N,Q,min=10009;
    if(scanf("%d%d",&N,&Q)!=2) return 0;
    int A[N];
    for(i=0;i<N;i++){
        if(scanf("%d",&A[i])!=1) return 0;
    }
    for(i=0;i<Q;i++) {
        if(scanf("%d",&q[i].top)!=1) return 0;
        for(j=0;j<q[i].top;j++){
            if(scanf("%d",&q[i].data[j])!=1) return 0;
            q[i].cost[j]=A[q[i].data[j]-1];
            A[q[i].data[j]-1]=0;
        }
        min=10009;
        for(k=0;k<N;k++){
            if(A[k]!=0){
                if(min!=0){
                    if(min>A[k]) min=A[k];
                }
            }
        }
        printf("%d\n",min);
        for(j=0;j<q[i].top;j++){
            A[q[i].data[j]-1]=q[i].cost[j];
        }
    }
    return 0;
}

提出情報

提出日時
問題 C - Except and Min
ユーザ yosshi4438
言語 C++23 (GCC 15.2.0)
得点 0
コード長 930 Byte
結果 TLE
実行時間 > 2000 ms
メモリ 83552 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 0 / 300
結果
AC × 1
AC × 1
TLE × 18
セット名 テストケース
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 1804 KiB
01_random_00.txt TLE > 2000 ms 83308 KiB
01_random_01.txt TLE > 2000 ms 83384 KiB
01_random_02.txt TLE > 2000 ms 83296 KiB
01_random_03.txt TLE > 2000 ms 83304 KiB
01_random_04.txt TLE > 2000 ms 83472 KiB
01_random_05.txt TLE > 2000 ms 83360 KiB
02_random_2_00.txt TLE > 2000 ms 83552 KiB
02_random_2_01.txt TLE > 2000 ms 83300 KiB
02_random_2_02.txt TLE > 2000 ms 83480 KiB
02_random_2_03.txt TLE > 2000 ms 83300 KiB
02_random_2_04.txt TLE > 2000 ms 83444 KiB
02_random_2_05.txt TLE > 2000 ms 83296 KiB
03_random_3_00.txt TLE > 2000 ms 83300 KiB
03_random_3_01.txt TLE > 2000 ms 83304 KiB
03_random_3_02.txt TLE > 2000 ms 83548 KiB
03_random_3_03.txt TLE > 2000 ms 83304 KiB
03_random_3_04.txt TLE > 2000 ms 83296 KiB
03_random_3_05.txt TLE > 2000 ms 83296 KiB