随笔分类 -  IO

摘要:Tree首先根据中序遍历和后序遍历递归地构造二叉树(后续遍历的最后一个节点为二叉树的根节点),然后前序遍历。输入有点坑,你说你直接告诉多少个节点多好。。。我想的是先用fets读取整个串,然后用atoi转化为数字,本地运行没问题可是一提交就报错,暂时还没找到原因,大概是... 阅读全文
posted @ 2018-05-29 23:23 ACLJW 阅读(132) 评论(0) 推荐(0)
摘要:Updating a Dictionaryversion 1:#include#include#include#include#includeusing namespace std;const int maxl = 100 + 5;int t,n;char c;voi... 阅读全文
posted @ 2018-04-22 16:56 ACLJW 阅读(208) 评论(0) 推荐(0)
摘要:Alignment of Code#include#include#include#include#includeusing namespace std;const int maxw = 180 + 5;const int maxl = 1000 + 5;int sp... 阅读全文
posted @ 2018-04-21 01:14 ACLJW 阅读(120) 评论(0) 推荐(0)
摘要:The Letter Carrier's Rounds注意可能有重复的收件人。version 1(20ms):#include#include#include#include#include#includeusing namespace std;const int m... 阅读全文
posted @ 2018-04-20 17:10 ACLJW 阅读(112) 评论(0) 推荐(0)
摘要:PGA Tour Prize Money 这道题太麻烦了,先放这儿,日后再说。。。#include#include#includeusing namespace std;const int maxn = 150;struct player{ char name[... 阅读全文
posted @ 2018-04-19 19:18 ACLJW 阅读(225) 评论(0) 推荐(0)
摘要:Database思路:只枚举c1和c2,然后从上到下扫描各行。每次碰到一个新的行r,把c1,c2两列的内容作为一个二元组存到一个map中。如果map的键值中已经存在这个二元组,该二元组映射到的就是所要求的r1,而当前行就是r2。在主循环之前先做一个预处理——给所有字符... 阅读全文
posted @ 2018-04-18 00:00 ACLJW 阅读(167) 评论(0) 推荐(0)
摘要:Unix ls #include#include#includeusing namespace std;const int len = 60 + 2;void print(const string& s,int len,char extra){ cout>n){... 阅读全文
posted @ 2018-04-17 21:21 ACLJW 阅读(135) 评论(0) 推荐(0)
摘要:Othello我的这道题的代码还是比较简洁的哈哈。version 1:#include#includeusing namespace std;int n,wn,bn;int dxs[3] = {0,1,-1};int dys[3] = {0,1,-1};char c,... 阅读全文
posted @ 2018-04-13 13:30 ACLJW 阅读(189) 评论(0) 推荐(0)
摘要:Some message encoding schemes require that an encoded message be sent in two parts. The first part, called the header, contains the ch... 阅读全文
posted @ 2018-04-11 10:18 ACLJW 阅读(213) 评论(0) 推荐(0)
摘要:A children’s puzzle that was popular 30 years ago consisted of a 5×5 frame which contained 24 smallsquares of equal size. A unique let... 阅读全文
posted @ 2018-04-05 13:18 ACLJW 阅读(259) 评论(0) 推荐(0)