玲珑杯 1005 Spoon Devil's RP Test(水题)
来源:互联网 发布:小猪三网通源码 编辑:程序博客网 时间:2024/04/23 14:43
【题目链接】http://www.ifrog.cc/acm/problem/1005
【题意】就是把字符串,按照题上规则转成整数,并且对101取模。
【AC 代码】
////Created by just_sort 2016/9/25 21:03//Copyright (c) 2016 just_sort.All Rights Reserved//#include <set>#include <map>#include <queue>#include <stack>#include <cmath>#include <cstdio>#include <cstdlib>#include <cstring>#include <iostream>#include <algorithm>using namespace std;typedef long long ll;const int mod = 101;int a[27];char s[1010];int main(){ for(int i=1; i<=26; i++) a[i] = i*i; int T; scanf("%d",&T); while(T--){ scanf("%s",s); int ans = 0; int len = strlen(s); for(int i=0; i<len; i++){ string temp = ""; int x = a[s[i]-'a'+1]; while(x){ temp += x%10+'0'; x /= 10; } reverse(temp.begin(),temp.end()); for(int j=0; temp[j]; j++){ ans = (ans*10 + temp[j]-'0')%mod; } } printf("%d\n",ans); } return 0;}
0 0
- 玲珑杯 1005 Spoon Devil's RP Test(水题)
- 玲珑学院OJ 1005 - Spoon Devil's RP Test(求余问题)
- Lonlife-ACM 1005 - Spoon Devil's RP Test(同余定理)——“玲珑杯”acm比赛-试运行赛
- 玲珑杯 1003 Spoon Devil's Diamond Mine
- 玲珑杯 1009 Spoon Devil's Bucket 矩阵优化DP
- 玲珑杯1006 Spoon Devil Love Arithmetic
- 玲珑杯 1007 Spoon Devil Love Game
- 玲珑学院OJ 1000 - Spoon Devil's 3-D Matrix(3维最小生成树)
- 玲珑学院OJ 1000 Spoon Devil's 3-D Matrix
- 玲珑杯 1008 Spoon Devil Love Arithmetic Again
- Lonlife-ACM 1000 - Spoon Devil's 3-D Matrix(最小生成树)——“玲珑杯”acm比赛-试运行赛
- Lonlife 1000 - Spoon Devil's 3-D Matrix
- Spoon Devil Love Arithmetic
- FZU_1615 Hero's RP
- 玲珑杯(树状数组)
- 玲珑杯round18(数论)
- 玲珑杯 1146(dp)
- 看魔鬼代言人(Devil's Advocate)有感
- ASP.NET MVC分页
- Multiple dex files define Lcom/umeng/socialize/PlatformConfig$Platform;
- DS1302测出时间并且在LCD1602上面显示
- css3之布局相关的样式
- HTML基础
- 玲珑杯 1005 Spoon Devil's RP Test(水题)
- java数组
- HttpClient的post请求
- Python 04
- 以软件师为目标第一篇入门博客
- window/linux双系统时间错误的调整
- js div随鼠标移动,css图片放大镜效果
- java反射机制(一)
- tyvj p1088 treat(水的不能再水的dp)