[USACO] Section 1.1 ride 题解
来源:互联网 发布:上知传媒 编辑:程序博客网 时间:2024/04/30 08:05
acm初学者之路。。。从usaco开始刷题
第一题 题解没什么好写的 一看就懂。
//#include<iostream>
#include<fstream>
#include<cstring>
using namespace std;
ifstream cin("ride.in");
ofstream cout("ride.out");
int main()
{
long A=1,B=1;
char a[6],b[6];
while(cin>>a>>b)
{
int la = strlen(a);
int lb = strlen(b);
for(int i=0;i<la;i++)
{
int t = a[i] - 'A' + 1;
A *= t;
A %=47;
}
for(int i=0;i<lb;i++)
{
int t = b[i] - 'A' + 1;
B *= t;
B %= 47;
}
if(A==B)
cout<<"GO"<<endl;
else
cout<<"STAY"<<endl;
}
return 0;
}
1 0
- [USACO] Section 1.1 ride 题解
- USACO Section 1.1 题解
- USACO:Section 1.1 Your Ride Is Here
- USACO Section 1.1 Your Ride Is Here
- USACO Section 1.1 Your Ride Is Here
- USACO Section 1.1 Your Ride Is Here
- USACO Section 1.1 Your Ride Is Here
- USACO section 1.1 C++题解
- USACO Section 1.1.1 Your Ride Is Here
- USACO section 1.1.1 Your Ride Is Here
- USACO Section 1.1 PROB Your Ride Is Here
- C++——USACO Section 1.1 题解
- USACO Section 1.2 题解
- USACO Section 1.3 题解
- USACO Section 1.4 题解
- USACO Section 1.5 题解
- USACO Section 2.1 题解
- usaco Section 1.0 Your Ride Is Here
- WPF基础到企业应用系列7——深入剖析依赖属性(WPF/Silverlight核心)
- hiho刷题日记——第七天完全背包
- 黑马程序员--java基本数据类型
- library system异常处理
- Codelgniter框架总结(二)
- [USACO] Section 1.1 ride 题解
- maven安装本地jar
- C++重写/重载/重定义的比较
- ZOJ 1610 Count the Colors(暴力或者线段树)
- 蛮力法之顺序查找(C实现)
- 局域网数据包通过外网发送到另一局域网的过程
- T-SQL程序设计之流程控制语句
- myeclipse 用tocmat部署项目没反应
- PHP 函数补完:var_export()