Problem 1000

输入:一行,两个空格隔开的整数A,B

输出:一个数A+B。

#include <iostream>
using namespace std;

int main()
{
    int a,b;
    cin>>a>>b;
    cout<<a+b;
    return 0;
}
#include <stdio.h>
scanf("%d %d",&a,&b);
时间: 2024-08-11 07:48:56

Problem 1000的相关文章

Problem 1000 to 1002

Problem 1000 问题: 输入两个正整数A,B,输出两个正整数之和A+B using System; //Input integer number A,B,output A+B. class Program { static void Main(string[] args) { string[] s = Console.ReadLine().Split(); Console.WriteLine("{0}", Convert.ToInt16(s[0]) + Convert.ToI

TopCoder SRM 560 Div 1 - Problem 1000 BoundedOptimization &amp; Codeforces 839 E

传送门:https://284914869.github.io/AEoj/560.html 题目简述: 定义"项"为两个不同变量相乘. 求一个由多个不同"项"相加,含有n个不同变量的式子的最大值. 另外限制了每一个变量的最大最小值R[i]和L[i]和所有变量之和的最大值Max. n<=13 题外话: 刚开始做这道题的时候,感觉意外眼熟? codeforces 839 E(此题的退化版):http://codeforces.com/contest/839/pro

TopCoder SRM 558 Div 1 - Problem 1000 SurroundingGame

题目简述  一个人在一个n * m棋盘上玩游戏,想要占领一个格子有两个方法: 在这个格子放一个棋子.  这个格子周围(四联通)的格子中**都有棋子**. 在(i, j)中放棋子需要花费cost[i][j],占领(i, j)能获得benefit[i][j].求一种放置棋子的方法,使得总收益(收益 - 花费)最大. 2<=n,m<=20 分析 一眼看上去, 状压? 我是不是dp学傻了..根本想不出 网络流? 嗯,此题是一道非常套路的网络流练习题. 如果想不到对棋盘进行黑白染色,就GG了. 所以套路

TopCoder SRM 561 Div 1 - Problem 1000 Orienteering

传送门:https://284914869.github.io/AEoj/561.html 题目简述: 题外话: 刚开始看题没看到|C|<=300.以为|C|^2能做,码了好久,但始终解决不了一棵树中多条直径去重的问题.后来才发现|C|<=300,暴力就可以了. 不知道有哪位大佬会|C|^2的做法?? 思路: 很显然,若length为树中经过所有S中的点的最短路径长度, 若size为虚树中所有边的长度和, 若dis为虚树中的最远点对的距离(即直径长度) 那么length=size*2-dis.

Topcoder SRM 660 Div2 Problem 1000 Powerit (积性函数)

令$f(x) = x^{2^{k}-1}$,我们可以在$O(k)$的时间内求出$f(x)$. 如果对$1$到$n$都跑一遍这个求解过程,时间复杂度$O(kn)$,在规定时间内无法通过. 所以需要优化. 显然这是一个积性函数,那么实际上只要对$10^{6}$以内的质数跑$O(k)$的求解过程. 而$10^{6}$以内的质数不到$8*10^{4}$个,优化之后可以通过. #include <bits/stdc++.h> using namespace std; #define rep(i, a,

[ACM]HDU Problem 1000 + Java

//no package name //import when necessary import java.util.Scanner; //it has to be Main class public class Main { public static void main(String[] args){ Scanner input = new Scanner(System.in); //Wrong answer when using while(true) while(input.hasNex

1000: A+B Problem(NetWork Flow)

1000: A+B Problem Time Limit: 1 Sec  Memory Limit: 5 MBSubmit: 11814  Solved: 7318[Submit][Status][Discuss] Description Calculate a+b Input Two integer a,b (0<=a,b<=10) Output Output a+b Sample Input 1 2 Sample Output 3 HINT Q: Where are the input a

1:A+B Problem

总时间限制:  1000ms  内存限制:  65536kB 描述 Calculate a + b 输入 Two integer a,,b (0 ≤ a,b ≤ 10) 输出 Output a + b 样例输入 1 2 样例输出 3 提示 Q: Where are the input and the output? A: Your program shall always read input from stdin (Standard Input) and write output to std

题目1000:计算a+b

题目描述: 求整数a,b的和. 输入: 测试案例有多行,每行为a,b的值. 输出: 输出多行,对应a+b的结果. 样例输入: 1 2 4 5 6 9 样例输出: 3 9 15 java Code import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); while(in.hasNextInt()){ int