Language: C++

#include
#define f first
#define s second 
using namespace std;
typedef pair p;
typedef pair P;
int n,used[1000],ans,w;
P c[2000];
int main(){ 
cin>>n; for(int i=0,a,b;i>a>>b; c[i*2]=P(p(a,-b),i),c[i*2+1]=P(p(b,-a),i); } sort(c,c+2*n); for(int i=0;i<2*n;i++) if(!used[c[i].s]&&c[i].f.f>w) used[c[i].s]=1,ans+=-c[i].f.s,w=c[i].f.f; cout<<ans<<endl;
return 0;
} 

Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |         ^
a.cc:5:9: error: 'pair' does not name a type
    5 | typedef pair p;
      |         ^~~~
a.cc:6:9: error: 'pair' does not name a type
    6 | typedef pair P;
      |         ^~~~
a.cc:8:1: error: 'P' does not name a type
    8 | P c[2000];
      | ^
a.cc: In function 'int main()':
a.cc:10:1: error: 'cin' was not declared in this scope
   10 | cin>>n; for(int i=0,a,b;i>a>>b; c[i*2]=P(p(a,-b),i),c[i*2+1]=P(p(b,-a),i); } sort(c,c+2*n); for(int i=0;i<2*n;i++) if(!used[c[i].s]&&c[i].f.f>w) used[c[i].s]=1,ans+=-c[i].f.s,w=c[i].f.f; cout<<ans<<endl;
      | ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include
a.cc:10:33: error: 'c' was not declared in this scope
   10 | cin>>n; for(int i=0,a,b;i>a>>b; c[i*2]=P(p(a,-b),i),c[i*2+1]=P(p(b,-a),i); } sort(c,c+2*n); for(int i=0;i<2*n;i++) if(!used[c[i].s]&&c[i].f.f>w) used[c[i].s]=1,ans+=-c[i].f.s,w=c[i].f.f; cout<<ans<<endl;
      |                                 ^
a.cc:10:42: error: 'p' was not declared in this scope
   10 | cin>>n; for(int i=0,a,b;i>a>>b; c[i*2]=P(p(a,-b),i),c[i*2+1]=P(p(b,-a),i); } sort(c,c+2*n); for(int i=0;i<2*n;i++) if(!used[c[i].s]&&c[i].f.f>w) used[c[i].s]=1,ans+=-c[i].f.s,w=c[i].f.f; cout<<ans<<endl;
      |                                          ^
a.cc:10:40: error: 'P' was not declared in this scope
   10 | cin>>n; for(int i=0,a,b;i>a>>b; c[i*2]=P(p(a,-b),i),c[i*2+1]=P(p(b,-a),i); } sort(c,c+2*n); for(int i=0;i<2*n;i++) if(!used[c[i].s]&&c[i].f.f>w) used[c[i].s]=1,ans+=-c[i].f.s,w=c[i].f.f; cout<<ans<<endl;
      |                                        ^
a.cc:10:74: error: expected ')' before ';' token
   10 | cin>>n; for(int i=0,a,b;i>a>>b; c[i*2]=P(p(a,-b),i),c[i*2+1]=P(p(b,-a),i); } sort(c,c+2*n); for(int i=0;i<2*n;i++) if(!used[c[i].s]&&c[i].f.f>w) used[c[i].s]=1,ans+=-c[i].f.s,w=c[i].f.f; cout<<ans<<endl;
      |            ~                                                             ^
      |                                                                          )
a.cc: At global scope:
a.cc:10:82: error: expected constructor, destructor, or type conversion before '(' token
   10 | cin>>n; for(int i=0,a,b;i>a>>b; c[i*2]=P(p(a,-b),i),c[i*2+1]=P(p(b,-a),i); } sort(c,c+2*n); for(int i=0;i<2*n;i++) if(!used[c[i].s]&&c[i].f.f>w) used[c[i].s]=1,ans+=-c[i].f.s,w=c[i].f.f; cout<<ans<<endl;
      |                                                                                  ^
a.cc:10:93: error: expected unqualified-id before 'for'
   10 | cin>>n; for(int i=0,a,b;i>a>>b; c[i*2]=P(p(a,-b),i),c[i*2+1]=P(p(b,-a),i); } sort(c,c+2*n); for(int i=0;i<2*n;i++) if(!used[c[i].s]&&c[i].f.f>w) used[c[i].s]=1,ans+=-c[i].f.s,w=c[i].f.f; cout<<ans<<endl;
      |                                                                                             ^~~
a.cc:10:105: error: 'i' does not name a type
   10 | cin>>n; for(int i=0,a,b;i>a>>b; c[i*2]=P(p(a,-b),i),c[i*2+1]=P(p(b,-a),i); } sort(c,c+2*n); for(int i=0;i<2*n;i++) if(!used[c[i].s]&&c[i].f.f>w) used[c[i].s]=1,ans+=-c[i].f.s,w=c[i].f.f; cout<<ans<<endl;
      |                                                                                                         ^
a.cc:10:111: error: 'i' does not name a type
   10 | cin>>n; for(int i=0,a,b;i>a>>b; c[i*2]=P(p(a,-b),i),c[i*2+1]=P(p(b,-a),i); } sort(c,c+2*n); for(int i=0;i<2*n;i++) if(!used[c[i].s]&&c[i].f.f>w) used[c[i].s]=1,ans+=-c[i].f.s,w=c[i].f.f; cout<<ans<<endl;
      |                                                                                                               ^
a.cc:10:188: error: 'cout' does not name a type
   10 | cin>>n; for(int i=0,a,b;i>a>>b; c[i*2]=P(p(a,-b),i),c[i*2+1]=P(p(b,-a),i); } sort(c,c+2*n); for(int i=0;i<2*n;i++) if(!used[c[i].s]&&c[i].f.f>w) used[c[i].s]=1,ans+=-c[i].f.s,w=c[i].f.f; cout<<ans<<endl;
      |                                                                                                                                                                                            ^~~~
a.cc:11:1: error: expected unqualified-id before 'return'
   11 | return 0;
      | ^~~~~~
a.cc:12:1: error: expected declaration before '}' token
   12 | }
      | ^