题目大意: 一开始第一行是 1,第二行是2 4 ,第三行是3 5 7 9 ,类似这样下去,每一行的个数是上一行的个数,然后对这些点从第一个进行编号,问你从[l,r]区间数的和. 思路:分别求出奇数和偶数的个数.然后开始暴力.居然过了== 公式;前m个奇数的和是(m^2),前m个偶数的和是(m*(m+1)). #include<bits/stdc++.h> using namespace std; #define int unsigned long long #define mod 100000…
A. Far Relative's Birthday Cake 题意: 求在同一行.同一列的巧克力对数. 分析: 水题~样例搞明白再下笔! 代码: #include<iostream> using namespace std; const int maxn = 105; char a[maxn][maxn]; int main (void) { int N;cin>>N; int cnt = 0, res = 0; for(int i = 0; i < N; i++){ cn…
#include<bits/stdc++.h> using namespace std; #define inf 0x3f3f3f3f3f3f #define int long long ]; signed main(){ int n,k; cin>>n>>k; string str; cin>>str; map<int,int> mp; ; ;i<str.size();i++){ if(!mp[str[i]-'A']){ mp[str[i…
最近状态极差..水题不想写,难题咬不动..哎,CF的题那么简单,还搞崩了= =.真是巨菜无比. Codeforces777A 题意:略. 思路: 构造出3!次变换,然后输出就好. Code: #include <bits/stdc++.h> using namespace std; int a[6][4]={{1,2,3},{2,1,3},{2,3,1},{3,2,1},{3,1,2},{1,3,2}}; int main() { int n,x; scanf("%d",&…
Codeforces Round #603 (Div. 2) A. Sweet Problem A. Sweet Problem time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have three piles of candies: red, green and blue candies: the first pile…
Hard problem 题目链接: http://codeforces.com/contest/706/problem/C Description Vasiliy is fond of solving different tasks. Today he found one he wasn't able to solve himself, so he asks you to help. Vasiliy is given n strings consisting of lowercase Engl…