Submission #673600

#TimeUsernameProblemLanguageResultExecution timeMemory
673600smartmonkyWeighting stones (IZhO11_stones)C++14
0 / 100
1 ms212 KiB
#include <bits/stdc++.h> #define ff first #define ss second #define pb push_back #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() //#define int long long using namespace std; void fp(string name){freopen((name+".in").c_str(),"r",stdin); freopen((name+".out").c_str(),"w",stdout);} const int N = 501 * 500; int cnt[3], mx[3],mn[3]; int chotam[N]; main(){ //fp("stones"); int q; cin >> q; mn[1] = 1e9; mn[2] = 1e9; while(q--){ int r, s; cin >> r >> s; cnt[s]++; mx[s] = max(mx[s], r); mn[s] = min(mn[s], r); if((cnt[1] == cnt[2] && mn[1] > mn[2] && mx[1] > mx[2]) || mn[2] == 1e9 || (cnt[1] > cnt[2] && mx[1] > mx[2])){ cout <<">" << endl; continue; } if((cnt[1] == cnt[2] && mn[1] < mn[2] && mx[1] < mx[2]) || mn[1] == 1e9 || (cnt[1] < cnt[2] && mx[1] < mx[2])){ cout <<"<" << endl; continue; } cout <<"?" << endl; } }

Compilation message (stderr)

stones.cpp:16:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   16 | main(){
      | ^~~~
stones.cpp: In function 'void fp(std::string)':
stones.cpp:12:29: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 | void fp(string name){freopen((name+".in").c_str(),"r",stdin); freopen((name+".out").c_str(),"w",stdout);}
      |                      ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
stones.cpp:12:70: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 | void fp(string name){freopen((name+".in").c_str(),"r",stdin); freopen((name+".out").c_str(),"w",stdout);}
      |                                                               ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...