1004: 不明飞行物(ufo)
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <string>
using namespace std;
int main(){
string s1;
string s2;
long m,n;
m=;
n=;
cin>>s1>>s2;
for(int i = ; i< s1.length(); i++)
{
m *= (int)s1[i] - (int)'A' + ;
} for(int i = ; i< s2.length(); i++)
{
n *= (int)s2[i] - (int)'A' +;
}
if(m % == n % )
cout<<"GO"<<endl<<"r1=r2="<<m%<<endl;
else
cout<<"STAY"<<endl<<"r1="<<m%<<"r2="<<n%<<endl;;
//cout<<m % 47 <<n % 47 <<endl;
//cout<<count<<endl; // cout<<setiosflags(ios::fixed)<<setprecision(4)<<s<<endl;
// cout<< setiosflags(ios::fixed)<<setprecision(4) <<c<<endl;
}
1004: 不明飞行物(ufo)的更多相关文章
- 1064: 不明飞行物(ufo)
#include<iostream> #include<string> using namespace std; int main(){ string a,b ; long m ...
- 【USACO 1.1.1】你的飞碟在这儿
[问题描述] 一个众所周知的事实,在每一慧星后面是一个不明飞行物UFO. 这些不明飞行物时常来收集来自在地球上忠诚的支持者. 不幸地,他们的空间在每次旅行只能带上一群支持者. 他们要做的是用一种聪明的 ...
- usaco1.1.1Your Ride Is Here(入门题)
一下是我很久很久之前刷的题目...随便扔在这里啦.. Description 一个众所周知的事实,在每一慧星后面是一个不明飞行物UFO.这些不明飞行物时常来收集来自在地球上忠诚的支持者.不幸的是,他们 ...
- C++算法代码——你要乘坐的飞碟在这里[usaco]
题目来自:http://218.5.5.242:9018/JudgeOnline/problem.php?id=1056 题目描述 一个众所周知的事实,在每一慧星后面是一个不明飞行物UFO. 这些不明 ...
- in+sb's+基数词的复数形式|UFO|the minutes|
Hawking became world-famous in ________. A. his thirties in the 1970's B. the thirties in his 1970 ...
- bzoj 1004 Cards
1004: [HNOI2008]Cards Description 小春现在很清闲,面对书桌上的N张牌,他决定给每张染色,目前小春只有3种颜色:红色,蓝色,绿色.他询问Sun有 多少种染色方案,Sun ...
- Codeforces Round #262 (Div. 2) 1004
Codeforces Round #262 (Div. 2) 1004 D. Little Victor and Set time limit per test 1 second memory lim ...
- 1004. Counting Leaves (30)
1004. Counting Leaves (30) A family hierarchy is usually presented by a pedigree tree. Your job is ...
- 网络虚拟化中的 offload 技术:LSO/LRO、GSO/GRO、TSO/UFO、VXLAN
offload 现在,越来越多的网卡设备支持 offload 特性,来提升网络收/发性能.offload 是将本来该操作系统进行的一些数据包处理(如分片.重组等)放到网卡硬件中去做,降低系统 CPU ...
随机推荐
- iOS 获取本地视频的缩略图
+(UIImage *)getImage:(NSString *)videoURL { AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:[NSU ...
- IntentService 与ResultReceiver
from://http://lyzhanghai.iteye.com/blog/947504 在google的I/O大会中关于“Writing zippy Android apps”,有讲过用Inte ...
- 为网卡配置多个IP地址(windows)
转自:https://jingyan.baidu.com/article/fcb5aff7e0fd76edaa4a71d3.html 为电脑配置多个IP,免去到不同地点需要更改IP的烦恼. 譬如电脑在 ...
- 转: Linux --- Supervisor的作用与配置
supervisor管理进程,是通过fork/exec的方式将这些被管理的进程当作supervisor的子进程来启动,所以我们只需要将要管理进程的可执行文件的路径添加到supervisor的配置文件中 ...
- 监听Listview的滚动状态,是否滚动到了顶部或底部
/** * @author:Jack Tony * @description : 监听listview的滑动状态,如果到了顶部就刷新数据 * @date :2015年2月9日 */ private c ...
- 监听home键+模拟home键
一.监听home键首先定义一个广播接受者 HomeKeyReceiver package com.kale.floattest; import com.kale.floattest.service.D ...
- 在Android中实现图片的裁剪
本实例的功能是将用户选择的图片裁剪后放入ImagView,布局文件是个Button和ImageView.为了图片的正常显示,我们在裁剪后先将裁剪好的图片先存放到SD卡中,这样就能在以后开启应用 ...
- ArrayAdapter使用方法
ArrayAdapter是一个简单的适配器,他的作用是将一个数组中的内容放入listView中.listView的item必须为textView. MainActivity.java package ...
- Calendar获取当天的初始时间,当月的初始时间,当年的初始时间
如下:
- [Web 前端 ] ES6 == ES 2015
cp from : https://www.cnblogs.com/ricoliu/p/5996149.html 遇到了一个困惑 原来称作es6的现在突然变成es2015 了 原因是这个事ecma ...