上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 17 下一页
摘要: 题目链接:https://www.luogu.com.cn/problem/P7074 一、dfs(25分)没有任何优化,时间复杂度约(O(3^(n*m))) 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n, m; 4 int a[1 阅读全文
posted @ 2020-11-19 15:20 TFLSNOI 阅读(508) 评论(0) 推荐(0) 编辑
摘要: 本题第一难点:字符串处理 方法一:纯模拟,时间复杂度O(q*|s|)~估计分数30左右 1 #include<bits/stdc++.h> 2 using namespace std; 3 char s[1000010]; 4 char c; 5 int len; 6 int n, a[100010 阅读全文
posted @ 2020-11-13 11:06 TFLSNOI 阅读(670) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.com.cn/problem/P7072 方法一:50分代码(时间复杂度为n*nlongn) 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n, w, a[100010], b[100010 阅读全文
posted @ 2020-11-09 11:05 TFLSNOI 阅读(1448) 评论(2) 推荐(0) 编辑
摘要: 方法一:模拟 1 #include<bits/stdc++.h> 2 using namespace std; 3 int main() 4 { 5 int n; 6 cin>>n; 7 if(n%2==1) 8 cout<<-1; 9 else{ 10 while(n>0){ 11 int p=1 阅读全文
posted @ 2020-11-07 16:25 TFLSNOI 阅读(2594) 评论(0) 推荐(0) 编辑
摘要: CCF2020 CSP-j2第二题 https://www.luogu.com.cn/problem/P5661 方法一:纯模拟(40分) 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n, bs[100005], p[100005], 阅读全文
posted @ 2020-10-30 19:30 TFLSNOI 阅读(357) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.luogu.com.cn/problem/P1160 很裸的一道队列的题 方法一:没审清题目,,直接就来写,笨笨得每次都扫描一遍链表导致TLE,最后得分40分 1 #include<bits/stdc++.h> 2 using namespace std; 3 int 阅读全文
posted @ 2020-10-27 16:55 TFLSNOI 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.luogu.com.cn/problem/P1083 一、5分题解: 1 #include<bits/stdc++.h> 2 using namespace std; 3 int main() 4 { 5 cout<<0; 6 return 0; 7 } View C 阅读全文
posted @ 2020-10-23 00:05 TFLSNOI 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.luogu.com.cn/problem/P3406 【解题思路】前缀和、查分 对于其中一小段,我们要么全部买纸票,要么全部刷卡。 所以我们只需要统计每一小段经过的总次数。 如果你暴力模拟统计的话,估计会tle。 怎么快速知道每一段次数呢? 我们回忆一下“借教室”这道 阅读全文
posted @ 2020-10-21 09:16 TFLSNOI 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.luogu.com.cn/problem/P3397 题目数据很水,但是差分的模版题 方法一:模拟 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n, m; 4 int sx, sy, ex, ey; 5 阅读全文
posted @ 2020-10-20 09:51 TFLSNOI 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 【问题描述】 给出一个n*m的矩阵,多次询问子矩阵中数字之和。 【输入格式】 第一行包含三个正整数n, m, k(n, m<=5000, k<=10000),分别表示矩阵行数和列数以及询问次数。 接下来的n行,每行包含m个整数(整数不超过10000),描述该矩阵。 接下来的k行询问,数据描述子矩阵左 阅读全文
posted @ 2020-10-15 16:44 TFLSNOI 阅读(1089) 评论(0) 推荐(0) 编辑
摘要: 链接:https://www.luogu.com.cn/problem/P1115 方法一:0分代码 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n, a[210000]; 4 int ans=-(1<<30); 5 int sum( 阅读全文
posted @ 2020-10-15 16:25 TFLSNOI 阅读(166) 评论(0) 推荐(1) 编辑
摘要: 先把如下代码熟悉,再学习BFS的框架 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxN=100; 4 int que[maxN];//定义数组模拟队列 5 int f, r;//队首队尾信息 6 int n;//输入数 阅读全文
posted @ 2020-10-04 17:27 TFLSNOI 阅读(206) 评论(0) 推荐(0) 编辑
摘要: http://ybt.ssoier.cn:8088/problem_show.php?pid=1219 1 #include<cstdio> 2 #include<cstring> 3 using namespace std; 4 int t;//表示输入t组数据 5 int n, m;//棋盘大小 阅读全文
posted @ 2020-10-04 16:08 TFLSNOI 阅读(1024) 评论(0) 推荐(0) 编辑
摘要: http://ybt.ssoier.cn:8088/problem_show.php?pid=1361 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int M=20; 4 int n,k,a[M],b[M]; 5 bool fla 阅读全文
posted @ 2020-10-03 13:16 TFLSNOI 阅读(645) 评论(0) 推荐(0) 编辑
摘要: http://ybt.ssoier.cn:8088/problem_show.php?pid=1362 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n, k;//按要求输入 4 int a, b;//按要求输入 5 int rel[1 阅读全文
posted @ 2020-10-02 18:13 TFLSNOI 阅读(1032) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 17 下一页