摘要:
解 改变输出顺序即可 // // Created by 29273 on 2021-04-02. // #include "bits/stdc++.h" using namespace std; int n, m; int a[1001][1001]; int main() { cin >> n > 阅读全文
摘要:
解 模拟题,根据题意来,最好自己造几组测试数据。 先遍历有没有一组座位可以直接满足,没有就从头开始,不考虑连座把空余的座位直接分配(每一组都要分当前剩余座位大于等于和小于需求座位来处理)。 // // Created by 29273 on 2021-04-05. // #include "bits 阅读全文
摘要:
解 蓝桥杯接触过一点应该就很简单。这里的代码没有局限于一年的,所以比较长。 重点就是闰年的判断以及在每一月的最后一天边界值的判断。 // // Created by 29273 on 2021-04-05. // #include "bits/stdc++.h" using namespace st 阅读全文
摘要:
解 维护一个标记数组,每个人在t有时间时a[t]就加一,那么二者都有时间的时候就是a[t] == 2。 // // Created by 29273 on 2021-04-05. // #include "bits/stdc++.h" using namespace std; int a[10000 阅读全文
摘要:
解 第一次想到的是前缀和,维护每一次梳果之后的个数,虽然正确,但最后发现没有很大的必要。 围成一个圈自然是和取余有关啦。 // // Created by 29273 on 2021-04-06. // #include "bits/stdc++.h" using namespace std; co 阅读全文
摘要:
解 使用set来存储每一个点,通过查询其八个方向是否存在点来解题 // // Created by 29273 on 2021-04-07. // #include "bits/stdc++.h" using namespace std; int dir[8][2] = {{0, 1}, {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 阅读全文
摘要:
解 简单模拟 // // 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 阅读全文
摘要:
加上题目审核不通过,我吐了QAQ 解 运用list的结构,使用erase和emplace_front 操作完成窗口的位置变化。 // // Created by 29273 on 2021-04-05. // #include "bits/stdc++.h" using namespace std; 阅读全文