QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#283323 | #1173. Knowledge Is... | blln | WA | 0ms | 3932kb | C++14 | 418b | 2023-12-14 14:33:38 | 2023-12-14 14:33:39 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=1e6+5;
int n,m,s=0,X,Y;
struct xty{int x,op;}A[N];
bool cmp(xty t1,xty t2){return t1.x<t2.x;}
int main(){
scanf("%d",&n);m=n<<1;
for(int i=1;i<=n;i++)scanf("%d %d",&X,&Y),A[i].x=X,A[i].op=1,A[i+n].x=Y+1,A[i+n].op=-1;
sort(A+1,A+m+1,cmp);
for(int i=1,k=0;i<=m;i++)k+=A[i].op,s=max(s,k);
s=n-s;s=s>n/2?n/2:s;
printf("%d",s);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3932kb
input:
7 5 9 10 7 9 3 4 9 10 2 6 8 9 5 8
output:
3
result:
wrong output format Unexpected end of file - int32 expected