题意: 给你一个n*n的蛋糕,如果某个位置是'C'那就代表这是一个巧克力块,否则就不是.如果某两个巧克力块在同一行或同一列,那么这个家庭的幸福值就会加1,问你这个家庭的幸福值最大是多少 Input 3.CCC..C.C Output 4 Input 4CC..C..C.CC..CC. Output 9 If we number rows from top to bottom and columns from left to right, then, pieces that share the s…
1406A. Subset Mex https://codeforces.com/contest/1406/problem/A Example input 4 6 0 2 1 5 0 1 3 0 1 2 4 0 2 0 1 6 1 2 3 4 5 6 output 5 3 4 0 Note In the first test case,\(A=\{0,1,2\},B=\{0,1,5\}\) is a possible choice. In the second test case, \(A=\{…
A. Far Relative’s Birthday Cake time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Door's family is going celebrate Famil Doors's birthday party. They love Famil Door so they are planning to m…
Buffer sort引发的血案 今天遇到的一个问题,在线系统上,有两张表,test1大概50G,test2大概200G,需要查询出来test1表中部分记录,并且这些记录不存在test2表中.于是就写了一个sql: select t1.* from test1 t1, test2 t2 where t1.col1 = t2.col1(+) and t1.col2 = t2.col2(+) and t1.col3 = t2.col3(+) and t2.col1 is null; 因为是在线系统,…
题目链接: xiaoxin juju needs help Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 491 Accepted Submission(s): 142 Problem Description As we all known, xiaoxin is a brilliant coder. He knew **pal…
A. Anton and Polyhedrons 题目链接:http://codeforces.com/contest/785/problem/A 智障水题 实现代码: #include<bits/stdc++.h> using namespace std; int main(){ string s; ,t; cin>>t; while(t--){ cin>>s; if(s=="Tetrahedron") ans+=; else if(s==&quo…
A. k-String 统计每个字母出现次数即可. B. Special Offer! Super Price 999 Bourles! 枚举末尾有几个9,注意不要爆掉\(long\ long\)的范围. C. Color Stripe 当\(k\gt 2\)时,若\(s_i==s_{i-1}\),那么枚举新的字母使得\(s_i \ne s_{i-1},s_i \ne s_{i+1}\). 当\(k\gt 2\)时,则需要枚举首位是\(A\)是\(B\).在\(AAB\)这种情况下,\(k\gt…
D. Ralph And His Tour in Binary Country time limit per test 2.5 seconds memory limit per test 512 megabytes input standard input output standard output Ralph is in the Binary Country. The Binary Country consists of n cities and (n - 1) bidirectional…