Submission #1172590
Source Code Expand
#include <iostream> #include <cstdio> #include <algorithm> #include <string> #include <cmath> typedef long long ll; #define fi first #define se second int N; int A[112345]; int num[112345]; int ans = 1; using namespace std; int main(){ cin>>N; int i; int j; int big = 0; fill( num, num + 112345, 0 ); for( i = 0; i < N; i++ ){ scanf("%d", A+i); num[A[i]]++; big = max( big, A[i] ); } int idx = 0; int jdg; //printf("%d\n", big); for( i = 1; i <= big; i++ ){ j = 0; jdg = 1; while( num[i] ){ if( A[j] == i ){ if( idx > j && jdg && j ){ ans++; jdg = 0; } num[i]--; //printf("%d %d %d\n", i, idx, j ); } j++; } if( j ) idx = j-1; //printf("%d %d\n", i , idx); } cout<<ans<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - ディスコ社内ツアー |
User | Ice_in_juice |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 921 Byte |
Status | WA |
Exec Time | 2103 ms |
Memory | 1024 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:29:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, 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 |
|
|
|
|
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 | 1 ms | 640 KB |
00_example_02.txt | AC | 1 ms | 640 KB |
00_example_03.txt | AC | 1 ms | 640 KB |
00_example_04.txt | AC | 1 ms | 640 KB |
10_rand_01.txt | WA | 1 ms | 640 KB |
10_rand_02.txt | WA | 1 ms | 640 KB |
10_rand_03.txt | WA | 1 ms | 640 KB |
10_rand_04.txt | AC | 1 ms | 640 KB |
10_rand_05.txt | WA | 1 ms | 640 KB |
10_rand_06.txt | WA | 1 ms | 640 KB |
10_rand_07.txt | WA | 1 ms | 640 KB |
10_rand_08.txt | WA | 1 ms | 640 KB |
20_perm_01.txt | WA | 1 ms | 640 KB |
20_perm_02.txt | WA | 1 ms | 640 KB |
20_perm_03.txt | WA | 1 ms | 640 KB |
20_perm_04.txt | WA | 1 ms | 640 KB |
20_perm_05.txt | AC | 1 ms | 640 KB |
20_perm_06.txt | WA | 1 ms | 640 KB |
20_perm_07.txt | WA | 1 ms | 640 KB |
20_perm_08.txt | WA | 1 ms | 640 KB |
30_hand_01.txt | AC | 1 ms | 640 KB |
30_hand_02.txt | AC | 1 ms | 640 KB |
30_hand_03.txt | AC | 1 ms | 640 KB |
30_hand_04.txt | AC | 1 ms | 640 KB |
30_hand_05.txt | WA | 1 ms | 640 KB |
30_hand_06.txt | WA | 1 ms | 640 KB |
50_rand_01.txt | WA | 124 ms | 768 KB |
50_rand_02.txt | WA | 459 ms | 896 KB |
50_rand_03.txt | WA | 463 ms | 896 KB |
50_rand_04.txt | WA | 312 ms | 896 KB |
50_rand_05.txt | WA | 41 ms | 768 KB |
50_rand_06.txt | WA | 2 ms | 640 KB |
50_rand_07.txt | WA | 12 ms | 768 KB |
50_rand_08.txt | WA | 296 ms | 896 KB |
60_perm_01.txt | WA | 412 ms | 768 KB |
60_perm_02.txt | WA | 1501 ms | 896 KB |
60_perm_03.txt | WA | 1538 ms | 896 KB |
60_perm_04.txt | WA | 952 ms | 896 KB |
60_perm_05.txt | WA | 157 ms | 768 KB |
60_perm_06.txt | WA | 1 ms | 640 KB |
60_perm_07.txt | WA | 40 ms | 768 KB |
60_perm_08.txt | WA | 988 ms | 896 KB |
70_hand_01.txt | TLE | 2103 ms | 1024 KB |
70_hand_02.txt | TLE | 2103 ms | 1024 KB |
70_hand_03.txt | AC | 11 ms | 1024 KB |
70_hand_04.txt | AC | 11 ms | 1024 KB |
70_hand_05.txt | TLE | 2103 ms | 1024 KB |
70_hand_06.txt | WA | 75 ms | 1024 KB |