Created
December 29, 2013 05:09
-
-
Save KT-Yeh/8167644 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<cstdio> | |
using namespace std; | |
int main() | |
{ | |
int T,t,N,M,K,k,i; | |
scanf("%d",&T); | |
for(t=1;t<=T;t++) | |
{ | |
int e[100000],w[100000]; | |
int cross=0; | |
scanf("%d %d %d",&N,&M,&K); | |
for(k=0;k<K;k++){ | |
scanf("%d %d",&e[k],&w[k]); | |
for(i=0;i<k;i++){ | |
if(e[i]<e[k]) | |
if(w[i]>w[k]) cross++; | |
else if(e[i]>e[k]) | |
if(w[i]<w[k]) cross++; | |
} | |
} | |
printf("Test case %d: %d\n",t,cross); | |
} | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment