Submission #2176623
Source Code Expand
#include <iostream> #include <vector> using namespace std; int N; int p[205]; vector<int> ans; int main(void) { cin >> N; for(int i = 0; i < N; i++) cin >> p[i]; for(int i = 0; i < N; i++){ ans.push_back(1); for(int j = 0; j < N-1; j++){ if(p[j] > p[j+1]){ ans.push_back(N-1); int t = p[j]; p[j] = p[j-1]; p[j-1] = t; } ans.push_back(1); } } cout << ans.size() << endl; for(int i = 0; i < ans.size(); i++){ cout << ans[i] << endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Many Swaps Sorting |
User | leaf1415 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 524 Byte |
Status | WA |
Exec Time | 109 ms |
Memory | 892 KB |
Judge Result
Set Name | Sample | Subtask1 | Subtask2 | All | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | 0 / 400 | 0 / 200 | ||||||||||||||
Status |
|
|
|
|
Set Name | Test Cases |
---|---|
Sample | 00_example_01.txt, 00_example_02.txt |
Subtask1 | 00_example_01.txt, s1_01.txt, s1_02.txt, s1_03.txt, s1_04.txt, s1_05.txt, s1_06.txt |
Subtask2 | 00_example_01.txt, 00_example_02.txt, s1_01.txt, s1_02.txt, s1_03.txt, s1_04.txt, s1_05.txt, s1_06.txt, s2_07.txt, s2_08.txt, s2_09.txt, s2_10.txt, s2_11.txt |
All | 00_example_01.txt, 00_example_02.txt, s1_01.txt, s1_02.txt, s1_03.txt, s1_04.txt, s1_05.txt, s1_06.txt, s2_07.txt, s2_08.txt, s2_09.txt, s2_10.txt, s2_11.txt, s3_12.txt, s3_13.txt, s3_14.txt, s3_15.txt, s3_16.txt, s3_17.txt, s3_18.txt, s3_19.txt, s3_20.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_example_01.txt | WA | 1 ms | 256 KB |
00_example_02.txt | WA | 1 ms | 256 KB |
s1_01.txt | WA | 1 ms | 256 KB |
s1_02.txt | WA | 1 ms | 256 KB |
s1_03.txt | WA | 1 ms | 256 KB |
s1_04.txt | WA | 1 ms | 256 KB |
s1_05.txt | WA | 1 ms | 256 KB |
s1_06.txt | AC | 1 ms | 256 KB |
s2_07.txt | WA | 2 ms | 256 KB |
s2_08.txt | WA | 2 ms | 256 KB |
s2_09.txt | WA | 3 ms | 256 KB |
s2_10.txt | WA | 3 ms | 256 KB |
s2_11.txt | WA | 3 ms | 256 KB |
s3_12.txt | WA | 28 ms | 512 KB |
s3_13.txt | WA | 56 ms | 640 KB |
s3_14.txt | WA | 17 ms | 384 KB |
s3_15.txt | WA | 15 ms | 384 KB |
s3_16.txt | WA | 107 ms | 892 KB |
s3_17.txt | WA | 105 ms | 892 KB |
s3_18.txt | WA | 105 ms | 892 KB |
s3_19.txt | WA | 109 ms | 892 KB |
s3_20.txt | AC | 62 ms | 640 KB |