JustOj 1936: 小明A+B
题目描述
小明今年3岁了, 现在他已经能够认识100以内的非负整数, 并且能够进行100以内的非负整数的加法计算. 对于大于等于100的整数, 小明仅保留该数的最后两位进行计算, 如果计算结果大于等于100, 那么小明也仅保留计算结果的最后两位. 例如, 对于小明来说: 1) 1234和34是相等的 2) 35+80=15 给定非负整数A和B, 你的任务是代表小明计算出A+B的值.
输入
输入数据的第一行为一个正整数T, 表示测试数据的组数. 然后是T组测试数据. 每组测试数据包含两个非负整数A和B(A和B均在int型可表示的范围内).
输出
对于每组测试数据, 输出小明A+B的结果.
样例输入
2
35 80
15 1152
样例输出
15
67 题解:终于找到一道能提交的题了 运算结果对100取模
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
ll gcd(ll a,ll b){
return b?gcd(b,a%b):a;
}
const int N=;
const int mod=1e9+;
int main()
{
std::ios::sync_with_stdio(false);
int n;
cin>>n;
while(n--){
int a,b,s=;
cin>>a>>b;
if(a>=) a%=;
if(b>=) b%=;
s+=a;
s%=;
s+=b;
s%=;
cout<<s<<endl;
}
return ;
}
JustOj 1936: 小明A+B的更多相关文章
- 小明的密码-初级DP解法
#include #include #include using namespace std; int visited[5][20][9009];// 访问情况 int dp[5][20][9009] ...
- 小明系列问题――小明序列(LIS)
小明系列问题――小明序列 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit ...
- ACM 擅长排列的小明
擅长排列的小明 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描述 小明十分聪明,而且十分擅长排列计算.比如给小明一个数字5,他能立刻给出1-5按字典序的全排列,如果你想 ...
- ACM 懒省事的小明
懒省事的小明 时间限制:3000 ms | 内存限制:65535 KB 难度:3 描述 小明很想吃果子,正好果园果子熟了.在果园里,小明已经将所有的果子打了下来,而且按果子的不同种 ...
- 管闲事的小明-nyoj51
描述某校大门外长度为L的马路上有一排树,每两棵相邻的树之间的间隔都是1米.我们可以把马路看成一个数轴,马路的一端在数轴0的位置,另一端在L的位置:数轴上的每个整数点,即0,1,2,……,L,都种有一棵 ...
- HDU2096 小明A+B
入门级都没到的水题!看到顺便就做了,AC记录喜+1 Description 小明今年3岁了, 现在他已经能够认识100以内的非负整数, 并且能够进行100以内的非负整数的加法计算. 对于大于等于100 ...
- 小明A+B[HDU2096]
小明A+B Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submi ...
- nyist 676 小明的求助
http://acm.nyist.net/JudgeOnline/problem.php?pid=676 小明的求助 时间限制:2000 ms | 内存限制:65535 KB 难度:2 描述 ...
- nyist 604 小明的难题
http://acm.nyist.net/JudgeOnline/problem.php?pid=604 小明的难题 时间限制:1000 ms | 内存限制:65535 KB 难度:1 描述 ...
随机推荐
- postman测试iop中url时的idtoken
记得填写 X-Auth-Token 对应cookies中的 token_id
- ELKStack的基础入门和中文指南
一.ELKStack的中文指南 redhat系列配置repo源 rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch vi / ...
- 【LeetCode每天一题】Find First and Last Position of Element in Sorted Array(找到排序数组中指定元素的开始和结束下标)
Given an array of integers nums sorted in ascending order, find the starting and ending position of ...
- python socket 老生常谈
没啥可说的,直接看代码 //server import socket s = socket.socket() host = socket.gethostname() print 'host: ', h ...
- 用int还是用Integer?
昨天例行code review时大家有讨论到int和Integer的比较和使用. 这里做个整理,发表一下个人的看法. [int和Integer的区别] int是java提供的8种原始类型之一,ja ...
- GIS 网站 参考网站
GIS 网站 参考:https://malagis.com/arcgis-operate-videos-example-38-summary.html
- python number
一.number类型转换 int(x [,base ]) 将x转换为一个整数 long(x [,base ]) 将x转换为一个长整数 float(x ) 将x转换到一个浮点数 complex(real ...
- mysql常用参数监控
1.系统mysql的进程数 ps -ef | grep "mysql" | grep -v "grep" | wc –l 2.Slave_running m ...
- django 网站的搭建(2)
这里使用nginx+uwsgi的方法来搭建生产环境 1,pip3.5 install uwsgi 下载uwsgi ,这里就不做测试了,一般不会出错 2,将django与uwsgi连接在一起 毕竟ru ...
- 爬取笔下wenxue小说
import urllib.request from bs4 import BeautifulSoup import re def gethtml(url): page=urllib.request. ...