题目传送门 不能提交哦   http://www.nocow.cn/index.php/Translate:USACO/ride

/*
ID: jusonal1
PROG: ride
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <string>
#include <cstdio>
#include <algorithm>
using namespace std;
int n(char a){
return a - 'A' + 1;
}
int num(string a){
int ans = 1;
for(int i = 0;a[i] != '\0';++i)
ans = ans*n(a[i])%47;
return ans;
}
int main ()
{
ofstream fout("ride.out");
ifstream fin("ride.in");
string a,b;
fin>>a>>b;
//cin>>a>>b;
if(num(a) == num(b)) fout<<"GO"<<endl;
else fout<<"STAY"<<endl;
return 0;
}

USACO Section 1.1PROB Your Ride Is Here的更多相关文章

  1. USACO Section 1.1 Your Ride Is Here 解题报告

    题目 问题描述 将字符串转变为数字,字母A对应的值为1,依次对应,字母Z对应的值为26.现在有一个字符串,将其中的每个字符转变为数字之后进行累乘,最终的结果对47求余数. 题目给你两个字符串,其中的字 ...

  2. USACO Section 1.1-1 Your Ride Is Here

    USACO 1.1-1 Your Ride Is Here 你的飞碟在这儿 众所周知,在每一个彗星后都有一只UFO.这些UFO时常来收集地球上的忠诚支持者.不幸的是,他们的飞碟每次出行都只能带上一组支 ...

  3. USACO Training Section 1.1 Your Ride Is Here

    题目描述 众所周知,在每一个彗星后都有一只UFO.这些UFO时常来收集地球上的忠诚支持者.不幸的是,他们的飞碟每次出行都只能带上一组支持者.因此,他们要用一种聪明的方案让这些小组提前知道谁会被彗星带走 ...

  4. USACO section 1.1 C++题解

    USACO section1.1:DONE 2017.03.03 TEXT Submitting Solutions DONE 2017.03.04 PROB Your Ride Is Here [A ...

  5. Section 1.1 Your Ride Is Here

    Your Ride Is Here It is a well-known fact that behind every good comet is a UFO. TheseUFOs often com ...

  6. USACO Section 1.3 题解 (洛谷OJ P1209 P1444 P3650 P2693)

    usaco ch1.4 sort(d , d + c, [](int a, int b) -> bool { return a > b; }); 生成与过滤 generator&& ...

  7. USACO 1.1.1 YOUR RIDE IS HERE

    众所周知,在每一个彗星后都有一只UFO.这些UFO时常来收集地球上的忠诚支持者.不幸的是,他们的飞碟每次出行都只能带上一组支持者.因此,他们要用一种聪明的方案让这些小组提前知道谁会被彗星带走.他们为每 ...

  8. usaco training <1.2 Your Ride Is Here>

    题面 Your Ride Is Here It is a well-known fact that behind every good comet is a UFO. These UFOs often ...

  9. USACO CHAPTER 1 1.1 Ride 水题

    水题,主要是学习文件输入输出. /* ID: ijustwa1 LANG: C++ TASK: ride */ #include<cstdio> #include<cstring&g ...

随机推荐

  1. 一次ORA-01555问题分析,及SQL优化。

    前言 客户说: 我在数据库上继续运行昨日的脚本,但发现有个子过程在运行10个小时后报错: 烦请协助看看... 错误码是:ORA-01555: snapshot too old: rollback se ...

  2. python 调用 C 动态库

    首先是 C 的头文件和源文件, #ifndef POINT_H #define POINT_H struct point { int x; int y; }; void point_print(str ...

  3. 窗口类WNDCLASSEX名词解析

    窗口类WNDCLASSEX名词解析 typedef struct tagWNDCLASSEX{ UINT cbsize; UINT style; WNDPROC lpfnWNDProc; int cb ...

  4. 【20】AngularJS 参考手册

    AngularJS 参考手册 AngularJS 指令 用到的 AngularJS 指令 : 指令 描述 解析 ng-app 定义应用程序的根元素. 指令 ng-bind 绑定 HTML 元素到应用程 ...

  5. 【03】placeholder

    placeholder   表单占位符解决方案 Css Code :-moz-placeholder, ::-webkit-input-placeholder{ color: #bfbfbf; } . ...

  6. HDU-1272小希的迷宫,并查集?其实不用并查集;

    小希的迷宫                                                                                               ...

  7. redis & macOS & python

    redis & macOS & python how to install python 3 on mac os x? https://docs.python.org/3/using/ ...

  8. hihoCoder#1114 小Hi小Ho的惊天大作战:扫雷·一

    原题地址 回溯+搜索 枚举每个位置上能否放地雷,当第i个位置枚举完成后,第i-1个位置的情况就确定了,此时,检查第i-1个位置是否满足要求,即左右间隔为1的范围内地雷数是否等于申明数字,如果满足条件, ...

  9. mysql 判断索引是否存在,存在则删除再创建索引(分表) 存储过程

    1.分表5数据量大,执行所有分表修改,不包括5 CREATE PROCEDURE deleteIndex()BEGINDECLARE corpId CHAR (16);DECLARE flag INT ...

  10. org.osgi.framework.BundleException: Exception in org.eclipse.core.resources.ResourcesPlugin.start()

    http://freestyle21.cn 不知什么时候,启动eclipse的时候就一直不行,说是an error ..我查了下log 报错:org.osgi.framework.BundleExce ...