제출 #1000828

#제출 시각아이디문제언어결과실행 시간메모리
1000828zh_hStone Arranging 2 (JOI23_ho_t1)C++17
0 / 100
1 ms432 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...