fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. const int MaxN=5e5;
  4. struct NODE{
  5. int id,x, y;
  6. bool operator<(const NODE rhs)const{
  7. return (x>rhs.x)? x>rhs.x : y>rhs.y ; }
  8. } node[MaxN];
  9. vector<NODE> ans;
  10.  
  11. int main(){
  12. ios::sync_with_stdio(0);
  13. cin.tie(0); cout.tie(0);
  14.  
  15. int t,n,m,h,w;
  16. cin>>t>>n>>m;
  17. for(int i=0; i<t; i+=1){
  18. cin>>node[i].x>>node[i].y;
  19. node[i].id=i
  20. }
  21. h=node[m].x;
  22. w=node[m].y;
  23. sort(node,node+n);
  24. int uN=1; // X座標不重複的數量
  25. for(int i=1; i<n; i+=1){
  26. if( node[uN-1].x==node[i].x ){
  27. node[uN-1].y=max(node[uN-1].y,node[i].y);
  28. }else{ // node[uN-1].x!=node[i].x
  29. node[uN]=node[i];
  30. uN+=1;
  31. }
  32. }
  33. ans.push_back(node[0]);
  34. int nowY=node[0].y;
  35. for(int n=1; n<uN; n+=1){
  36. if( node[n].y<=nowY )
  37. continue;
  38. ans.push_back(node[n]);
  39. nowY=node[n].y;
  40. }
  41. cout<<"Case "<<t<<":\n";
  42. cout<<"Dominate Point: "<<ans.size()<<"\n";
  43. for(int i=ans.size()-1; 0<=i; i-=1)
  44. cout<<"("<<ans[i].x<<","<<ans[i].y<<")\n";
  45.  
  46. }
Compilation error #stdin compilation error #stdout 0.01s 5272KB
stdin
2
3 1
1 1
2 3
3 2
4 2
1 3
1 1
2 2
3 3
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:19:15: error: expected ‘;’ before ‘}’ token
   node[i].id=i
               ^
               ;
  }
  ~             
stdout
Standard output is empty