Submission #681007

#TimeUsernameProblemLanguageResultExecution timeMemory
681007vinnipuh01Examination (JOI19_examination)C++17
2 / 100
3087 ms2040 KiB
#include <iostream> #include <bits/stdc++.h> #include <cmath> #include <algorithm> #include <vector> #include <deque> #include <set> #include <stack> #include <string> #include <map> #include <queue> #define int long long #define sqrt sqrtl using namespace std; const long long oo = 1000000000000000000; long long sum, ans = 0, mx = 0, mn = 1000000000, num, pos; /* ViHHiPuh (( `'-""``""-'` )) )-__-_.._-__-( / --- (o _ o) --- \ \ .-* ( .0. ) *-. / _'-. ,_ '=' _, .-'_ / `;#'#'# - #'#'#;` \ \_)) -----'#'----- ((_/ # --------- # '# ------- ------ #' /..-'# ------- #'-.\ _\...-\'# -- #'/-.../_ ((____)- '#' -(____)) cout << fixed << setprecision(6) << x; ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); freopen ( "sum.in", "r", stdin ) */ int n, m, x, y, a[ 100001 ], b[ 100001 ], c[ 100001 ], an[ 100001 ], t[ 1000001 ]; map <int, int> mp; vector <pair<int, int> > v; vector <int> vv; vector <pair<int, int> > v1; void upd( int v, int tl, int tr, int pos ) { if ( tl > pos || tr < pos ) return; if ( tl == tr ) { t[ v ] = 1; return; } int mid = ( tl + tr ) / 2; upd( v + v, tl, mid, pos ); upd( v + v + 1, mid + 1, tr, pos ); t[ v ] = t[ v + v ] + t[ v + v + 1 ]; } void gett( int v, int tl, int tr, int l, int r ) { if ( tl > r || tr < l ) return; if ( tl >= l && tr <= r ) { sum += t[ v ]; return; } int mid = ( tl + tr ) / 2; gett( v + v, tl, mid, l, r ); gett( v + v + 1, mid + 1, tr, l, r ); } main () { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n >> m; for ( int i = 1; i <= n; i ++ ) { cin >> a[ i ] >> b[ i ]; } for ( int i = 1; i <= m; i ++ ) { cin >> x >> y >> c[ i ]; sum = 0; for ( int j = 1; j <= n; j ++ ) { if ( a[ j ] >= x && b[ j ] >= y && a[ j ] + b[ j ] >= c[ i ] ) sum ++; } cout << sum << "\n"; } }

Compilation message (stderr)

examination.cpp:80:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   80 | 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...