11 2019 档案

摘要:元素选择器 記錄一下父節點,暴力往上面找 注意下標 i,j要分清楚!!! #include <iostream> #include <cstdio> #include <cstring> #include <string> #include<vector> using namespace std; 阅读全文
posted @ 2019-11-23 17:49 liulex 阅读(160) 评论(0) 推荐(0)
摘要:CIDR合并 如何判斷包含關係 把需要截取的部分用&運算獲取出來 然後判斷相同位置截取的結果是否相同,相同就是有包含關係 最後一個元素:ans[ans.end()-1] #include <iostream> #include <algorithm> using namespace std; str 阅读全文
posted @ 2019-11-23 16:03 liulex 阅读(278) 评论(0) 推荐(0)
摘要:字符画 通過樣例猜題意系列 注意讀題:每輸出完一行需要恢復背景色 這題用cout瘋狂爆零什麽鬼 #include <iostream> #include <string> #include <cstdio> using namespace std; int A[2004][2003][3]; int 阅读全文
posted @ 2019-11-23 13:41 liulex 阅读(345) 评论(0) 推荐(0)
摘要:命令行选项stringstream getline記得特殊處理一下數字n到第一行字符串中間的換行 1 #include <iostream> 2 #include <string> 3 #include <cstring> 4 #include <algorithm> 5 #include <vec 阅读全文
posted @ 2019-11-22 22:24 liulex 阅读(437) 评论(0) 推荐(0)
摘要:损坏的RAID5 string讀入卡cin 関同步 ios::sync_with_stdio(false) 由塊號映射到具體位置 塊號id對應第col個字符串 字符串開始的位置st 1 #include<iostream> 2 #include<string> 3 #include<cstdio> 阅读全文
posted @ 2019-11-22 21:03 liulex 阅读(322) 评论(0) 推荐(0)
摘要:A. Single Push 给定数组A,B,能否选取A中连续一段把A变得跟B相同 #include<bits/stdc++.h> using namespace std; #define int long long #define si signed #define pb push_back #d 阅读全文
posted @ 2019-11-18 21:57 liulex 阅读(167) 评论(0) 推荐(0)
摘要:IPython 变量名? 函数名?获取相关帮助 %run [文件名].py 执行py文件 数据的维度:一组数据的组织形式 列表和数组: 一组数据的有序结构 区别: 列表:数据类型可以不同 数组:数据类型相同 一维数据:列表(有序)、集合(无序) 二(多)维数据:多维列表 高维数据:字典类型、数据表示 阅读全文
posted @ 2019-11-12 19:26 liulex 阅读(159) 评论(0) 推荐(0)
摘要:每一位维护一颗线段树 (-1)^1 =-2 (-2)^1=-1 #include <cstdio> #include<iostream> using namespace std; //#define int long long #define si signed #define sc(x) scan 阅读全文
posted @ 2019-11-06 18:11 liulex 阅读(184) 评论(0) 推荐(0)
摘要:一堆序列拼接起来,找出现次数大于n/2的数 假设一个数出现次数大于n/2 那么它减去其他数出现的次数一定非负: = c) { cnt += t[i]; } } } } //cout<<c<<' '<<cnt<<' '<<sum<<endl; if (cnt * 2 <= sum) { cout << 阅读全文
posted @ 2019-11-03 17:38 liulex 阅读(282) 评论(0) 推荐(0)
摘要:Laptop 要求的是所有的存在s,w都比它大的物品的物品的个数 正着不好去重 倒着枚举s,当前位置后面的物品s都比它大,减掉w比他小的,就能判断是否有w也比他大的 如果有 ans++ #include<bits/stdc++.h> using namespace std; #define int 阅读全文
posted @ 2019-11-02 14:23 liulex 阅读(234) 评论(0) 推荐(0)
摘要:B. Rooms and Staircases 从前往后,或者从后往前枚举下该位置一二层各走一次 C. The Football Season 给定 n,p,w,d;w<d 要求 x⋅w+y⋅d=p x+y+z =n 即 x⋅w+y⋅d=p x+y< =n 被扩展欧几里得坑了== 数据范围爆long 阅读全文
posted @ 2019-11-02 11:12 liulex 阅读(153) 评论(0) 推荐(0)
摘要:B. Restricted RPS 贪心,下标i j要分清楚。。。 C. Constanze's Machine 出现w或者m直接输出0 出现连续个n或者u答案乘上dp[连续出现的个数k] dp可以递推得到 D. Shichikuji and Power Grid n个城市要通电,一些城市作为发电站 阅读全文
posted @ 2019-11-02 10:20 liulex 阅读(260) 评论(0) 推荐(0)