제출 #498022

#제출 시각아이디문제언어결과실행 시간메모리
498022AktanMoney (IZhO17_money)C++17
100 / 100
1197 ms55160 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> #define int long long #define ft first #define sc second using namespace std; const int mod=1e9+7,INF=1e17; set<int> m; int a[1000005],ans; main(){ int n; cin >> n; for(int i=1;i<=n;i++){ cin >> a[i]; } m.insert(0); m.insert(INF); for(int i=1;i<=n;i++){ ans++; int res=*m.upper_bound(a[i]); m.insert(a[i]); while(a[i]<=a[i+1] && a[i+1]<=res && i<n){ i++; m.insert(a[i]); } } cout << ans; }

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

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