[BZOJ1000]A+B Problem Description 输入两个数字,输出它们之和 Input 一行两个数字A,B(0<=A,B<100) Output 输出这两个数字之和 Sample Input 1 2 Sample Output 3 题解:这种傻逼题也有人写题解? 其实在BZ做1000题算多吗?像我这种水怪来说水1000题还是挺容易的.一般来说,遇到特别难的题总是避而远之,遇到特别水的题也不太想刷(嗯,只是不想~),所以收获了什么呢?给我随便找一道BZ原题我也不一定能做上.那…
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 C++ #include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; cout << a + b << en…
题目链接: Water problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 23    Accepted Submission(s): 14 Problem Description If the numbers 1 to 5 are written out in words: one, two, three, four, fi…
一.Description Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an algorithm whose classification is not known for all…
https://codeforc.es/contest/1194/problem/B 好像也没什么思维,就是一个水题,不过蛮有趣的.意思是找缺黑色最少的行列十字.用O(n)的空间预处理掉一维,然后用O(n)的时间根据另一维计算出答案. #include<bits/stdc++.h> using namespace std; typedef long long ll; int n, m; string g[50005]; int rq[50005]; int main() { #ifdef Yi…
An easy problem Time Limit: 8000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 467    Accepted Submission(s): 258 Problem Description One day, a useless calculator was being built by Kuros. Let's assume that…
Problem Description In this problem you need to make a multiply table of N * N ,just like the sample out. The element in the ith row and jth column should be the product(乘积) of i and j. Input The first line of input is an integer C which indicate the…
转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud Tourist Problem Iahub is a big fan of tourists. He wants to become a tourist himself, so he planned a trip. There are n destinations on a straight road that Iahub wants to visit. Iahub starts…
A water problem 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5832 Description Two planets named Haha and Xixi in the universe and they were created with the universe beginning. There is 73 days in Xixi a year and 137 days in Haha a year. Now you k…
wyh2000 and a string problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 484    Accepted Submission(s): 232 Problem Description Young theoretical computer scientist wyh2000 is teaching you…
C. NP-Hard Problem 题目连接: http://www.codeforces.com/contest/688/problem/C Description Recently, Pari and Arya did some research about NP-Hard problems and they found the minimum vertex cover problem very interesting. Suppose the graph G is given. Subs…
一.Description Eva的家庭作业里有很多数列填空练习.填空练习的要求是:已知数列的前四项,填出第五项.因为已经知道这些数列只可能是等差或等比数列,她决定写一个程序来完成这些练习. Input 第一行是数列的数目t(0 <= t <= 20).以下每行均包含四个整数,表示数列的前四项.约定数列的前五项均为不大于10^5的自然数,等比数列的比值也是自然数. Output 对输入的每个数列,输出它的前五项. 二.题解      又是水题啊,感觉不能这样下去了,不然我自己也变水了. 三.j…
传送门 一道考验思维的交互题 大致思路就是从最高的二进制位向下询问 代入例子比如: 5 6 6 5 7 4 6 4 讨论一下 交互题的重点学会推理和归纳 #include <bits/stdc++.h> using namespace std; int n, a, b; inline int ask(int c, int d) { printf("? %d %d\n", c, d); fflush(stdout); int rt; scanf("%d",…
https://oj.neu.edu.cn/problem/1460 思路:若n=(p1^a1)*(p2^a2)...(pn^an),则f(n,0)=a1*a2*...*an,显然f(n,0)是积性函数,对于f(x,y)可以看出他是f(x,y-1)与自身进行狄利克雷卷积得到的结果,所以f(x,y)也是积性函数.因此,只要对n质因子分解,然后与预理出次方的dp值即可.注意积性函数的概念中a,b必须互质! #include<bits/stdc++.h> #define int long long…
A. Sweet Problem the first pile contains only red candies and there are r candies in it, the second pile contains only green candies and there are g candies in it, the third pile contains only blue candies and there are b candies in it. Each day Tany…
A. Math Problem Your math teacher gave you the following problem: There are n segments on the x-axis, [l1;r1],[l2;r2],-,[ln;rn]. The segment [l;r] includes the bounds, i.e. it is a set of such x that l≤x≤r. The length of the segment [l;r] is equal to…
Egg Problem 时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte总提交: 22 测试通过: 7 描述 There is a very interesting problem described as follows: You are given two eggs. You have access to a 100-storey building. An egg that survives a fall can be used again. A b…
Let’s start with a very classical problem. Given an array a[1…n] of positive numbers, if the value of each element in the array is distinct, how to find the maximum element in this array? You may write down the following pseudo code to solve this pro…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4716 直接搞.. //STATUS:C++_AC_0MS_288KB #include <functional> #include <algorithm> #include <iostream> //#include <ext/rope> #include <fstream> #include <sstream> #include <…
pro:二维平面上,给定N个村庄.M个士兵驻守,把村庄围住,现在我们想留下更多的士兵休息,使得剩下的士兵任然满足围住村庄.N,M<500: sol:即是要找一个最小的环,环把村庄围住. 由于是环, 最小的点数等价于最小的边数. 所以我们求最小的边数,而士兵之间能有有向边,当且仅当所有的村庄在有向边的左边(逆时针连边). 然后就是floyd最小环. #include<bits/stdc++.h> #define ll long long #define rep(i,a,b) for(int…
题目链接: hdu:http://acm.hdu.edu.cn/showproblem.php?pid=5170 bc(中文):http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=567&pid=1001 题解: 先用java大数幂写的,t了 import java.util.*; import java.math.*; public class Main { public static void main(St…
 题目链接 //巨坑的一道题,输入的m,n要判断大小,输出还要按照原来的顺序,范围还是i<=n<=j #include <iostream> #include <cstdio> #include <algorithm> using namespace std; int alro(int x) { ; ) { ) x = *x+; ; ct++; } return ct; } int main() { int m,n; while (cin>>m&…
