Submission #1099391


Source Code Expand

#include <stdio.h>

#define MAX 100000
int A[MAX];


int main(){

    int n;
    int done;
    int next=MAX+1;
    int i, cnt;

    scanf("%d", &n);

    for(i=0; i<n; i++){
        scanf("%d", A+i);

        if(next > A[i])
            next = A[i];
    }

    done = 0;
    cnt  = 0;
    while(1){
        cnt++;
        for(i=0; i<n; i++){
            if(next == A[i]){
                while(next == A[i]){
                    done++;
                    A[i] = -1;
                    if(++i >= n)
                        break;
                }
                i--;
                next++;
            }
        }

        if(done == n)
            break;
    }

    printf("%d\n", cnt);

    return 0;

}

Submission Info

Submission Time
Task B - ディスコ社内ツアー
User alternative_fact
Language C (GCC 4.9.2)
Score 0
Code Size 757 Byte
Status WA
Exec Time 2027 ms
Memory 1188 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:14:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &n);
     ^
./Main.c:17:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d", A+i);
         ^

Judge Result

Set Name Sample Small Permutation All
Score / Max Score 0 / 0 0 / 20 0 / 10 0 / 70
Status
AC × 3
WA × 1
AC × 12
WA × 3
TLE × 11
AC × 19
WA × 3
TLE × 1
AC × 22
WA × 3
TLE × 23
Set Name Test Cases
Sample 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 00_example_04.txt
Small 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 00_example_04.txt, 10_rand_01.txt, 10_rand_02.txt, 10_rand_03.txt, 10_rand_04.txt, 10_rand_05.txt, 10_rand_06.txt, 10_rand_07.txt, 10_rand_08.txt, 20_perm_01.txt, 20_perm_02.txt, 20_perm_03.txt, 20_perm_04.txt, 20_perm_05.txt, 20_perm_06.txt, 20_perm_07.txt, 20_perm_08.txt, 30_hand_01.txt, 30_hand_02.txt, 30_hand_03.txt, 30_hand_04.txt, 30_hand_05.txt, 30_hand_06.txt
Permutation 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 20_perm_01.txt, 20_perm_02.txt, 20_perm_03.txt, 20_perm_04.txt, 20_perm_05.txt, 20_perm_06.txt, 20_perm_07.txt, 20_perm_08.txt, 30_hand_01.txt, 30_hand_02.txt, 60_perm_01.txt, 60_perm_02.txt, 60_perm_03.txt, 60_perm_04.txt, 60_perm_05.txt, 60_perm_06.txt, 60_perm_07.txt, 60_perm_08.txt, 70_hand_01.txt, 70_hand_02.txt
All 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 00_example_04.txt, 10_rand_01.txt, 10_rand_02.txt, 10_rand_03.txt, 10_rand_04.txt, 10_rand_05.txt, 10_rand_06.txt, 10_rand_07.txt, 10_rand_08.txt, 20_perm_01.txt, 20_perm_02.txt, 20_perm_03.txt, 20_perm_04.txt, 20_perm_05.txt, 20_perm_06.txt, 20_perm_07.txt, 20_perm_08.txt, 30_hand_01.txt, 30_hand_02.txt, 30_hand_03.txt, 30_hand_04.txt, 30_hand_05.txt, 30_hand_06.txt, 50_rand_01.txt, 50_rand_02.txt, 50_rand_03.txt, 50_rand_04.txt, 50_rand_05.txt, 50_rand_06.txt, 50_rand_07.txt, 50_rand_08.txt, 60_perm_01.txt, 60_perm_02.txt, 60_perm_03.txt, 60_perm_04.txt, 60_perm_05.txt, 60_perm_06.txt, 60_perm_07.txt, 60_perm_08.txt, 70_hand_01.txt, 70_hand_02.txt, 70_hand_03.txt, 70_hand_04.txt, 70_hand_05.txt, 70_hand_06.txt
Case Name Status Exec Time Memory
00_example_01.txt AC 15 ms 704 KB
00_example_02.txt AC 15 ms 700 KB
00_example_03.txt WA 15 ms 792 KB
00_example_04.txt AC 17 ms 792 KB
10_rand_01.txt TLE 2025 ms 796 KB
10_rand_02.txt TLE 2026 ms 804 KB
10_rand_03.txt TLE 2025 ms 756 KB
10_rand_04.txt TLE 2027 ms 800 KB
10_rand_05.txt TLE 2026 ms 804 KB
10_rand_06.txt TLE 2027 ms 796 KB
10_rand_07.txt TLE 2027 ms 804 KB
10_rand_08.txt TLE 2027 ms 808 KB
20_perm_01.txt AC 17 ms 792 KB
20_perm_02.txt AC 17 ms 796 KB
20_perm_03.txt AC 17 ms 696 KB
20_perm_04.txt AC 16 ms 792 KB
20_perm_05.txt WA 15 ms 700 KB
20_perm_06.txt AC 17 ms 796 KB
20_perm_07.txt AC 17 ms 800 KB
20_perm_08.txt AC 17 ms 708 KB
30_hand_01.txt AC 16 ms 716 KB
30_hand_02.txt WA 15 ms 700 KB
30_hand_03.txt AC 19 ms 700 KB
30_hand_04.txt TLE 2027 ms 796 KB
30_hand_05.txt TLE 2027 ms 800 KB
30_hand_06.txt TLE 2027 ms 756 KB
50_rand_01.txt TLE 2025 ms 912 KB
50_rand_02.txt TLE 2025 ms 1052 KB
50_rand_03.txt TLE 2026 ms 1052 KB
50_rand_04.txt TLE 2027 ms 932 KB
50_rand_05.txt TLE 2026 ms 804 KB
50_rand_06.txt TLE 2025 ms 712 KB
50_rand_07.txt TLE 2026 ms 800 KB
50_rand_08.txt TLE 2027 ms 932 KB
60_perm_01.txt AC 429 ms 924 KB
60_perm_02.txt AC 1520 ms 1052 KB
60_perm_03.txt AC 1558 ms 1056 KB
60_perm_04.txt AC 966 ms 928 KB
60_perm_05.txt AC 174 ms 924 KB
60_perm_06.txt AC 16 ms 708 KB
60_perm_07.txt AC 56 ms 716 KB
60_perm_08.txt AC 998 ms 928 KB
70_hand_01.txt AC 28 ms 1056 KB
70_hand_02.txt TLE 2027 ms 1132 KB
70_hand_03.txt AC 27 ms 1056 KB
70_hand_04.txt TLE 2026 ms 1188 KB
70_hand_05.txt TLE 2026 ms 1140 KB
70_hand_06.txt TLE 2027 ms 1140 KB