USACO Section 1.1PROB Your Ride Is Here
题目传送门 不能提交哦 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的更多相关文章
- USACO Section 1.1 Your Ride Is Here 解题报告
题目 问题描述 将字符串转变为数字,字母A对应的值为1,依次对应,字母Z对应的值为26.现在有一个字符串,将其中的每个字符转变为数字之后进行累乘,最终的结果对47求余数. 题目给你两个字符串,其中的字 ...
- USACO Section 1.1-1 Your Ride Is Here
USACO 1.1-1 Your Ride Is Here 你的飞碟在这儿 众所周知,在每一个彗星后都有一只UFO.这些UFO时常来收集地球上的忠诚支持者.不幸的是,他们的飞碟每次出行都只能带上一组支 ...
- USACO Training Section 1.1 Your Ride Is Here
题目描述 众所周知,在每一个彗星后都有一只UFO.这些UFO时常来收集地球上的忠诚支持者.不幸的是,他们的飞碟每次出行都只能带上一组支持者.因此,他们要用一种聪明的方案让这些小组提前知道谁会被彗星带走 ...
- 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 ...
- 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 ...
- 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&& ...
- USACO 1.1.1 YOUR RIDE IS HERE
众所周知,在每一个彗星后都有一只UFO.这些UFO时常来收集地球上的忠诚支持者.不幸的是,他们的飞碟每次出行都只能带上一组支持者.因此,他们要用一种聪明的方案让这些小组提前知道谁会被彗星带走.他们为每 ...
- 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 ...
- USACO CHAPTER 1 1.1 Ride 水题
水题,主要是学习文件输入输出. /* ID: ijustwa1 LANG: C++ TASK: ride */ #include<cstdio> #include<cstring&g ...
随机推荐
- copy on write
yl::string CBaseAutopProcessor::AddAuthorizedInfo(const yl::string & strOriginalUrl, const yl::s ...
- PHP 处理接口保证数据安全性
原地址:http://blog.csdn.net/lhbeggar/article/details/46377653 php做APP接口时,如何保证接口的安全性? 1.当用户登录APP时,使用http ...
- 爬虫基础spider 之(一) --- 初识爬虫
爬虫概念 (spider,网络蜘蛛)通过互联网上一个个的网络节点,进行数据的提取.整合以及存储.从而获取我们想要的部分 robots协议 robots协议不是技术层面的协议,只是一个君子协定: 首先在 ...
- pip 打包项目配置库
打包项目中配置库(filename为文件名,可修改) pip freeze > filename.txt 安装配置文件中所有的库包 pip install -r filename.txt 如提示 ...
- C语言学习2
C语言能够进行嵌套备注的方法: #if(0) do { scanf("%d", &n); getchar(); }]||n>a[M-]); #endif
- Python+selenium下拉菜单选项
案例:在我要自学网登录页面选择要保留的时间 具体页面如图所示: 使用前端工具查看部分页面代码: <select class="loinp" name="Cookie ...
- codeforces 88E Interesting Game
题目大意: 两个好朋友再将一堆物品分堆,每次都将一堆物品分成数量连续的至少两个堆,直到一个人不能分堆为输 第一次做博弈问题,看了百度文库的http://wenku.baidu.com/link?url ...
- JavaScript为字符串添加样式
<script type="text/javascript"> var txt="Hello World!" document.write(&quo ...
- MyBatis 3在Insert之后返回主键
XML: <insert id="addUser" parameterType="User" useGeneratedKeys="true&qu ...
- 作为一名CEO
你 不能怕得罪人 不能奢望完成工作的时候 有太多的愉悦感 你 必须要去做左右为难但左右亦可的 操蛋决策 你 得脸皮够厚 肚囊儿宽超 什么事情都能快速消化 哪怕 是 一坨屎 你 还得 决不放弃 永不言败 ...