# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
602017 | 2022-07-22T13:43:58 Z | rajatshenoi | Knjige (COCI20_knjige) | C++14 | 3 ms | 1040 KB |
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { int N; cin >> N; vector<int> v(N, 0); vector<int> s(N, 0); for (int i = 0; i < N; i++) { cin >> v[i]; s[i] = v[i]; } sort(s.begin(), s.end()); int count = 0; vector<vector<int>> moves; for (int i = 0; i < N; i++) { for (int j = 0; j < N - i; j++) { if (v[j] == s[i]) { vector<int> temp(3, 0); temp[0] = 0; temp[1] = 1; temp[2] = 0; moves.push_back(temp); count++; for (int k = 0; k < j; k++) { vector<int> temp(3, 0); temp[0] = 0; temp[1] = 0; temp[2] = 1; moves.push_back(temp); count++; temp[0] = 1; temp[1] = 0; temp[2] = 0; moves.push_back(temp); count++; } temp[0] = 1; temp[1] = 1; temp[2] = 1; moves.push_back(temp); count++; break; } else { vector<int> temp(3, 0); temp[0] = 0; temp[1] = 0; temp[2] = 0; moves.push_back(temp); count++; temp[0] = 1; temp[1] = 0; temp[2] = 1; moves.push_back(temp); count++; } } } for (int i = 0; i < N; i++) { vector<int> temp(3, 0); temp[0] = 0; temp[1] = 0; temp[2] = 1; moves.push_back(temp); count++; temp[0] = 1; temp[1] = 0; temp[2] = 0; moves.push_back(temp); count++; } cout << count << "\n"; for (int i = 0; i < moves.size(); i++) { if (moves[i][0] == 0) cout << "UZMI "; else cout << "STAVI "; if (moves[i][1] == 0) cout << "L "; else cout << "D "; if (moves[i][2] == 0) cout << "L\n"; else cout << "D\n"; } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 468 KB | Wrong configuration |
2 | Incorrect | 2 ms | 724 KB | No book to take |
3 | Incorrect | 2 ms | 852 KB | No book to take |
4 | Incorrect | 2 ms | 852 KB | No book to take |
5 | Incorrect | 2 ms | 912 KB | No book to take |
6 | Incorrect | 2 ms | 852 KB | No book to take |
7 | Incorrect | 0 ms | 340 KB | Wrong configuration |
8 | Incorrect | 3 ms | 912 KB | No book to take |
9 | Incorrect | 2 ms | 1040 KB | No book to take |
10 | Incorrect | 2 ms | 852 KB | No book to take |