Skip to content

Instantly share code, notes, and snippets.

@Abreto
Created June 2, 2012 03:37
Show Gist options
  • Save Abreto/2856420 to your computer and use it in GitHub Desktop.
Save Abreto/2856420 to your computer and use it in GitHub Desktop.
AStar2012-C1
#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;
}
#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;
}
#include <stdio.h>
int main(void)
{
printf("24\n");
return 0;
}
#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