This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
using namespace std;
// ll plan_roller_coaster(vector<int> s, vector<int> t){
// //* the multiset way:
// // multiset<pair<int, int>> sections;
// // pair<int, int> last_station = {0, 0};
// // for(int i = 0; i < s.size(); i ++){
// // sections.insert({s[i], t[i]});
// // if(t[i] == last_station.second){
// // if(s[i] > last_station.first){
// // last_station = {s[i], t[i]};
// // }
// // }
// // }
// //* the vector way:
// vector<pair<int, int>> sections;
// pair<int, int> last_station = {0, 0};
// for(int i = 0; i < s.size(); i ++){
// sections.pb({s[i], t[i]});
// if(t[i] == last_station.second){
// if(s[i] > last_station.first){
// last_station = {s[i], t[i]};
// }
// }
// else if(t[i] > last_station.second){
// last_station = {s[i], t[i]};
// }
// }
// return 1;
// }
int main(){
int n;
cin >> n;
int cur_color;
cin >> cur_color;
int m = 0;
for(int i = 2; i <= n; i ++){
int temp;
cin >> temp;
if(temp == cur_color){
m = i;
}
}
for(int i = 1; i <= m; i ++){
cout << cur_color << endl;
}
int color2;
if(cur_color == 1){color2 = 2;}
else color2 = 1;
for(int i = 1; i <= n-m; i ++){
cout << color2 << endl;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |