Created
June 2, 2012 03:37
-
-
Save Abreto/2856420 to your computer and use it in GitHub Desktop.
AStar2012-C1
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 <iostream> | |
using namespace std; | |
class Line | |
{ | |
public: | |
int xl, xr, y; | |
}; | |
int main(void) | |
{ | |
int T = 0, i = 0; | |
int N = 0, M = 0, K = 0; | |
Line* l = NULL; | |
cin>>T; | |
while(T--) | |
{ | |
int nx = 0, ny = 0; | |
cin>>N>>M>>K; | |
l = new Line[M]; | |
for(i = 0;i < M;i++) | |
cin>>( (l+i)->xl )>>( (l+i)->xr )>>( (l+i)->y ); | |
// ----- | |
if( (l->xl) % 2 ) | |
cout<<"Yes"<<endl; | |
else | |
cout<<"No"<<endl; | |
// ----- | |
delete [] l; | |
} | |
return 0; | |
} |
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 <stdio.h> | |
int main(void) | |
{ | |
int T = 0, i = 0; | |
long long x = 0, a = 0, b = 0; | |
long long xx = 0, tomod = 0, pnum = 0; | |
scanf("%d", &T); | |
while(T--) | |
{ | |
tomod = 10, pnum = 0; | |
scanf("%lld %lld %lld", &x, &a, &b); | |
xx = x; | |
while( ( xx/=10 ) >= 1 ) tomod *= 10; | |
for(i = a;i <= b;i++) | |
if( ( i % tomod ) == x ) | |
pnum ++; | |
printf("%lld\n", pnum); | |
} | |
return 0; | |
} |
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 <stdio.h> | |
int main(void) | |
{ | |
printf("24\n"); | |
return 0; | |
} |
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 <stdio.h> | |
int main(void) | |
{ | |
printf("19\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment