diff --git a/README.md b/README.md index 9b6640a..1b807ae 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ # bdfz_2024_summer +# 竞赛的一些方法 + +1. 真正难的地方是通过题目给的信息和性质推出要用的算法 + # 题目经验总结 ## Day2 ### [U111091 区间2段覆盖](./day2/U111091/U111091.md) @@ -9,9 +13,7 @@ >隔着老远swap一般不稳定 >稳定:插入,归并,冒泡 -# 竞赛的一些方法 -1. 真正难的地方是通过题目给的信息和性质推出要用的算法 ## Day3 ### [U86432 捞鱼(fish)](./day3/U86432/U86432.md) @@ -104,4 +106,5 @@ ll ksm(ll a,ll b,ll M){ >扫描线 >矩阵乘法 - +## Day9 +### 字典树与异或极值 diff --git a/day9/P2580/P2580.cpp b/day9/P2580/P2580.cpp new file mode 100644 index 0000000..d9412f1 --- /dev/null +++ b/day9/P2580/P2580.cpp @@ -0,0 +1,85 @@ +//AC Code +#include +using namespace std; + +struct Node{ + bool v=false; + bool is_word=false; + int next=0; +}; + +const int MAXN=1e6; +int n,tn=0,m; +Node t[MAXN][26]; + +int main(int argc,char *argv[]){ + ios::sync_with_stdio(false); + cin.tie(0); + + #ifdef OITEST + #define AS(c){if(!(c)){cerr<<"assert faild :"<<#c<>n; + for(int i=1;i<=n;i++){ + string s; + cin>>s; + int now=0; + for(int j=0;j>m; + for(int i=1;i<=m;i++){ + string s; + cin>>s; + int now=0; + #ifdef OIPRINT + // cout<>cans; + string myans; + ss>>myans; + AS(myans==cans) + #endif + } +} \ No newline at end of file diff --git a/day9/P2580/P2580_1.in b/day9/P2580/P2580_1.in new file mode 100644 index 0000000..2a13b4e --- /dev/null +++ b/day9/P2580/P2580_1.in @@ -0,0 +1,4 @@ +1 +ad +1 +a diff --git a/day9/P2580/P2580_1.out b/day9/P2580/P2580_1.out new file mode 100644 index 0000000..3367140 --- /dev/null +++ b/day9/P2580/P2580_1.out @@ -0,0 +1 @@ +WRONG diff --git a/day9/P2580/P2580_2.in b/day9/P2580/P2580_2.in new file mode 100644 index 0000000..2fd2bc2 --- /dev/null +++ b/day9/P2580/P2580_2.in @@ -0,0 +1,10 @@ +5 +a +b +c +ad +acd +3 +a +a +e \ No newline at end of file diff --git a/day9/P2580/P2580_2.out b/day9/P2580/P2580_2.out new file mode 100644 index 0000000..68d2cc3 --- /dev/null +++ b/day9/P2580/P2580_2.out @@ -0,0 +1,3 @@ +OK +REPEAT +WRONG \ No newline at end of file diff --git a/xmake.lua b/xmake.lua index cd424f7..fdc5a39 100644 --- a/xmake.lua +++ b/xmake.lua @@ -87,4 +87,12 @@ target("U279656") for v=1,3 do local s=tostring(v) add_tests(s,{files="./day8/U279656/*.cpp",runargs={"seg"..s..".in","seg"..s..".ans"},defines="OITEST",run_timeout=1000}) - end \ No newline at end of file + end + + target("P2580") + set_rundir("./day9/P2580") + add_files("./day9/P2580/*.cpp") + for v=1,2 do + local s=tostring(v) + add_tests(s,{files="./day9/P2580/*.cpp",runargs={"P2580_"..s..".in","P2580_"..s..".out"},defines="OITEST",run_timeout=1000}) + end \ No newline at end of file