제출 #774718

#제출 시각아이디문제언어결과실행 시간메모리
774718vjudge1Stone Arranging 2 (JOI23_ho_t1)C++17
100 / 100
183 ms12496 KiB
#include <bits/stdc++.h> using namespace std; main() { int n; cin >> n; int stone[n + 1]; map<int, int> stor; for(int i = 1; i <= n; i++) { cin >> stone[i]; stor[stone[i]] = i; } for(int i = 1; i <= n; i++) { int color = stone[i], ed = stor[stone[i]]; while(i < ed) { stone[i] = color; i++; } } for(int i = 1; i <= n; i++) { cout << stone[i] << "\n"; } }

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

Main.cpp:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main()
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...