摘要: 解 蓝桥杯接触过一点应该就很简单。这里的代码没有局限于一年的,所以比较长。 重点就是闰年的判断以及在每一月的最后一天边界值的判断。 // // Created by 29273 on 2021-04-05. // #include "bits/stdc++.h" using namespace st 阅读全文
posted @ 2021-04-07 10:50 沃特艾文儿 阅读(21) 评论(0) 推荐(0)
摘要: 解 维护一个标记数组,每个人在t有时间时a[t]就加一,那么二者都有时间的时候就是a[t] == 2。 // // Created by 29273 on 2021-04-05. // #include "bits/stdc++.h" using namespace std; int a[10000 阅读全文
posted @ 2021-04-07 10:44 沃特艾文儿 阅读(23) 评论(0) 推荐(0)
摘要: 解 第一次想到的是前缀和,维护每一次梳果之后的个数,虽然正确,但最后发现没有很大的必要。 围成一个圈自然是和取余有关啦。 // // Created by 29273 on 2021-04-06. // #include "bits/stdc++.h" using namespace std; co 阅读全文
posted @ 2021-04-07 10:38 沃特艾文儿 阅读(19) 评论(0) 推荐(0)
摘要: 解 使用set来存储每一个点,通过查询其八个方向是否存在点来解题 // // Created by 29273 on 2021-04-07. // #include "bits/stdc++.h" using namespace std; int dir[8][2] = {{0, 1}, {0, - 阅读全文
posted @ 2021-04-07 10:30 沃特艾文儿 阅读(19) 评论(0) 推荐(0)
摘要: 解 用map来存储同一位置的u和v即可,key是index。注意可能溢出。 map<int, pair<int, int>> m; // // Created by 29273 on 2021-04-07. // #include "bits/stdc++.h" using namespace st 阅读全文
posted @ 2021-04-07 10:25 沃特艾文儿 阅读(23) 评论(0) 推荐(0)
摘要: 解 简单模拟 // // Created by 29273 on 2021-04-05. // #include "bits/stdc++.h" using namespace std; char a[13]; int change(char ch) { return ch - '0'; } int 阅读全文
posted @ 2021-04-07 10:20 沃特艾文儿 阅读(26) 评论(0) 推荐(0)
摘要: 加上题目审核不通过,我吐了QAQ 解 运用list的结构,使用erase和emplace_front 操作完成窗口的位置变化。 // // Created by 29273 on 2021-04-05. // #include "bits/stdc++.h" using namespace std; 阅读全文
posted @ 2021-04-07 10:18 沃特艾文儿 阅读(26) 评论(0) 推荐(0)