제출 #741805

#제출 시각아이디문제언어결과실행 시간메모리
741805jamezzzStone Arranging 2 (JOI23_ho_t1)C++17
100 / 100
294 ms14232 KiB
#include <bits/stdc++.h> using namespace std; #define sf scanf #define pf printf #define maxn 200005 int n,a[maxn]; map<int,int> la; int main(){ sf("%d",&n); for(int i=1;i<=n;++i){ sf("%d",&a[i]); la[a[i]]=i; } int cur=1; while(cur<=n){ for(int i=cur;i<=la[a[cur]];++i){ pf("%d\n",a[cur]); } cur=la[a[cur]]+1; } }

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

Main.cpp: In function 'int main()':
Main.cpp:13:4: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |  sf("%d",&n);
      |    ^
Main.cpp:15:5: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |   sf("%d",&a[i]);
      |     ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...