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…
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 所有数字的和加上n-1,如果为x则唯一,否则不唯一 [代码] #include <bits/stdc++.h> using namespace std; int n,x,tot; int main(){ #ifdef LOCAL_DEFINE freopen("rush_in.txt", "r", stdin); #endif scanf("%d%d",&n,…
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…
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…
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 最后肯定会形成若干个环的. 把最大的两个环合在一起就好. 每个环贡献: 假设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…
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 水模拟 [代码] #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…
B. HDD is Outdated Technology 题目连接: http://www.codeforces.com/contest/612/problem/B Description HDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can…
B. Queries on a String Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/598/problem/B Description You are given a string s and should process m queries. Each query is described by two 1-based indices li, ri and integer ki. I…
A. Diplomas and Certificates time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There are n students who have taken part in an olympiad. Now it's time to award the students. Some of them will…
题目链接:http://codeforces.com/contest/813/problem/B 题意:就是有一个数叫做不幸运数,满足题目的 n = x^a + y^b,现在给你一个区间[l,r],让你找一个在这个区间里面一个最长的区间使得这个区间里面的所有数都不是不幸运数,让你输出最长区间的区间长度 . 先用两个数组将x的n次方和y的n次方存起来,然后暴力枚举,用map将符合的条件的数存起来,不幸运数的区间就是两个幸运数的位置之差相减再减1.(注意map迭代器的用法) #include <bi…