以后还是这样 25道题一起发 看着爽 noip失利之后发粪涂墙 刷了一波bzoj 题解: bzoj1000 A+B问题 这题不同的人有不同的写法,我写了个线段树套Treap,应该还是挺简单的 但是看别的大神的代码跑的飞快就粘过来吧   这题竟然不用树套树,太强了 #include<iostream> #include<cstdio> #include<cstdlib> #include<cmath> #include<cstring> #incl…
C. Vladik and fractions 题目链接 http://codeforces.com/contest/743/problem/C 题面 Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction as a sum of three distinct posit…
A. Vladik and flights 题目链接 http://codeforces.com/contest/743/problem/A 题面 Vladik is a competitive programmer. This year he is going to win the International Olympiad in Informatics. But it is not as easy as it sounds: the question Vladik face now is…
A - Noldbach problem 题面链接 http://codeforces.com/contest/17/problem/A 题面 Nick is interested in prime numbers. Once he read about Goldbach problem. It states that every even integer greater than 2 can be expressed as the sum of two primes. That got Nic…
A - Mike and Cellphone 问有没有多解,每个点按照给出的序列用向量法跑一遍 #include<cstdio> #include<cstring> #include<queue> #include<cstdlib> #include<algorithm> #include<vector> #include<cmath> #include<map> using namespace std; ty…
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight Moves1101 Gamblers1204 Additive equations 1221 Risk1230 Legendary Pokemon1249 Pushing Boxes 1364 Machine Schedule1368 BOAT1406 Jungle Roads1411 Annive…
[CF简单介绍] 提交链接:http://codeforces.com/contest/560/problem/B 题面: B. Gerald is into Art time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Gerald bought two very rare paintings at the Sotheby's a…
bzoj1000 A+B Problem Scanner sc=new Scanner(new BufferedInputStream(System.in)); 声明读入器 nextInt 读入整数 System.out.println 带换行输出 import java.util.*; import java.io.*; public class Main{ public static void main(String[] argc){ Scanner sc = new Scanner (ne…