题目链接:http://poj.org/problem?id=2260 题意:一种校验码,查出一位的比特差错。 思路:校验码的原理与思路很明确,计算出每行每列的和,找出该和为奇数的点,该点所对应的x,y坐标即为所求。超过两位输出"Corrupt"。 代码: #include<cstdio> #inc ...
分类:
其他好文 时间:
2018-01-21 20:36:36
阅读次数:
117
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=92 题意:对于一段文字,其中有些词语是乱序的,要求输出只出现一次的单词,按字典序。 思路:对于每 ...
分类:
其他好文 时间:
2018-01-21 01:14:42
阅读次数:
163
题目链接:http://codeforces.com/problemset/problem/612/C 题意:有四种括号,按一定顺序出现,问能否完成括号的匹配,如果不能完成,最少更改几个括号能够完成括号匹配。(注意,左括号只能更换为左括号。同理右括号) 思路:本题具有这样的特征,在每次遇到括号的时候 ...
分类:
其他好文 时间:
2018-01-21 00:13:52
阅读次数:
147
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1756 题意:题目给出每行按空格分割的文本数据,要求统计出文章中所有的单词并按字典序输出,不区分 ...
分类:
其他好文 时间:
2018-01-21 00:12:35
阅读次数:
162
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1022 题意:火车进出站,可看作不同的数字的按一定顺序进栈,能否按所要求的顺序出栈。 思路:将出栈顺序保留着数组中,进栈顺序,只要目前的元素不为出栈顺序的数组的值,就进栈。如123 321。因为1不等于3 ...
分类:
其他好文 时间:
2018-01-21 00:09:21
阅读次数:
166
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3146 题意:有一种名叫包的数据类型,要求通过输入输出情况判断是哪种数据类型。 思路:模拟题,将 ...
分类:
其他好文 时间:
2018-01-21 00:06:39
阅读次数:
241
异或 暴力开数组,然而明显不过,要求32768k,结果超时了 #include <cstdio> #include <cstring> int book[1000000]; int main() { int n; while (scanf("%d", &n) && n) { int a; memse ...
分类:
其他好文 时间:
2018-01-19 23:30:58
阅读次数:
214
今天考的题目都是DP,本来以为会有什么图论...根据今天题目比较水的原因,我直接放解题报告,大家应该可以看得懂。。 T1 Source #include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> using nam ...
分类:
其他好文 时间:
2018-01-01 18:10:50
阅读次数:
186
``` include include define LL long long using namespace std; const int maxn = 10000; LL a[maxn]; int n; //返回row的值 int xorGauss()//可以用来解模二的方程,加快速度 { in ...
分类:
其他好文 时间:
2017-12-24 20:15:01
阅读次数:
160
516. 求和 【问题描述】给出一个数列A1,A2….,An和K,P。设Sij=Ai+Ai+1+…+AjAnaswer=min{Si,j mod P | si,j mod P≥K),其中i≤j,(si,j mod P | si,j mod P≥K}非空。 【输入格式】第一行一个正整数n,K,P。第二 ...
分类:
其他好文 时间:
2017-12-19 01:45:38
阅读次数:
234