随笔分类 - whu_warmup3
摘要:题目地址:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3432题目思路: 其实就是找那个只出现了1次的字符串。 但是如果用数组或者map记录出现的次数,10w的数量会导致超时,学到一种神奇的方式--直接用异或处理先看代码:#include
#include
#include using namespace std; string s;
char sock[9];
char ans[9];
int main()
{ int n; cin>>n; while(cin>>n) { g...
阅读全文
摘要:题目地址:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4113思路:这个就是三维数组的地址和下标之间的对应。 然后涉及到一定的变换 ,我们有一个p【a】 记录在若干次对换之后实际对应的是哪个数。 同时,为了能用find函数找回坐标,我们还要记录反函数(写作pp【a】)然后这个value超过的xyz是不要输出的。代码:#include
#include
#include
#include
using namespace std; int p[1010];
int q[1010];
int r[1010]; int ...
阅读全文
浙公网安备 33010602011771号