ZOJ 1001 A + B Problem】的更多相关文章

详解OJ(Online Judge)中PHP代码的提交方法及要点 Introduction of How to submit PHP code to Online Judge Systems  Introduction of How to commit submission in PHP to Online Judge Systems 在目前常用的在线oj中,codeforces.spoj.uva.zoj 等的题目可使用PHP实现基本算法,zoj是目前对PHP支持较好的中文OJ. PHP是一门比…
熟悉ZOJ环境,如何上传代码,如何查看结果. #include<iostream> using namespace std; int main(){ int a,b; while(cin>>a>>b){ cout<<a+b<<endl; } return 0; }…
洛谷1001 A+B Problem 本题地址:http://www.luogu.org/problem/show?pid=1001 题目描述 输入两个整数a,b,输出它们的和(|a|,|b|<=10^9).注意1.pascal使用integer会爆掉哦!2.有负数哦!3.c/c++的main函数必须是int类型,而且最后要return 0.这不仅对洛谷其他题目有效,而且也是noip/noi比赛的要求! 好吧,同志们,我们就从这一题开始,向着大牛的路进发.“任何一个伟大的思想,都有一个微不足道的…
题目链接  ZOJ Monthly, March 2018 Problem G 题意  给定一个字符串.现在求一个下标范围$[0, n - 1]$的$01$序列$f$.$f[x] = 1$表示存在一种方案,删掉原字符串中的连续$x$个字母, 使得剩下的字符串中任意相邻的两个字母都不同.在这道题中所有的字符串首尾字符看做是相邻的. 对于每个起始位置求出最多往右延伸到的位置,满足该区间代表的字符串是一个满足任意相邻字母不同的字符串. 首先考虑一个连续的满足任意相邻字母不同的字符串.设其长度为$l$…
题目链接  ZOJ Monthly, March 2018 Problem F 题意很明确 这个模数很奇妙,在$[0, mod)$的所有数满足任意一个数立方$48$次对$mod$取模之后会回到本身. 所以开$48$棵线段树,和一个永久标记.当对某个区间操作时对这个区间加一层永久标记. 即当前我要查找的第$x$层,实际找的是第$up[i] + x$层. 时间复杂度$O(48nlogn)$ #include <bits/stdc++.h> using namespace std; #define…
1001: A+B Problem 时间限制: 1 Sec  内存限制: 10 MB 提交: 4864  解决: 3132 [提交][状态][讨论版] 题目描述 Calculate a+b 输入 Two integer a,b (0<=a,b<=10) 输出 Output a+b 样例输入 1 2 样例输出 3 迷失在幽谷中的鸟儿,独自飞翔在这偌大的天地间,却不知自己该飞往何方-- #include <iostream> using namespace std; int main(…
ZOJ ACM题集,编译环境VC6.0 #include <stdio.h> int main() { int a,b; while(scanf("%d%d",&a,&b)!=EOF) { printf("%d\n",a+b); } ; }…
 Prime Ring Problem Time Limit: 10 Seconds      Memory Limit: 32768 KB A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime…
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1368 题目大意:计算从S到T中所有的数,其中0,1,2,3,4,5,6,7,8,9的个数,例如从1024到1032有1024 1025 1026 1027 1028 1029 1030 1031 1032,其中10个0,10个1,7个2,3个3等等 Sample Input 1 1044 497346 5421199 17481496 14031004 503171…
Problem Description Calculate A + B. Input Each line will contain two integers A and B. Process to end of file. Output For each case, output A + B in one line. Sample Input 1 1 2 2 3 3 Sample Output 2 4 6 我的代码: #include <stdio.h> int main() { int A,…