답안 #643043

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
643043 2022-09-21T05:14:32 Z ymm Examination (JOI19_examination) C++17
2 / 100
3000 ms 3160 KB
#include <bits/stdc++.h>
#define Loop(x,l,r) for (ll x = (l); x < (r); ++x)
#define LoopR(x,l,r) for (ll x = (r)-1; x >= (l); --x)
typedef long long ll;
typedef std::pair<int, int> pii;
typedef std::pair<ll , ll > pll;
using namespace std;

#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2")

const int N = 100'010;
int a[N], b[N];
int ans[N];
int x[N], y[N], z[N];
const int S = 4096;
int n, q;

int main()
{
	cin.tie(0) -> sync_with_stdio(false);
	cin >> n >> q;
	Loop (i,0,n)
		cin >> a[i] >> b[i];
	Loop (i,0,q)
		cin >> x[i] >> y[i] >> z[i];
	for (int l = 0; l < n; l += S) {
		int r = min(l+S, n);
		Loop (i,0,q) {
			int x=::x[i],y=::y[i],z=::z[i];
			int ans = 0;
			Loop (i,l,r) {
				int t1 = -(a[i]>=x);
				int t2 = -(b[i]>=y);
				int t3 = -(a[i]+b[i]>=z);
				ans -= t1 & t2 & t3;
			}
			::ans[i] += ans;
		}
	}
	Loop (i,0,q)
		cout << ans[i] << '\n';
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
7 Correct 5 ms 340 KB Output is correct
8 Correct 5 ms 340 KB Output is correct
9 Correct 5 ms 340 KB Output is correct
10 Correct 4 ms 340 KB Output is correct
11 Correct 4 ms 340 KB Output is correct
12 Correct 4 ms 340 KB Output is correct
13 Correct 4 ms 416 KB Output is correct
14 Correct 4 ms 340 KB Output is correct
15 Correct 7 ms 340 KB Output is correct
16 Correct 4 ms 340 KB Output is correct
17 Correct 5 ms 340 KB Output is correct
18 Correct 4 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2724 ms 3160 KB Output is correct
2 Execution timed out 3033 ms 2572 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2724 ms 3160 KB Output is correct
2 Execution timed out 3033 ms 2572 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
7 Correct 5 ms 340 KB Output is correct
8 Correct 5 ms 340 KB Output is correct
9 Correct 5 ms 340 KB Output is correct
10 Correct 4 ms 340 KB Output is correct
11 Correct 4 ms 340 KB Output is correct
12 Correct 4 ms 340 KB Output is correct
13 Correct 4 ms 416 KB Output is correct
14 Correct 4 ms 340 KB Output is correct
15 Correct 7 ms 340 KB Output is correct
16 Correct 4 ms 340 KB Output is correct
17 Correct 5 ms 340 KB Output is correct
18 Correct 4 ms 340 KB Output is correct
19 Correct 2724 ms 3160 KB Output is correct
20 Execution timed out 3033 ms 2572 KB Time limit exceeded
21 Halted 0 ms 0 KB -