A. Book Reading time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Recently Luba bought a very interesting book. She knows that it will take t seconds to read the book. Luba wants to finish r…
B. Japanese Crosswords Strike Back time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A one-dimensional Japanese crossword can be represented as a binary string of length x. An encoding of thi…
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 水模拟 [代码] #include <bits/stdc++.h> using namespace std; const int N = 100; int n,t,a[N+10]; int main(){ #ifdef LOCAL_DEFINE freopen("rush_in.txt", "r", stdin); #endif scanf("%d%d",&n…
A. Tennis Tournament 题目连接: http://www.codeforces.com/contest/628/problem/A Description A tennis tournament with n participants is running. The participants are playing by an olympic system, so the winners move on and the losers drop out. The tourname…
A. Tricky Sum Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/598/problem/A Description In this problem you are to calculate the sum of all integers from 1 to n, but you should take all powers of two with minus in the sum.…
B. New Skateboard 题目连接: http://www.codeforces.com/contest/628/problem/A Description Max wants to buy a new skateboard. He has calculated the amount of money that is needed to buy a new skateboard. He left a calculator on the floor and went to ask som…
A. Book Reading time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Recently Luba bought a very interesting book. She knows that it will take t seconds to read the book. Luba wants to finish r…
传送门 题意 给出n个数,q个询问,每个询问有两个数p,k,询问p+k+a[p]操作几次后超过n 分析 分块处理,在k<sqrt(n)时,用dp,大于sqrt(n)用暴力 trick 代码 #include<cstdio> int n,a[100100],p,k,q,dp[100100][350]; int main() { scanf("%d",&n); for(int i=1;i<=n;++i) scanf("%d",a+i);…
You are given two integers n and k. Find k-th smallest divisor of n, or report that it doesn't exist. Divisor of n is any such natural number, that n can be divided by it without remainder. Input The first line contains two integers n and k (1 ≤ n ≤ …
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 最后肯定会形成若干个环的. 把最大的两个环合在一起就好. 每个环贡献: 假设x=环的大小 ->x*x 注意int的溢出 [代码] #include <bits/stdc++.h> using namespace std; const int N = 1e5; int n,a[N+10]; bool flag[N+10]; vector <long long> v; int main(){ #ifdef LOC…