直接模拟

#include<cstdio>
#include<cstring>
using namespace std;
#define MAXN 10
#define MOD 47
char s[MAXN],t[MAXN];
int main()
{
scanf("%s %s",s+,t+);
int l1=strlen(s+),l2=strlen(t+),s1=,s2=;
for(int i=;i<=l1;i++)
s1=s1*(s[i]-'A'+)%MOD;
s1%=MOD;
for(int i=;i<=l2;i++)
s2=s2*(t[i]-'A'+)%MOD;
s2%=MOD;
if(s1==s2)
printf("GO\n");
else printf("STAY\n");
return ;
}

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

  1. USACO . 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 co ...

  2. USACO Section 1.1-1 Your Ride Is Here

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

  3. 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 ...

  4. 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 ...

  5. USACO-Your Ride Is Here(你的飞碟在这儿)-Section1.2<1>

    [英文原题] Your Ride Is Here It is a well-known fact that behind every good comet is a UFO. These UFOs o ...

  6. USACO_1.1_Your_Ride_Is_Here_(字符串+水题)

    描述 http://train.usaco.org/usacoprob2?a=y0SKxY0Kc2q&S=ride 给出两个由大写字母组成,长度不大于$6$的字符串. 将字符串中的各字母的字典 ...

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

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

  8. USACO 1.1.1 YOUR RIDE IS HERE

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

  9. USACO Section 1.1PROB Your Ride Is Here

    题目传送门 不能提交哦   http://www.nocow.cn/index.php/Translate:USACO/ride /* ID: jusonal1 PROG: ride LANG: C+ ...

随机推荐

  1. hdfs基本使用

    基本命令 /usr/local/hadoop/bin/hadoop fs -ls / /usr/local/hadoop/bin/hadoop fs -mkdir /test # 创建目录 /usr/ ...

  2. Eclipse 导入项目

  3. 期望与概率dp

    概率与期望dp 定义: 概率:事件A发生的可能性,计作P(A) 期望:事件A结果的平均大小,记住E(x) ​ E(x)=每种结果的大小与其概率的乘积的和 注意计算概率时需要考虑是否要用容斥原理 期望d ...

  4. 数据结构实验之链表五:单链表的拆分(SDUT 2120)

    #include <bits/stdc++.h> using namespace std; struct node { int data; struct node *next; }; st ...

  5. oracle表查询

    使用scott用户中存在的emp.dept表等做演示 一.单表查询 查看表结构:desc dept; 查看所有列:select * from dept: 查询指定列:select ename,sal, ...

  6. shell 读取文本并访问mysql/redis

    #!/bin/bash File="redeemcode.csv" #File=$ database="d_redeem_info" echo "ch ...

  7. 线程的join()方法

    官网描述 join public final void join() throws InterruptedException Waits for this thread to die. An invo ...

  8. 2017 ZSTU寒假排位赛 #7

    题目链接:https://vjudge.net/contest/149498#overview. A题,水题,直接按照题意模拟一下即可. B题,我用的是线段树.大力用的差分标记(上次听zy说过,下次再 ...

  9. hadoop HA+Federation(高可用联邦)搭建配置(一)

    hadoop HA+Federation(高可用联邦)搭建配置(一) 标签(空格分隔): 未分类 介绍 hadoop 集群一共有4种部署模式,详见<hadoop 生态圈介绍>. HA联邦模 ...

  10. 1.5 JAVA的IO操作

    1.5 JAVA的IO操作 参考链接:https://www.runoob.com/java/java-files-io.html 一.JAVA的IO操作 由于JAVA引用外界的数据,或是将自身的数据 ...