Submission #940846

#TimeUsernameProblemLanguageResultExecution timeMemory
940846vjudge1Stone Arranging 2 (JOI23_ho_t1)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define int long long #define pb push_back #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() #define tam(x) (int)(x).size() #define endl "\n" #define sd second #define fs first #define maxs(x,y) (x = max(x,y)) #define mins(x,y) (x = min(x,y)) #define optmizar_io ios_base::sync_with_stdio(0); cin.tie(0); #define Setpre(n) cout<<fixed<<setprecision(n) #define dbg(x) for(auto y: x) cout<<y<<' '; cout<<endl; #define dbg1(x) for(auto y: x) cout<<y.first<<' '<<y.second<<endl; #define dbg2(v) for(auto x:v) cout<<x.a<<' '<<x.b<<' '<<x.c<<endl; #define LSB(S) ((S) & -(S)) const int MAX = 1e6+10; const int INF = 1e17; const int Mod = 1e9+7; const int zero = 0; const double eps = 1e-6; const double PI=acos(-1.0); const int mox[8] ={-1,1,0,0,-1,-1,1,1}; const int moy[8] ={0,0,-1,1,-1,1,-1,1}; using namespace std; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int,int> pi; typedef vector<bool> vbol; using namespace std; int32_t main() { int n; cin >> n; set<pair<int,int> st; vi ans(n); for(int i = 0; i < n; i++){ int a; cin >> a; if(st.find(a) == st.end()) st.insert(i); else{ for(int j = st.find() - st.begin(); j <= i; j++) ans[j] = a; } } return 0; }

Compilation message (stderr)

Main.cpp: In function 'int32_t main()':
Main.cpp:38:23: error: template argument 1 is invalid
   38 |     set<pair<int,int> st;
      |                       ^~
Main.cpp:38:23: error: template argument 2 is invalid
Main.cpp:38:23: error: template argument 3 is invalid
Main.cpp:42:12: error: 'st' was not declared in this scope; did you mean 'std'?
   42 |         if(st.find(a) == st.end()) st.insert(i);
      |            ^~
      |            std