QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#283323#1173. Knowledge Is...bllnWA 0ms3932kbC++14418b2023-12-14 14:33:382023-12-14 14:33:39

Judging History

你现在查看的是最新测评结果

  • [2023-12-14 14:33:39]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3932kb
  • [2023-12-14 14:33:38]
  • 提交

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);
}

詳細信息

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