#308 (div.2) B. Vanya and Books】的更多相关文章

题目传送门 /* 水题:求总数字个数,开long long竟然莫名其妙WA了几次,也没改啥又对了:) */ #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <cmath> #include <vector> #include <string> #include <queue> #incl…
B. Vanya and Books Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/552/problem/B Description Vanya got an important task — he should enumerate books in the library and label each book with its number. Each of the n books sh…
1.题目描写叙述:点击打开链接 2.解题思路:本题要求统计数位的个数,简单的试验一下发现有例如以下规律:一个n位数的个数有9*(10^n)个.因此全部n位数的数位是n*9*(10^n)个.因此能够利用两个循环变量base,k来计算,当中base表示n位数的总个数,k表示每个n位数的数位有k位,循环条件是n-base>0,这样就可以完毕统计. 3.代码: #define _CRT_SECURE_NO_WARNINGS #include<iostream> #include<algor…
题目传送门 /* 水题:读懂题目就能做 */ #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <cmath> #include <vector> #include <string> #include <queue> #include <map> #include <se…
题目传送门 /* 题意:问是否能用质量为w^0,w^1,...,w^100的砝码各1个称出重量m,砝码放左边或在右边 暴力/进制转换:假设可以称出,用w进制表示,每一位是0,1,w-1.w-1表示砝码与物品放在一起,模拟判断每位是否ok 详细解释:http://blog.csdn.net/u011265346/article/details/46556361 总结:比赛时压根没往进制去想,连样例也不知道是怎么回事..中文不行啊:( */ #include <cstdio> #include &…
C. Vanya and Scales time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vanya has a scales for weighing loads and weights of masses w0, w1, w2, ..., w100 grams where w is some integer not less…
D. Vanya and Triangles Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/552/problem/D Description Vanya got bored and he painted n distinct points on the plane. After that he connected all the points pairwise and saw that as…
C. Vanya and Scales Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/552/problem/C Description Vanya has a scales for weighing loads and weights of masses w0, w1, w2, ..., w100 grams where w is some integer not less than 2 (…
A. Vanya and Table Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/552/problem/A Description Vanya has a table consisting of 100 rows, each row contains 100 cells. The rows are numbered by integers from 1 to 100 from bottom…
1.题目描写叙述:点击打开链接 2.解题思路:本题是一道简单的模拟题.每次扫描一个输入的长方形,然后将内部全部点都+1,终于统计数组全部元素的和就可以. 3.代码: #define _CRT_SECURE_NO_WARNINGS #include<iostream> #include<algorithm> #include<string> #include<sstream> #include<set> #include<vector>…