暴力
mengbi_er
一个蒟蒻JLoier
展开
-
Codeforces Round #422 (Div. 2) B. Crossword solving
题目大意给出较短串s和较长串t,s可以对应在任何位置,最少有多少位置不匹配。题解暴力。。。。 (注意把边界去掉) #include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;int read(){ char ch=getchar();int f=0;原创 2017-07-03 21:59:06 · 186 阅读 · 0 评论 -
Codeforces Round #420 (Div. 2) A. Okabe and Future Gadget Laboratory
题目大意给出一个n*n矩阵,判断对于每个不等于1的数是否存在其所在行和所在列数相加等于这个数。example3 1 1 2 2 3 1 6 4 1 output:Yes 2=1+1, 2=1+1,3=2+1, 6=2+4.4=3+1.题解暴力枚举即可。#include<iostream>#include<cstdio>#include<cstring>#include<algor原创 2017-06-26 12:52:59 · 236 阅读 · 0 评论 -
bzoj1599: [Usaco2008 Oct]笨重的石子
枚举,入门题。#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;int f[105],maxx,ans;int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); int n=a+b+c;原创 2017-07-05 19:22:55 · 242 阅读 · 0 评论 -
bzoj3750: [POI2015]Pieczęć
暴力出奇迹。#include<cstdio>#include<iostream>#include<cstring>#include<algorithm>using namespace std;bool k[1005][1005];int cx[1000005],cy[1000005],n,m,a,b;int main(){ int t; cin>>t; whi原创 2017-06-26 14:50:21 · 224 阅读 · 0 评论 -
Codeforces Round #426 (Div. 2) B. The Festive Evening
维护每个字母最先最后位置。#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;int read(){ char ch=getchar();int f=0; while(ch<'0'||ch>'9') ch=getchar(); while原创 2017-07-31 01:08:27 · 200 阅读 · 0 评论 -
Codeforces Round #425 (Div. 2)B. Petya and Exam
题目大意给出一个字符串和多组询问,‘?’代表一个好的字符,‘*’代表一个坏的字符串(可以是空串),能否让询问和字符串相同。题解由于‘*’只有一个,可以知道其代表的长度,暴力判断即可。(要注意询问比字符串长的情况)。#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;原创 2017-07-25 01:47:44 · 475 阅读 · 0 评论 -
Codeforces Round #433 (Div. 2)A. Fraction
题目大意求分子分母和为n的最大真分数。(分子分母互质)题解暴力QAQ。#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;int read(){ char ch=getchar();int f=0; while(ch<'0'||ch>'9') c原创 2017-09-07 14:11:56 · 185 阅读 · 0 评论 -
Codeforces Round #451 (Div. 2) C. Phone Numbers
题目大意问有多少不同的人以及每个人有多少种不同号码,一个串是另一个后缀则算相同号码。题解先将相同的人的电话合并,然后暴力去重就行了。#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;int read(){ char ch=getchar();int f原创 2017-12-16 22:38:27 · 232 阅读 · 0 评论