Submission #345544

# Submission time Handle Problem Language Result Execution time Memory
345544 2021-01-07T14:44:25 Z Kerim Examination (JOI19_examination) C++17
0 / 100
3000 ms 6284 KB
#include "bits/stdc++.h"
#define MAXN 100009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(__typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second
#define my_little_dodge 46
#define debug(x)  cerr<< #x <<" = "<< x<<endl;
using namespace std;

typedef long long ll;
typedef pair<int,int> PII;
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
int a[MAXN],b[MAXN],c[MAXN],id[MAXN];
int x[MAXN],y[MAXN],z[MAXN],di[MAXN];
int n,q;
map<int,int>pm;
int main(){
    //freopen("file.in", "r", stdin);
    scanf("%d%d",&n,&q);
    for(int i=1;i<=n;i++){
    	scanf("%d%d",a+i,b+i);
    	c[i]=a[i]+b[i];
    	while(pm[b[i]])
    		b[i]++;
    	pm[b[i]]=1;
    }
    for(int i=1;i<=q;i++){
    	scanf("%d%d%d",x+i,y+i,z+i),di[i]=i;
    	int yuf=0;
    	for(int j=1;j<=n;j++)
    		yuf+=(a[j]>=x[i] && b[j]>=y[i] && c[j]>=z[i]);
    	printf("%d\n",yuf);
    }
    return 0;
}

Compilation message

examination.cpp: In function 'int main()':
examination.cpp:26:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   26 |     scanf("%d%d",&n,&q);
      |     ~~~~~^~~~~~~~~~~~~~
examination.cpp:28:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   28 |      scanf("%d%d",a+i,b+i);
      |      ~~~~~^~~~~~~~~~~~~~~~
examination.cpp:35:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   35 |      scanf("%d%d%d",x+i,y+i,z+i),di[i]=i;
      |      ~~~~~^~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 52 ms 644 KB Output is correct
8 Correct 52 ms 644 KB Output is correct
9 Correct 55 ms 592 KB Output is correct
10 Incorrect 251 ms 632 KB Output isn't correct
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3038 ms 6284 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3038 ms 6284 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 52 ms 644 KB Output is correct
8 Correct 52 ms 644 KB Output is correct
9 Correct 55 ms 592 KB Output is correct
10 Incorrect 251 ms 632 KB Output isn't correct
11 Halted 0 ms 0 KB -