Submission #1145224

#TimeUsernameProblemLanguageResultExecution timeMemory
1145224MedetbekTrampoline (info1cup20_trampoline)C++20
Compilation error
0 ms0 KiB
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") //#pragma GCC optimize("Ofast,unroll-loops,fast-math,O3") #include <bits/stdc++.h> #define ll long long #define int long long #define all(v) v.begin(), v.end() #define nl '\n' #define pb push_back #define sz(s) (int)(s).size() #define f first #define s second #define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); using namespace std; const ll N = 1e5+10, MX = 1e18+1, MOD = 1e9 + 7; void solve(){ ll R, C, n; cin >> R >> C >> n; ll N = R, M = C; set <int> g[N+2]; for(int i = 1; i <= n; i++){ ll x, y; cin >> x >> y; a[x][y] = 1; g[x].insert(y); } ll q; cin >> q; while(q--){ ll x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2; ll curx = x1, cury = y1; if(x1 > x2){ ll ok = x2; x2 = x1; x1 = ok; ok = y2; y2 = y1; y1 = ok; } if(x1 == x2 && y1 <= y2){ cout << "YES" << nl; continue; } while(true){ auto pos = g[curx].lower_bound(cury); if(pos == g[curx].end()){ cout << "NO" << nl; break; } //cout << *pos << " " << curx << " " << cury << nl; if(curx + 1 == x2 && *pos <= y2){ cout << "YES" << nl; break; } curx++; cury = *pos; } } } main(){ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); ll ql =1; while(ql--){ solve(); } }

Compilation message (stderr)

trampoline.cpp: In function 'void solve()':
trampoline.cpp:25:9: error: 'a' was not declared in this scope
   25 |         a[x][y] = 1;
      |         ^
trampoline.cpp: At global scope:
trampoline.cpp:62:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   62 | main(){
      | ^~~~