답안 #681007

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
681007 2023-01-12T08:38:54 Z vinnipuh01 Examination (JOI19_examination) C++17
2 / 100
3000 ms 2040 KB
#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

examination.cpp:80:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   80 | main () {
      | ^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 328 KB Output is correct
3 Correct 0 ms 332 KB Output is correct
4 Correct 0 ms 332 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 328 KB Output is correct
7 Correct 44 ms 552 KB Output is correct
8 Correct 45 ms 544 KB Output is correct
9 Correct 44 ms 476 KB Output is correct
10 Correct 44 ms 500 KB Output is correct
11 Correct 45 ms 508 KB Output is correct
12 Correct 43 ms 444 KB Output is correct
13 Correct 40 ms 536 KB Output is correct
14 Correct 40 ms 536 KB Output is correct
15 Correct 40 ms 536 KB Output is correct
16 Correct 23 ms 432 KB Output is correct
17 Correct 34 ms 508 KB Output is correct
18 Correct 8 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3087 ms 2040 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3087 ms 2040 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 328 KB Output is correct
3 Correct 0 ms 332 KB Output is correct
4 Correct 0 ms 332 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 328 KB Output is correct
7 Correct 44 ms 552 KB Output is correct
8 Correct 45 ms 544 KB Output is correct
9 Correct 44 ms 476 KB Output is correct
10 Correct 44 ms 500 KB Output is correct
11 Correct 45 ms 508 KB Output is correct
12 Correct 43 ms 444 KB Output is correct
13 Correct 40 ms 536 KB Output is correct
14 Correct 40 ms 536 KB Output is correct
15 Correct 40 ms 536 KB Output is correct
16 Correct 23 ms 432 KB Output is correct
17 Correct 34 ms 508 KB Output is correct
18 Correct 8 ms 340 KB Output is correct
19 Execution timed out 3087 ms 2040 KB Time limit exceeded
20 Halted 0 ms 0 KB -