|
|
back to boardPlease say why i have WA#8 #include<iostream.h> struct Triathlon{ int V1; int V2; int V3; }; main() { bool t; int i,j,n; cin>>n; Triathlon*a; a=new Triathlon [n]; for(i=0;i<n;i++) {cin>>a[i].V1>>a[i].V2>>a[i].V3;} for(i=0;i<n;i++) {t=true; for(j=0;j<n;j++) { if(i==j)continue; if(a[j].V1>=a[i].V1) if(a[j].V2>=a[i].V2) if(a[j].V3>=a[i].V3) {cout<<"NO"<<endl; t=false; break;}
} if(t) cout<<"YES"<<endl;} return 0; }
//Thanks |
|
|