上一页 1 2 3 4 5 6 ··· 17 下一页
摘要: U69096 前缀和的逆 #include<bits/stdc++.h> using namespace std; int n, a[10010]; int main() { cin>>n; for(int i=1; i<=n; i++)cin>>a[i]; for(int i=1; i<=n; i 阅读全文
posted @ 2023-02-11 09:55 TFLSNOI 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 题目链接 方法一:纯模拟50分 #include<bits/stdc++.h> using namespace std; int n, m; int a[100010]; int l, r; int ans; int main() { cin>>n; for(int i=1; i<=n; i++)c 阅读全文
posted @ 2023-02-11 09:37 TFLSNOI 阅读(79) 评论(0) 推荐(0) 编辑
摘要: ##图的连通性 P3388 【模板】割点(割顶) [道路建设 POJ 3352](缩点模版) P3387 【模板】缩点 ##KMP 【模板】KMP字符串匹配 剪花布条 HDU-2087 ##优先队列 P1168 中位数 ##链式前向星 P3916 图的遍历 ##ST表、RMQ问题 P3865 【模板 阅读全文
posted @ 2022-12-07 10:35 TFLSNOI 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 模拟写法 枚举子集 #include<bits/stdc++.h> using namespace std; int main() { int n; int b[100]; cin>>n; for(int i=0; i<=n; i++)b[i]=0; while(b[0]==0){ for(int 阅读全文
posted @ 2022-12-03 11:37 TFLSNOI 阅读(39) 评论(0) 推荐(0) 编辑
摘要: 题目来源 CSP2022-J-T4 题解0 根据数据规模k=0的情况有40%,可尝试使用BFS,结果只有10分,其他点提示TLE //根据数据范围可知k=0数据为40%,数据规模不大可用BFS实现 #include<iostream> #include<queue> #include<algorit 阅读全文
posted @ 2022-11-30 18:20 TFLSNOI 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 题目链接 P1359 租用游艇 题目分类 区间动态规划 题解 #include<bits/stdc++.h> using namespace std; int n; int r[210][210]; int dp[210][210]; int main() { cin>>n; for(int i=1 阅读全文
posted @ 2022-11-28 20:58 TFLSNOI 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 题目链接 CSP2022-S-T2 题解1 纯模拟 60 #include<bits/stdc++.h> using namespace std; const int max_n=1e4+10, max_m=1e4+10; int n, m, q; long long a[max_n], b[max 阅读全文
posted @ 2022-11-21 23:06 TFLSNOI 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 题目链接 http://oj.tfls.net/d/lnzt/p/16 根据数据规模k=0的情况有40%,可尝试使用BFS,结果只有10分,其他点提示TLE //根据数据范围可知k=0数据为40%,数据规模不大可用BFS实现 #include<iostream> #include<queue> #i 阅读全文
posted @ 2022-11-18 16:18 TFLSNOI 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 题目来源 CSP2022-J-T1:http://oj.tfls.net/d/lnzt/p/14 题解一: 枚举:同鸡兔同笼 根据题意:n=p*q e*d-1=(p-1)*(q-1) 根据数据规模可知,枚举2~sqrt(e*d-1)更快,时间复杂度约为k*sqrt(m)=10^9部分会TLE 预计得 阅读全文
posted @ 2022-11-02 15:57 TFLSNOI 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 题目来源 CSP2022-J-T1:http://oj.tfls.net/d/lnzt/p/13 题目分析 根据【数据范围】来分析 题解 int 占用空间4字节,32位,取值范围-2^31 ~ 2^31-1,大约能够表示绝对值不超过2.1*10^9的整数 long long 占用空间8字节,64位, 阅读全文
posted @ 2022-10-31 15:58 TFLSNOI 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 本部分主要整理历年比赛真题题解,由于水平有限只提供部分分的写法,意在给学生打暴力和部分分的获取提供启示 2022 | CSP-J | CSP-S | NOIP | | | | | | T1乘方 | T1 | T1 | | T2解密 | T2策略游戏 | T2 | | T3 | T3 | T3 | | 阅读全文
posted @ 2022-10-13 10:17 TFLSNOI 阅读(48) 评论(0) 推荐(0) 编辑
摘要: 题目链接 上网统计 思路 vector yh[1010] 的理解:yh为1010大小的数组,每个数组元素为vector 类型,样例存储方式 | cnt | yh[cnt][0] | yh[cnt][1] | yh[cnt][2] | yh[cnt][...] | | | | | | | | 0 | 阅读全文
posted @ 2022-10-13 09:53 TFLSNOI 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 题目链接: https://vjudge.net/problem/HDU-3527 https://www.dotcpp.com/oj/problem2064.html 题解 #include<iostream> #include<cstring> #include<cmath> #include< 阅读全文
posted @ 2022-10-12 16:49 TFLSNOI 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 题目1链接 有序序列合并 写法1:数组模拟 #include<bits/stdc++.h> using namespace std; int a1[20], a2[20], a[40]; int main() { int n=15; for(int i=1; i<=n; i++)cin>>a1[i] 阅读全文
posted @ 2022-09-09 09:49 TFLSNOI 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 一位银矿勘探员无力支付3月份的房租。他有一根长31英寸的纯银条,因此他和女房东达成如下协议。他说,他将把银条切成小段。3月份的第一天,他给女房东1英寸长的一段,然后每天给他增加1英寸,以此作为抵押。勘探员预期到3月份的最后一天,能全数付清租金,而届时女房东将把银条小段全部还给他。问:勘探员至少需要把 阅读全文
posted @ 2022-08-23 11:07 TFLSNOI 阅读(40) 评论(1) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 17 下一页