1-1 你好,天梯赛
#include<stdio.h>
int main(){
printf("Hello, Tian Ti Sai!");
return 0;
}
1-2 天梯赛考场
#include<iostream>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
cout<<a*b;
return 0;
}
1-3 《算法竞赛 · 进阶指南》
#include<iostream>
using namespace std;
int main(){
char a;
cin>>a;
if(a=='I')
cout<<"2147483647";
if(a=='L')
cout<<"9223372036854775807";
return 0;
}
1-4 《AK》
#include<iostream>
using namespace std;
int main(){
int a;
cin>>a;
if(a%2==0&&a<=100&&a>0)
{
cout<<"YES"<<endl;
for(int i=1;i<=a;i++)
if(i%2==1)
cout<<"A";
else
cout<<"K";
}
else
cout<<"NO";
return 0;
}
1-5 天鸟火炮
#include<iostream>
using namespace std;
int main(){
double T,a,b,c;
cin>>T;
while(T--){
cin>>a>>b>>c;
if(a*c/100.0<=b)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
}
return 0;
}
1-6 《从你的全世界路过》
#include<iostream>
using namespace std;
int ikun(int a, int b) {
if (a != 1 && b == 1) return 1;
if (b % a != 0 || (a == 1 && b != 1)) return 0;
else {
while (b % a == 0) {
if (a == 1 || b == 1) return 1;
b = b / a;
}
if (b == 1) return 1;
else return 0;
}
}
int main()
{
int a, b;
scanf("%d%d", &a, &b);
if (ikun(a, b))
printf("YES");
else
printf("NO");
return 0;
}
1-7 《双城之战》
#include<iostream>
using namespace std;
int main()
{
char a[1100], b[1100];
int n, i=0, c, j=0, flag, d;
gets(a);
c=strlen(a);
scanf("%d", &n);
getchar();
while(n--)
{
flag=0;
gets(b);
d=strlen(b);
if(c==d)
{
for(i=0;i<c;i++)
{
if(a[i]==b[i])
flag=1;
else
{
flag=0;
break;
}
}
j++;
}
else
j++;
if(flag==1)
break;
}
printf("%d", j);
return 0;
}
1-8 “这个世界不需要守望先锋”
#include<iostream>
using namespace std;
int main ()
{
long long n;
scanf("%lld", &n);
long long sum = n * 25 + 250;
if(sum%20>0)
printf("%lld", sum / 20+1);
else
printf("%lld", sum / 20);
return 0;
}