제출 #774678

#제출 시각아이디문제언어결과실행 시간메모리
774678vjudge1Stone Arranging 2 (JOI23_ho_t1)C++14
100 / 100
349 ms12872 KiB
//#pragma GCC optimize("Ofast,unroll-loops") //#pragma GCC target("avx2,popcnt,lzcnt,abm,bmi,bmi2,fma,tune=native") //#pragma expected_value //#pragma isolated_call //#pragma disjoint #include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define ld long double #define pb push_back #define setpre(i) setprecision(i)<<fixed #define foru(i, a, b) for(int i=a;i<=b;++i) #define ford(i, a, b) for(int i=a;i>=b;--i) #define mp make_pair #define moo cout<<"moo " #define fi first #define se second ll lmod = 1e9 + 7; typedef vector<int> vi; typedef vector< vector<int> > vvi; typedef pair<int, int> ii; typedef pair<double, double> dd; map<int, int> lastpos; int a[200001]; int main(){ // freopen("input.inp", "r", stdin); // freopen("output.out", "w", stdout); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; foru(i, 1, n){ cin >> a[i]; lastpos[a[i]] = i; } foru(i, 1, n){ int z = lastpos[a[i]]; foru(j, 1, z - i + 1) cout << a[i] << endl; i = z; } // fclose(stdout); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...