摘要: Children's Game 代码 #include<iostream> #include<algorithm> #include<stdio.h> using namespace std; string ao[51]; bool com(string a,string b) { return a 阅读全文
posted @ 2022-02-13 21:40 Lewis_1231 阅读(31) 评论(0) 推荐(0)
摘要: Smallest Sub-Array 代码 #include<iostream> #include<string.h> using namespace std; const int MAXN = 1e6 + 7; #define min(a,b) (a)<(b)?(a):(b) int a[MAXN 阅读全文
posted @ 2022-02-13 21:38 Lewis_1231 阅读(23) 评论(0) 推荐(0)
摘要: 维护序列 代码 #include<iostream> #define MAXN 100005 #define ll long long using namespace std; int n, m, mod,k; int a[MAXN]; struct Tree { ll sum, add, mul; 阅读全文
posted @ 2022-01-30 16:33 Lewis_1231 阅读(54) 评论(0) 推荐(0)
摘要: A Simple Problem with Integers 代码 #include<iostream> using namespace std; const int MAXN=100005; long long a[MAXN]; long long lazy[MAXN<<2]; struct tr 阅读全文
posted @ 2022-01-30 16:27 Lewis_1231 阅读(18) 评论(0) 推荐(0)
摘要: Can you answer these queries III? 代码 #include<iostream> #define max(a,b) ((a)>(b))?(a):(b) using namespace std; const int maxn = 100005; int n, m, x, 阅读全文
posted @ 2022-01-30 16:24 Lewis_1231 阅读(27) 评论(0) 推荐(0)
摘要: Can you answer these queries 1? 代码 #include<iostream> #include<algorithm> #include<cstdio> using namespace std; const int M = 1e5 + 5; int m, n, len, 阅读全文
posted @ 2022-01-30 16:21 Lewis_1231 阅读(19) 评论(0) 推荐(0)
摘要: D | 驾驶卡丁车 代码 #include<iostream> #include<math.h> #include<string> using namespace std; int mov[8][2] ={ {-1,0},{-1,1},{0,1},{1,1},{1,0},{1,-1},{0,-1}, 阅读全文
posted @ 2022-01-23 21:41 Lewis_1231 阅读(42) 评论(0) 推荐(0)
摘要: H | prime ring problem 质数环问题 题目分析 dfs递归搜索直到s=n时停止;停止时判断头和尾相加是否为素数; 这道题特别容易PE。。。 1.每一行末尾不能有空格 2.每一个case中间空行且第一个case前不能空行 代码 #include<iostream> #include 阅读全文
posted @ 2022-01-23 16:25 Lewis_1231 阅读(27) 评论(0) 推荐(0)
摘要: M | Protect sheep 题目分析 搜索每只狼的位置,再将每只狼用狗围住 代码 #include<iostream> using namespace std; char squ[501][501]; int m, n; int flag = 1; int dir[4][2] = { {0, 阅读全文
posted @ 2022-01-23 16:12 Lewis_1231 阅读(32) 评论(0) 推荐(0)
摘要: N | Maximum product 题目分析 1.遍历每一种情况大于max就替换 2.注意行末回车,否则会PE 3.EOF(end of file)按ctrl+z退出 代码 #include<iostream> #include<stdio.h> #include<math.h> #includ 阅读全文
posted @ 2022-01-23 16:03 Lewis_1231 阅读(41) 评论(0) 推荐(0)
点击右上角即可分享
微信分享提示