제출 #974803

#제출 시각아이디문제언어결과실행 시간메모리
974803IsamStone Arranging 2 (JOI23_ho_t1)C++17
60 / 100
2029 ms15712 KiB
#include<bits/stdc++.h> using namespace std; #define eb emplace_back constexpr int sz = 200005; int n, a[sz], fa[sz]; unordered_map<int, int> mp; int op[sz], co(1); signed main(){ ios_base::sync_with_stdio(0), cin.tie(0); cin >> n; for(register int i = 1; i <= n; ++i){ cin >> a[i]; op[i] = a[i]; } for(register int i = 1; i <= n; ++i){ if(op[mp[a[i]]] != a[i] || mp[a[i]] == 0){ mp[a[i]] = i; continue; } int r = i; while(r >= mp[a[i]]){ op[r--] = a[i]; } mp[a[i]] = i; } for(register int i = 1; i <= n; ++i){ cout << op[i] << '\n'; } }

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp: In function 'int main()':
Main.cpp:17:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   17 |  for(register int i = 1; i <= n; ++i){
      |                   ^
Main.cpp:22:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   22 |  for(register int i = 1; i <= n; ++i){
      |                   ^
Main.cpp:39:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   39 |  for(register int i = 1; i <= n; ++i){
      |                   ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...