Submission #1136280
Source Code Expand
#include<iostream> #include<algorithm> #include<cstdio> #include<cmath> #include<math.h> #include<string> #include<string.h> #include<stack> #include<queue> #include<vector> #include<utility> #include<set> #include<map> #include<stdlib.h> #include<iomanip> using namespace std; #define ll long long #define ld long double #define EPS 0.0000000001 #define INF 1e9 #define MOD 1000000007 #define rep(i,n) for(i=0;i<n;i++) #define loop(i,a,n) for(i=a;i<n;i++) #define all(in) in.begin(),in.end() #define shosu(x) fixed<<setprecision(x) typedef vector<int> vi; typedef pair<int,int> pii; int main(void) { int i,j; int n; cin>>n; pii a[100005]; rep(i,n){ cin>>a[i].first; a[i].second=i+1; } sort(a,a+n); int ans=1; for(i=1;i<n;i++) if(a[i].second<a[i-1].second)ans++; if(a[n-1].second==1)ans--; cout<<ans<<endl; }
Submission Info
Submission Time | |
---|---|
Task | B - ディスコ社内ツアー |
User | rika0384 |
Language | C++14 (GCC 5.4.1) |
Score | 10 |
Code Size | 894 Byte |
Status | WA |
Exec Time | 44 ms |
Memory | 1152 KB |
Judge Result
Set Name | Sample | Small | Permutation | All | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 20 | 10 / 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 | 2 ms | 1024 KB |
00_example_02.txt | AC | 2 ms | 1024 KB |
00_example_03.txt | AC | 2 ms | 1024 KB |
00_example_04.txt | AC | 2 ms | 1024 KB |
10_rand_01.txt | WA | 2 ms | 1024 KB |
10_rand_02.txt | WA | 2 ms | 1024 KB |
10_rand_03.txt | WA | 2 ms | 1024 KB |
10_rand_04.txt | AC | 2 ms | 1024 KB |
10_rand_05.txt | AC | 2 ms | 1024 KB |
10_rand_06.txt | WA | 2 ms | 1024 KB |
10_rand_07.txt | WA | 2 ms | 1024 KB |
10_rand_08.txt | WA | 2 ms | 1024 KB |
20_perm_01.txt | AC | 2 ms | 1024 KB |
20_perm_02.txt | AC | 2 ms | 1024 KB |
20_perm_03.txt | AC | 2 ms | 1024 KB |
20_perm_04.txt | AC | 2 ms | 1024 KB |
20_perm_05.txt | AC | 2 ms | 1024 KB |
20_perm_06.txt | AC | 2 ms | 1024 KB |
20_perm_07.txt | AC | 2 ms | 1024 KB |
20_perm_08.txt | AC | 2 ms | 1024 KB |
30_hand_01.txt | AC | 2 ms | 1024 KB |
30_hand_02.txt | AC | 2 ms | 1152 KB |
30_hand_03.txt | AC | 2 ms | 1024 KB |
30_hand_04.txt | AC | 2 ms | 1024 KB |
30_hand_05.txt | AC | 2 ms | 1024 KB |
30_hand_06.txt | WA | 2 ms | 1024 KB |
50_rand_01.txt | WA | 14 ms | 1024 KB |
50_rand_02.txt | WA | 25 ms | 1024 KB |
50_rand_03.txt | WA | 25 ms | 1024 KB |
50_rand_04.txt | WA | 20 ms | 1024 KB |
50_rand_05.txt | WA | 9 ms | 1024 KB |
50_rand_06.txt | WA | 2 ms | 1024 KB |
50_rand_07.txt | WA | 5 ms | 1024 KB |
50_rand_08.txt | WA | 21 ms | 1024 KB |
60_perm_01.txt | AC | 16 ms | 1024 KB |
60_perm_02.txt | AC | 29 ms | 1024 KB |
60_perm_03.txt | AC | 29 ms | 1024 KB |
60_perm_04.txt | AC | 24 ms | 1024 KB |
60_perm_05.txt | AC | 10 ms | 1024 KB |
60_perm_06.txt | AC | 2 ms | 1024 KB |
60_perm_07.txt | AC | 5 ms | 1024 KB |
60_perm_08.txt | AC | 24 ms | 1024 KB |
70_hand_01.txt | AC | 38 ms | 1024 KB |
70_hand_02.txt | AC | 37 ms | 1024 KB |
70_hand_03.txt | AC | 30 ms | 1024 KB |
70_hand_04.txt | AC | 29 ms | 1024 KB |
70_hand_05.txt | WA | 44 ms | 1024 KB |
70_hand_06.txt | WA | 35 ms | 1024 KB |