├── tools ├── configurstion-file-analysis │ ├── test.cpp │ ├── analysis.log │ ├── control.ini │ ├── examples │ │ ├── A+B Problem │ │ │ ├── control.ini │ │ │ ├── test.cpp │ │ │ └── analysis.log │ │ ├── Luogu P1093 │ │ │ ├── control.ini │ │ │ ├── test.cpp │ │ │ └── analysis.log │ │ ├── Luogu P1002 │ │ │ ├── control.ini │ │ │ ├── test.cpp │ │ │ └── analysis.log │ │ ├── Luogu P1018 │ │ │ ├── control.ini │ │ │ ├── test.cpp │ │ │ └── analysis.log │ │ └── Luogu P1003 │ │ │ ├── control.ini │ │ │ ├── test.cpp │ │ │ └── analysis.log │ └── analysis.hpp ├── Extensions │ └── YourExtensionName.hpp ├── Compare │ ├── FULLtest.exe │ ├── IOIStyle.exe │ ├── NOIPStyle.exe │ ├── FULLtest.cpp │ ├── NOIPStyle.cpp │ └── IOIStyle.cpp └── Introduction-Chinese │ ├── index.md │ └── index.html ├── examples ├── CF1A Theatre Square │ ├── data-CF1A │ │ ├── CF1A1.out │ │ ├── CF1A10.out │ │ ├── CF1A2.out │ │ ├── CF1A3.out │ │ ├── CF1A4.out │ │ ├── CF1A5.out │ │ ├── CF1A6.out │ │ ├── CF1A7.out │ │ ├── CF1A8.out │ │ ├── CF1A9.out │ │ ├── CF1A7.in │ │ ├── CF1A1.in │ │ ├── CF1A10.in │ │ ├── CF1A2.in │ │ ├── CF1A3.in │ │ ├── CF1A4.in │ │ ├── CF1A5.in │ │ ├── CF1A6.in │ │ ├── CF1A8.in │ │ └── CF1A9.in │ ├── std.cpp │ └── test.cpp ├── Luogu P3366 │ ├── data-Luogu_P3366 │ │ ├── Luogu_P33661.out │ │ ├── Luogu_P336610.out │ │ ├── Luogu_P33662.out │ │ ├── Luogu_P33663.out │ │ ├── Luogu_P33664.out │ │ ├── Luogu_P33665.out │ │ ├── Luogu_P33666.out │ │ ├── Luogu_P33667.out │ │ ├── Luogu_P33668.out │ │ ├── Luogu_P33669.out │ │ ├── Luogu_P33661.in │ │ ├── Luogu_P33662.in │ │ ├── Luogu_P33663.in │ │ ├── Luogu_P33664.in │ │ ├── Luogu_P33666.in │ │ ├── Luogu_P336610.in │ │ ├── Luogu_P33665.in │ │ ├── Luogu_P33667.in │ │ ├── Luogu_P33668.in │ │ └── Luogu_P33669.in │ ├── test.cpp │ └── std.cpp ├── A+B Problem │ ├── data-A+B_Problem_Test │ │ ├── A+B_Problem_Test1.out │ │ ├── A+B_Problem_Test10.out │ │ ├── A+B_Problem_Test2.out │ │ ├── A+B_Problem_Test3.out │ │ ├── A+B_Problem_Test4.out │ │ ├── A+B_Problem_Test5.out │ │ ├── A+B_Problem_Test6.out │ │ ├── A+B_Problem_Test7.out │ │ ├── A+B_Problem_Test8.in │ │ ├── A+B_Problem_Test8.out │ │ ├── A+B_Problem_Test9.out │ │ ├── A+B_Problem_Test1.in │ │ ├── A+B_Problem_Test10.in │ │ ├── A+B_Problem_Test2.in │ │ ├── A+B_Problem_Test3.in │ │ ├── A+B_Problem_Test4.in │ │ ├── A+B_Problem_Test5.in │ │ ├── A+B_Problem_Test6.in │ │ ├── A+B_Problem_Test7.in │ │ └── A+B_Problem_Test9.in │ ├── std.cpp │ └── test.cpp └── Luogu P1093 │ ├── data-Luogu_P1093 │ ├── Luogu_P10931.out │ ├── Luogu_P109310.out │ ├── Luogu_P10932.out │ ├── Luogu_P10933.out │ ├── Luogu_P10934.out │ ├── Luogu_P10935.out │ ├── Luogu_P10936.out │ ├── Luogu_P10937.out │ ├── Luogu_P10938.out │ ├── Luogu_P10939.out │ ├── Luogu_P10931.in │ ├── Luogu_P10936.in │ ├── Luogu_P10939.in │ ├── Luogu_P10937.in │ ├── Luogu_P10938.in │ ├── Luogu_P109310.in │ ├── Luogu_P10932.in │ ├── Luogu_P10934.in │ ├── Luogu_P10935.in │ └── Luogu_P10933.in │ ├── test.cpp │ └── std.cpp ├── myprogram.cpp ├── std.cpp ├── .github ├── ISSUE_TEMPLATE │ ├── custom.md │ ├── feature_request.md │ └── bug_report.md └── FUNDING.yml ├── test.cpp ├── package.json ├── .gitignore ├── .vscode ├── tasks.json ├── launch.json └── settings.json ├── LICENSE ├── README.md ├── CONTRIBUTING.md ├── README.ru.md ├── README.en-us.md └── caryon.h /tools/configurstion-file-analysis/test.cpp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tools/configurstion-file-analysis/analysis.log: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tools/configurstion-file-analysis/control.ini: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/CF1A Theatre Square/data-CF1A/CF1A1.out: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /examples/CF1A Theatre Square/data-CF1A/CF1A10.out: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /examples/CF1A Theatre Square/data-CF1A/CF1A2.out: -------------------------------------------------------------------------------- 1 | 6 2 | -------------------------------------------------------------------------------- /examples/CF1A Theatre Square/data-CF1A/CF1A3.out: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /examples/CF1A Theatre Square/data-CF1A/CF1A4.out: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /examples/CF1A Theatre Square/data-CF1A/CF1A5.out: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /examples/CF1A Theatre Square/data-CF1A/CF1A6.out: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /examples/CF1A Theatre Square/data-CF1A/CF1A7.out: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /examples/CF1A Theatre Square/data-CF1A/CF1A8.out: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /examples/CF1A Theatre Square/data-CF1A/CF1A9.out: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /examples/Luogu P3366/data-Luogu_P3366/Luogu_P33661.out: -------------------------------------------------------------------------------- 1 | 44 2 | -------------------------------------------------------------------------------- /examples/Luogu P3366/data-Luogu_P3366/Luogu_P336610.out: -------------------------------------------------------------------------------- 1 | orz 2 | -------------------------------------------------------------------------------- /examples/Luogu P3366/data-Luogu_P3366/Luogu_P33662.out: -------------------------------------------------------------------------------- 1 | orz 2 | -------------------------------------------------------------------------------- /examples/Luogu P3366/data-Luogu_P3366/Luogu_P33663.out: -------------------------------------------------------------------------------- 1 | 48 2 | -------------------------------------------------------------------------------- /examples/Luogu P3366/data-Luogu_P3366/Luogu_P33664.out: -------------------------------------------------------------------------------- 1 | orz 2 | -------------------------------------------------------------------------------- /examples/Luogu P3366/data-Luogu_P3366/Luogu_P33665.out: -------------------------------------------------------------------------------- 1 | 63 2 | -------------------------------------------------------------------------------- /examples/Luogu P3366/data-Luogu_P3366/Luogu_P33666.out: -------------------------------------------------------------------------------- 1 | orz 2 | -------------------------------------------------------------------------------- /examples/Luogu P3366/data-Luogu_P3366/Luogu_P33667.out: -------------------------------------------------------------------------------- 1 | 52 2 | -------------------------------------------------------------------------------- /examples/Luogu P3366/data-Luogu_P3366/Luogu_P33668.out: -------------------------------------------------------------------------------- 1 | orz 2 | -------------------------------------------------------------------------------- /examples/Luogu P3366/data-Luogu_P3366/Luogu_P33669.out: -------------------------------------------------------------------------------- 1 | 55 2 | -------------------------------------------------------------------------------- /examples/A+B Problem/data-A+B_Problem_Test/A+B_Problem_Test1.out: -------------------------------------------------------------------------------- 1 | 33 -------------------------------------------------------------------------------- /examples/A+B Problem/data-A+B_Problem_Test/A+B_Problem_Test10.out: -------------------------------------------------------------------------------- 1 | 157 -------------------------------------------------------------------------------- /examples/A+B Problem/data-A+B_Problem_Test/A+B_Problem_Test2.out: -------------------------------------------------------------------------------- 1 | 152 -------------------------------------------------------------------------------- /examples/A+B Problem/data-A+B_Problem_Test/A+B_Problem_Test3.out: -------------------------------------------------------------------------------- 1 | 140 -------------------------------------------------------------------------------- /examples/A+B Problem/data-A+B_Problem_Test/A+B_Problem_Test4.out: -------------------------------------------------------------------------------- 1 | 108 -------------------------------------------------------------------------------- /examples/A+B Problem/data-A+B_Problem_Test/A+B_Problem_Test5.out: -------------------------------------------------------------------------------- 1 | 128 -------------------------------------------------------------------------------- /examples/A+B Problem/data-A+B_Problem_Test/A+B_Problem_Test6.out: -------------------------------------------------------------------------------- 1 | 78 -------------------------------------------------------------------------------- /examples/A+B Problem/data-A+B_Problem_Test/A+B_Problem_Test7.out: -------------------------------------------------------------------------------- 1 | 121 -------------------------------------------------------------------------------- /examples/A+B Problem/data-A+B_Problem_Test/A+B_Problem_Test8.in: -------------------------------------------------------------------------------- 1 | 6 53 -------------------------------------------------------------------------------- /examples/A+B Problem/data-A+B_Problem_Test/A+B_Problem_Test8.out: -------------------------------------------------------------------------------- 1 | 59 -------------------------------------------------------------------------------- /examples/A+B Problem/data-A+B_Problem_Test/A+B_Problem_Test9.out: -------------------------------------------------------------------------------- 1 | 138 -------------------------------------------------------------------------------- /examples/CF1A Theatre Square/data-CF1A/CF1A7.in: -------------------------------------------------------------------------------- 1 | 9153 76336 76586 2 | -------------------------------------------------------------------------------- /examples/A+B Problem/data-A+B_Problem_Test/A+B_Problem_Test1.in: -------------------------------------------------------------------------------- 1 | 22 11 -------------------------------------------------------------------------------- /examples/A+B Problem/data-A+B_Problem_Test/A+B_Problem_Test10.in: -------------------------------------------------------------------------------- 1 | 90 67 -------------------------------------------------------------------------------- /examples/A+B Problem/data-A+B_Problem_Test/A+B_Problem_Test2.in: -------------------------------------------------------------------------------- 1 | 59 93 -------------------------------------------------------------------------------- /examples/A+B Problem/data-A+B_Problem_Test/A+B_Problem_Test3.in: -------------------------------------------------------------------------------- 1 | 90 50 -------------------------------------------------------------------------------- /examples/A+B Problem/data-A+B_Problem_Test/A+B_Problem_Test4.in: -------------------------------------------------------------------------------- 1 | 61 47 -------------------------------------------------------------------------------- /examples/A+B Problem/data-A+B_Problem_Test/A+B_Problem_Test5.in: -------------------------------------------------------------------------------- 1 | 65 63 -------------------------------------------------------------------------------- /examples/A+B Problem/data-A+B_Problem_Test/A+B_Problem_Test6.in: -------------------------------------------------------------------------------- 1 | 51 27 -------------------------------------------------------------------------------- /examples/A+B Problem/data-A+B_Problem_Test/A+B_Problem_Test7.in: -------------------------------------------------------------------------------- 1 | 83 38 -------------------------------------------------------------------------------- /examples/A+B Problem/data-A+B_Problem_Test/A+B_Problem_Test9.in: -------------------------------------------------------------------------------- 1 | 97 41 -------------------------------------------------------------------------------- /examples/CF1A Theatre Square/data-CF1A/CF1A1.in: -------------------------------------------------------------------------------- 1 | 24165 24242 24162 2 | -------------------------------------------------------------------------------- /examples/CF1A Theatre Square/data-CF1A/CF1A10.in: -------------------------------------------------------------------------------- 1 | 82180 76336 76586 2 | -------------------------------------------------------------------------------- /examples/CF1A Theatre Square/data-CF1A/CF1A2.in: -------------------------------------------------------------------------------- 1 | 63935 24242 24162 2 | -------------------------------------------------------------------------------- /examples/CF1A Theatre Square/data-CF1A/CF1A3.in: -------------------------------------------------------------------------------- 1 | 70496 70560 70468 2 | -------------------------------------------------------------------------------- /examples/CF1A Theatre Square/data-CF1A/CF1A4.in: -------------------------------------------------------------------------------- 1 | 28933 29029 29077 2 | -------------------------------------------------------------------------------- /examples/CF1A Theatre Square/data-CF1A/CF1A5.in: -------------------------------------------------------------------------------- 1 | 76391 76336 76586 2 | -------------------------------------------------------------------------------- /examples/CF1A Theatre Square/data-CF1A/CF1A6.in: -------------------------------------------------------------------------------- 1 | 84798 76336 76586 2 | -------------------------------------------------------------------------------- /examples/CF1A Theatre Square/data-CF1A/CF1A8.in: -------------------------------------------------------------------------------- 1 | 63726 76336 76586 2 | -------------------------------------------------------------------------------- /examples/CF1A Theatre Square/data-CF1A/CF1A9.in: -------------------------------------------------------------------------------- 1 | 91942 76336 76586 2 | -------------------------------------------------------------------------------- /myprogram.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | int main() { 3 | // put your program here 4 | } -------------------------------------------------------------------------------- /std.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | int main() { 3 | // put your standard program here. 4 | } -------------------------------------------------------------------------------- /tools/Extensions/YourExtensionName.hpp: -------------------------------------------------------------------------------- 1 | #include "caryon.h" 2 | #if CarYon <= 3.4 3 | 4 | #endif 5 | -------------------------------------------------------------------------------- /tools/Compare/FULLtest.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luosiwei-cmd/CarYon/HEAD/tools/Compare/FULLtest.exe -------------------------------------------------------------------------------- /tools/Compare/IOIStyle.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luosiwei-cmd/CarYon/HEAD/tools/Compare/IOIStyle.exe -------------------------------------------------------------------------------- /examples/Luogu P1093/data-Luogu_P1093/Luogu_P10931.out: -------------------------------------------------------------------------------- 1 | 26 290 2 | 35 289 3 | 87 274 4 | 183 274 5 | 204 266 6 | -------------------------------------------------------------------------------- /examples/Luogu P1093/data-Luogu_P1093/Luogu_P109310.out: -------------------------------------------------------------------------------- 1 | 11 288 2 | 89 278 3 | 184 266 4 | 195 266 5 | 189 266 6 | -------------------------------------------------------------------------------- /examples/Luogu P1093/data-Luogu_P1093/Luogu_P10932.out: -------------------------------------------------------------------------------- 1 | 41 285 2 | 152 256 3 | 81 255 4 | 287 255 5 | 267 252 6 | -------------------------------------------------------------------------------- /examples/Luogu P1093/data-Luogu_P1093/Luogu_P10933.out: -------------------------------------------------------------------------------- 1 | 183 286 2 | 189 279 3 | 148 274 4 | 55 267 5 | 124 265 6 | -------------------------------------------------------------------------------- /examples/Luogu P1093/data-Luogu_P1093/Luogu_P10934.out: -------------------------------------------------------------------------------- 1 | 157 272 2 | 60 270 3 | 7 263 4 | 262 261 5 | 14 258 6 | -------------------------------------------------------------------------------- /examples/Luogu P1093/data-Luogu_P1093/Luogu_P10935.out: -------------------------------------------------------------------------------- 1 | 94 296 2 | 177 289 3 | 154 284 4 | 106 266 5 | 31 260 6 | -------------------------------------------------------------------------------- /examples/Luogu P1093/data-Luogu_P1093/Luogu_P10936.out: -------------------------------------------------------------------------------- 1 | 54 281 2 | 298 275 3 | 279 273 4 | 156 257 5 | 238 249 6 | -------------------------------------------------------------------------------- /examples/Luogu P1093/data-Luogu_P1093/Luogu_P10937.out: -------------------------------------------------------------------------------- 1 | 271 267 2 | 85 267 3 | 171 260 4 | 57 260 5 | 241 257 6 | -------------------------------------------------------------------------------- /examples/Luogu P1093/data-Luogu_P1093/Luogu_P10938.out: -------------------------------------------------------------------------------- 1 | 83 270 2 | 247 256 3 | 41 254 4 | 230 253 5 | 170 243 6 | -------------------------------------------------------------------------------- /examples/Luogu P1093/data-Luogu_P1093/Luogu_P10939.out: -------------------------------------------------------------------------------- 1 | 283 291 2 | 142 265 3 | 48 251 4 | 262 250 5 | 296 245 6 | -------------------------------------------------------------------------------- /tools/Compare/NOIPStyle.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luosiwei-cmd/CarYon/HEAD/tools/Compare/NOIPStyle.exe -------------------------------------------------------------------------------- /examples/A+B Problem/std.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | int main(){ 3 | int a,b; 4 | std::cin>>a>>b; 5 | std::cout< 2 | using namespace std; 3 | int main(){ 4 | long long n,m,a; 5 | cin>>n>>m>>a; 6 | if(n%a==0) n/=a; 7 | else n=n/a+1; 8 | if(m%a==0) m/=a; 9 | else m=m/a+1; 10 | cout< 3 | using namespace std; 4 | using namespace ca; // namespace 5 | int main() { 6 | dataname = ""; // dataname 7 | maxtime = 1000; 8 | makein(/*start*/, /*end*/) { 9 | csh(); 10 | // Please finish these rows 11 | } 12 | makeout(/*start*/, /*end*/); 13 | debug(/*start*/, /*end*/); 14 | return 0; 15 | } -------------------------------------------------------------------------------- /examples/Luogu P1093/test.cpp: -------------------------------------------------------------------------------- 1 | #include"caryon.h" 2 | using namespace std; 3 | using namespace ca; 4 | int main(){ 5 | dataname="Luogu_P1093"; 6 | makein(1,10){ 7 | csh(); 8 | int n; 9 | n=300; 10 | inint(n); 11 | instring("\n"); 12 | for(int i=0;i 2 | using namespace std; 3 | struct pupil{ 4 | int no; 5 | int c; 6 | int m; 7 | int e; 8 | int s; 9 | }; 10 | bool cmp(pupil x,pupil y){ 11 | if(x.s!=y.s) return x.s>y.s; 12 | if(x.c!=y.c) return x.c>y.c; 13 | else return x.no>n; 18 | pupil a[n]; 19 | for(int i=0;i>a[i].c>>a[i].m>>a[i].e; 21 | a[i].no=i+1; 22 | a[i].s=a[i].c+a[i].m+a[i].e; 23 | } 24 | sort(a,a+n,cmp); 25 | for(int i=0;i<5;i++){ 26 | cout< 3 | using namespace std; 4 | using namespace ca; // namespace 5 | graph< int > example; 6 | int main() { 7 | dataname = "Luogu_P3366"; // dataname 8 | maxtime = 1000; 9 | makein(1, 10) { 10 | csh(); 11 | if (cyrand(0, 1) > 0) { 12 | example = rand_graph(10, 10, 1, 10, cyrand); 13 | } 14 | else { 15 | do{ 16 | example = rand_graph(10, 10, 1, 10, cyrand); 17 | }while(!example.is_connect()); 18 | } 19 | ingraph(example); 20 | // Please finish these rows 21 | } 22 | makeout(1, 10); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /tools/configurstion-file-analysis/examples/Luogu P1003/test.cpp: -------------------------------------------------------------------------------- 1 | #include"caryon.h" 2 | using namespace std; 3 | using namespace ca; 4 | 5 | int main(){ 6 | makein(1,10){ 7 | csh(); 8 | int n; 9 | n=1000; 10 | int i; 11 | int j; 12 | inint(n); 13 | instring("\n"); 14 | for(i=1;i<=n;i+=1){ 15 | for(j=1;j<=4;j+=1){ 16 | inint(cyrand(0,100)); 17 | instring(" "); 18 | } 19 | instring("\n"); 20 | } 21 | for(i=1;i<=2;i+=1){ 22 | inint(cyrand(1,99)); 23 | instring(" "); 24 | } 25 | } 26 | makeout(1,10); 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright <2020> 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. 4 | 5 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 6 | -------------------------------------------------------------------------------- /tools/configurstion-file-analysis/examples/A+B Problem/analysis.log: -------------------------------------------------------------------------------- 1 | [LOG] Makein function was written successfully. 2 | [CHECKER] Checking how many space(s) will be used. 3 | [CHECKER] For row 2, there will be 8 space(s) here. 4 | [LOG] Make a random number successfully. 5 | [CHECKER] Checking how many space(s) will be used. 6 | [CHECKER] For row 3, there will be 8 space(s) here. 7 | [LOG] Make a string or a space successfully. 8 | [CHECKER] Checking how many space(s) will be used. 9 | [CHECKER] For row 4, there will be 8 space(s) here. 10 | [LOG] Make a random number successfully. 11 | [CHECKER] Checking how many space(s) will be used. 12 | [CHECKER] For row 5, there will be 8 space(s) here. 13 | [LOG] Make a string or a space successfully. 14 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /tools/Introduction-Chinese/index.md: -------------------------------------------------------------------------------- 1 | # CarYon:一款基于C++的OI/ACM 比赛测试数据生成器 2 | 3 | ![img](https://img.shields.io/badge/Avatar-luosw-red.svg) ![img](https://img.shields.io/github/package-json/v/luosiwei-cmd/caryon) ![img](https://img.shields.io/npm/dm/datamaker-caryon) ![img](https://img.shields.io/npm/dt/datamaker-caryon) ![](https://img.shields.io/npm/l/datamaker-caryon) ![img](https://img.shields.io/npm/v/datamaker-caryon) 4 | 5 | 在举办自己的OI比赛的时候,你有没有遇到过以下问题: 6 | 7 | - 想快速生成一段文字? 8 | - 想快速进行数学运算来生成数据? 9 | - 想不用freopen等时间一个一个的生成测试数据? 10 | - 希望生成一组随机数据或者数列? 11 | - 快速生成数据来和两个程序对拍? 12 | 13 | 那么,你可以借助CarYon和C++,来快速生成数据。目前支持的特性有: 14 | 15 | - 随机生成一段文章,一些单词,一些字母 16 | - 脱离RAND_MAX的限制,自由拟定随机数 17 | - 正在开发的数学库,支持多种特性 18 | - 建一些圆形,正多边形和分数,用它来进行运算 19 | 20 | ## 使用 CarYon 21 | 22 | CarYon 采用 C++ 编写,在安装好 C++ 的计算机上,只需要 include `caryon.h` 就可以使用内含的多种功能啦。 23 | 24 | 如果您对 C++ 不熟悉,请查看 C++ 快速入门 Wiki -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "[BUG] " 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /tools/Compare/FULLtest.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | #define UKE -1 5 | #define AC 1 6 | #define WA 0 7 | int compareFile(FILE* file_compared, FILE* file_checked) { 8 | bool diff = 0; 9 | int N = 65536; 10 | char* b1 = (char*)calloc(1, N + 1); 11 | char* b2 = (char*)calloc(1, N + 1); 12 | size_t s1, s2; 13 | 14 | do { 15 | s1 = fread(b1, 1, N, file_compared); 16 | s2 = fread(b2, 1, N, file_checked); 17 | if ((s1 != s2) || memcmp(b1, b2, s1)) { 18 | diff = 1; 19 | break; 20 | } 21 | } while (!feof(file_compared) || !feof(file_checked)); 22 | 23 | free(b1); 24 | free(b2); 25 | 26 | if (diff) 27 | return 0; 28 | else 29 | return 1; 30 | } 31 | int main(int argc, char* argv[]) { 32 | if (argc <= 2) { 33 | return UKE; 34 | } 35 | FILE* fuser = fopen(argv[1], "r"); 36 | FILE* fstd = fopen(argv[2], "r"); 37 | if (compareFile(fuser, fstd) == 1) { 38 | return AC; 39 | } 40 | else { 41 | return WA; 42 | } 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /tools/Compare/NOIPStyle.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | #define UKE -1 4 | #define AC 1 5 | #define WA 0 6 | int compareFile(FILE* file_compared, FILE* file_checked) { 7 | bool diff = 0; 8 | int N = 65536; 9 | char b1[65536], b2[65536]; 10 | size_t s1, s2; 11 | while (1) { 12 | if (fgets(b1, N, file_compared) == NULL || 13 | fgets(b2, N, file_checked) == NULL) { 14 | break; 15 | } 16 | s1 = strlen(b1); 17 | s2 = strlen(b2); 18 | if ((s1 != s2 && s1 + 2 != s2 && s1 - 2 != s2 && s1 + 1 != s2 && 19 | s1 - 1 != s2) || 20 | memcmp(b1, b2, min(s1, s2) - 1)) { 21 | diff = 1; 22 | break; 23 | } 24 | } 25 | if (diff) 26 | return 0; 27 | else 28 | return 1; 29 | } 30 | int main(int argc, char** argv) { 31 | if (argc < 2) { 32 | return UKE; 33 | } 34 | FILE* fuser = fopen(argv[1], "r"); 35 | FILE* fstd = fopen(argv[2], "r"); 36 | if (compareFile(fuser, fstd) == 1) { 37 | return AC; 38 | } 39 | else { 40 | return WA; 41 | } 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "(gdb) Launch", // 配置名称,将会在启动配置的下拉菜单中显示 6 | "type": "cppdbg", // 配置类型,这里只能为cppdbg 7 | "request": "launch", // 请求配置类型,可以为launch(启动)或attach(附加) 8 | "program": "${fileDirname}/${fileBasenameNoExtension}.exe",// 将要进行调试的程序的路径 9 | "args": [], // 程序调试时传递给程序的命令行参数,一般设为空即可 10 | "stopAtEntry": false, // 设为true时程序将暂停在程序入口处,一般设置为false 11 | "cwd": "${workspaceRoot}",// 调试程序时的工作目录,一般为${workspaceRoot}即代码所在目录 12 | "environment": [], 13 | "externalConsole": true,// 调试时是否显示控制台窗口,一般设置为true显示控制台 14 | "MIMode": "gdb", 15 | "miDebuggerPath": "C:\\Program Files (x86)\\Dev-Cpp\\MinGW64\\bin\\gdb.exe",// miDebugger的路径,注意这里要与MinGw的路径对应 16 | "preLaunchTask": "g++", // 调试会话开始前执行的任务,一般为编译程序,c++为g++, c为gcc 17 | "setupCommands": [ 18 | { 19 | "description": "Enable pretty-printing for gdb", 20 | "text": "-enable-pretty-printing", 21 | "ignoreFailures": true 22 | } 23 | ] 24 | } 25 | ] 26 | } 27 | 28 | -------------------------------------------------------------------------------- /tools/Compare/IOIStyle.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | #define UKE -1 4 | #define AC 1 5 | #define WA 0 6 | int cnt = 1; 7 | int compareFile(FILE* file_compared, FILE* file_checked) { 8 | bool diff = 0; 9 | int N = 65536; 10 | char b1[65536], b2[65536]; 11 | size_t s1, s2; 12 | while (1) { 13 | cnt++; 14 | if (fgets(b1, N, file_compared) == NULL || 15 | fgets(b2, N, file_checked) == NULL) { 16 | break; 17 | } 18 | s1 = strlen(b1); 19 | s2 = strlen(b2); 20 | if ((s1 != s2 && s1 + 2 != s2 && s1 - 2 != s2 && s1 + 1 != s2 && 21 | s1 - 1 != s2) || 22 | memcmp(b1, b2, min(s1, s2) - 1)) { 23 | cerr << "Wrong Answer On Row " << cnt - 1 << ", expected " << b1 24 | << ", found " << b2; 25 | diff = 1; 26 | break; 27 | } 28 | } 29 | if (diff) 30 | return 0; 31 | else 32 | return 1; 33 | } 34 | int main(int argc, char* argv[]) { 35 | if (argc <= 2) { 36 | return UKE; 37 | } 38 | FILE* fuser = fopen(argv[1], "r"); 39 | FILE* fstd = fopen(argv[2], "r"); 40 | freopen("IOI.log", "a", stderr); 41 | if (compareFile(fuser, fstd) == 1) { 42 | cerr << "Accept.\n"; 43 | return AC; 44 | } 45 | else { 46 | return WA; 47 | } 48 | return 0; 49 | } 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

CarYon

2 |

一款基于C++的OI/ACM 比赛出题解题辅助工具

3 | 4 | ![img](https://img.shields.io/badge/Avatar-luosw-red.svg) ![img](https://img.shields.io/github/package-json/v/luosiwei-cmd/caryon) ![img](https://img.shields.io/npm/dm/datamaker-caryon) ![img](https://img.shields.io/npm/dt/datamaker-caryon) ![img](https://img.shields.io/npm/l/datamaker-caryon) ![img](https://img.shields.io/github/commit-activity/m/luosiwei-cmd/CarYon) 5 | 6 |

中文版文档:Wiki

7 | 8 |

下面仅为文档摘要,详细中文文档请查看 Wiki

9 | 10 | ## CarYon 介绍 11 | 12 | CarYon 是一款基于C++的OI/ACM 比赛出题解题辅助工具。 13 | 14 | CarYon 可以被用来生成测试用例,并且迅速地通过标准程序生成输出文件;也可以被用来在赛场上进行迅速生成样例对拍程序。 15 | 16 | CarYon 也可以作为一个现场生成样例的线下简易评测系统。内置三种比较器。支持 `AC,WA,TLE,UKE,RE` 等多种情况的判断。 17 | 18 | 您要是认为 CarYon 中的重中之重(详见 Wiki:`test.cpp`)的编写过于复杂,在生成样例要求简单的情况下,可以使用 CarYon 的配置文件生成功能。 19 | 20 | ## 快速开始 21 | 22 | ### 1. 安装 CarYon 23 | 24 | 访问 Wiki 了解如何下载 CarYon 后直接执行: 25 | 26 | ```cpp 27 | #include"caryon.h" 28 | ``` 29 | 30 | 就可以啦。 31 | 32 | ### 2. 升级 CarYon 33 | 34 | 直接用新的版本替换掉老版本,自行克服兼容问题。 35 | 36 | 请优先克隆 master 分支,其他分支无法保持稳定。 37 | 38 | ## 功能特性 39 | 40 | CarYon 可以被分为下面几个板块: 41 | 42 | - [x] 测试用例生成 43 | - [x] 评测程序(对拍) 44 | - [x] 数学库 45 | - [x] 解析几何库 46 | - [x] 配置文件生成 47 | - [ ] (不可能完成了)线下本地评测系统 48 | 49 | ## 协议 50 | 51 | ISC 开源协议。 52 | -------------------------------------------------------------------------------- /tools/Introduction-Chinese/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | index 6 | 7 | 8 | 9 | 10 | 11 |

CarYon:一款基于C++的OI/ACM 比赛测试数据生成器

img img img img img

在举办自己的OI比赛的时候,你有没有遇到过以下问题:

  • 想快速生成一段文字?
  • 想快速进行数学运算来生成数据?
  • 想不用freopen等时间一个一个的生成测试数据?
  • 希望生成一组随机数据或者数列?
  • 快速生成数据来和两个程序对拍?

那么,你可以借助CarYon和C++,来快速生成数据。目前支持的特性有:

  • 随机生成一段文章,一些单词,一些字母
  • 脱离RAND_MAX的限制,自由拟定随机数
  • 正在开发的数学库,支持多种特性
  • 建一些圆形,正多边形和分数,用它来进行运算

使用 CarYon

CarYon 采用 C++ 编写,在安装好 C++ 的计算机上,只需要 include caryon.h 就可以使用内含的多种功能啦。

如果您对 C++ 不熟悉,请查看 C++ 快速入门 Wiki

12 | 13 | -------------------------------------------------------------------------------- /tools/configurstion-file-analysis/examples/Luogu P1002/analysis.log: -------------------------------------------------------------------------------- 1 | [LOG] Makein function was written successfully. 2 | [CHECKER] Checking if m is a variable name. 3 | [CHECKER] m is a variable name. Accept. 4 | [CHECKER] Checking if variable m has already used. 5 | [CHECKER] Variable m has not been used yet. 6 | [CHECKER] Checking how many space(s) will be used. 7 | [CHECKER] For row 2, there will be 8 space(s) here. 8 | [LOG] Add int variable m successfully. 9 | [CHECKER] Checking if n is a variable name. 10 | [CHECKER] n is a variable name. Accept. 11 | [CHECKER] Checking if variable n has already used. 12 | [CHECKER] Variable n has not been used yet. 13 | [CHECKER] Checking how many space(s) will be used. 14 | [CHECKER] For row 3, there will be 8 space(s) here. 15 | [LOG] Add int variable n successfully. 16 | [CHECKER] Checking if variable m has already used. 17 | [CHECKER] Variable m has already used. 18 | [CHECKER] Checking how many space(s) will be used. 19 | [CHECKER] For row 4, there will be 8 space(s) here. 20 | [LOG] Assign variable m with a random number successfully. 21 | [CHECKER] Checking if variable n has already used. 22 | [CHECKER] Variable n has already used. 23 | [CHECKER] Checking how many space(s) will be used. 24 | [CHECKER] For row 5, there will be 8 space(s) here. 25 | [LOG] Assign variable n with a random number successfully. 26 | [CHECKER] Checking if variable n has already used. 27 | [CHECKER] Variable n has already used. 28 | [CHECKER] Checking how many space(s) will be used. 29 | [CHECKER] For row 6, there will be 8 space(s) here. 30 | [LOG] Make a variable number successfully. 31 | [CHECKER] Checking how many space(s) will be used. 32 | [CHECKER] For row 7, there will be 8 space(s) here. 33 | [LOG] Make a string or a space successfully. 34 | [CHECKER] Checking if variable m has already used. 35 | [CHECKER] Variable m has already used. 36 | [CHECKER] Checking how many space(s) will be used. 37 | [CHECKER] For row 8, there will be 8 space(s) here. 38 | [LOG] Make a variable number successfully. 39 | [CHECKER] Checking how many space(s) will be used. 40 | [CHECKER] For row 9, there will be 8 space(s) here. 41 | [LOG] Make a string or a space successfully. 42 | [CHECKER] Checking how many space(s) will be used. 43 | [CHECKER] For row 10, there will be 8 space(s) here. 44 | [LOG] Make a random number successfully. 45 | [CHECKER] Checking how many space(s) will be used. 46 | [CHECKER] For row 11, there will be 8 space(s) here. 47 | [LOG] Make a string or a space successfully. 48 | [CHECKER] Checking how many space(s) will be used. 49 | [CHECKER] For row 12, there will be 8 space(s) here. 50 | [LOG] Make a random number successfully. 51 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "C_Cpp.errorSquiggles": "Enabled", 3 | "files.associations": { 4 | "algorithm": "cpp", 5 | "array": "cpp", 6 | "atomic": "cpp", 7 | "bitset": "cpp", 8 | "cctype": "cpp", 9 | "cfenv": "cpp", 10 | "chrono": "cpp", 11 | "cinttypes": "cpp", 12 | "clocale": "cpp", 13 | "cmath": "cpp", 14 | "complex": "cpp", 15 | "condition_variable": "cpp", 16 | "csetjmp": "cpp", 17 | "csignal": "cpp", 18 | "cstdarg": "cpp", 19 | "cstddef": "cpp", 20 | "cstdint": "cpp", 21 | "cstdio": "cpp", 22 | "cstdlib": "cpp", 23 | "cstring": "cpp", 24 | "ctime": "cpp", 25 | "cwchar": "cpp", 26 | "cwctype": "cpp", 27 | "deque": "cpp", 28 | "exception": "cpp", 29 | "resumable": "cpp", 30 | "forward_list": "cpp", 31 | "fstream": "cpp", 32 | "functional": "cpp", 33 | "future": "cpp", 34 | "initializer_list": "cpp", 35 | "iomanip": "cpp", 36 | "ios": "cpp", 37 | "iosfwd": "cpp", 38 | "iostream": "cpp", 39 | "istream": "cpp", 40 | "iterator": "cpp", 41 | "limits": "cpp", 42 | "list": "cpp", 43 | "locale": "cpp", 44 | "map": "cpp", 45 | "memory": "cpp", 46 | "mutex": "cpp", 47 | "new": "cpp", 48 | "numeric": "cpp", 49 | "ostream": "cpp", 50 | "queue": "cpp", 51 | "random": "cpp", 52 | "ratio": "cpp", 53 | "regex": "cpp", 54 | "scoped_allocator": "cpp", 55 | "set": "cpp", 56 | "sstream": "cpp", 57 | "stack": "cpp", 58 | "stdexcept": "cpp", 59 | "streambuf": "cpp", 60 | "string": "cpp", 61 | "system_error": "cpp", 62 | "xthread": "cpp", 63 | "thread": "cpp", 64 | "tuple": "cpp", 65 | "type_traits": "cpp", 66 | "typeindex": "cpp", 67 | "typeinfo": "cpp", 68 | "unordered_map": "cpp", 69 | "unordered_set": "cpp", 70 | "utility": "cpp", 71 | "valarray": "cpp", 72 | "vector": "cpp", 73 | "xfacet": "cpp", 74 | "xhash": "cpp", 75 | "xiosbase": "cpp", 76 | "xlocale": "cpp", 77 | "xlocbuf": "cpp", 78 | "xlocinfo": "cpp", 79 | "xlocmes": "cpp", 80 | "xlocmon": "cpp", 81 | "xlocnum": "cpp", 82 | "xloctime": "cpp", 83 | "xmemory": "cpp", 84 | "xmemory0": "cpp", 85 | "xstddef": "cpp", 86 | "xstring": "cpp", 87 | "xtr1common": "cpp", 88 | "xtree": "cpp", 89 | "xutility": "cpp", 90 | "cassert": "cpp", 91 | "climits": "cpp", 92 | "cfloat": "cpp" 93 | } 94 | } -------------------------------------------------------------------------------- /tools/configurstion-file-analysis/examples/Luogu P1093/analysis.log: -------------------------------------------------------------------------------- 1 | [LOG] Makein function was written successfully. 2 | [CHECKER] Checking if n is a variable name. 3 | [CHECKER] n is a variable name. Accept. 4 | [CHECKER] Checking if variable n has already used. 5 | [CHECKER] Variable n has not been used yet. 6 | [CHECKER] Checking how many space(s) will be used. 7 | [CHECKER] For row 2, there will be 8 space(s) here. 8 | [LOG] Add int variable n successfully. 9 | [CHECKER] Checking if variable n has already used. 10 | [CHECKER] Variable n has already used. 11 | [CHECKER] Checking how many space(s) will be used. 12 | [CHECKER] For row 3, there will be 8 space(s) here. 13 | [LOG] Assign variable n to 300 successfully. 14 | [CHECKER] Checking if variable n has already used. 15 | [CHECKER] Variable n has already used. 16 | [CHECKER] Checking how many space(s) will be used. 17 | [CHECKER] For row 4, there will be 8 space(s) here. 18 | [LOG] Make a variable number successfully. 19 | [CHECKER] Checking if i is a variable name. 20 | [CHECKER] i is a variable name. Accept. 21 | [CHECKER] Checking if variable i has already used. 22 | [CHECKER] Variable i has not been used yet. 23 | [CHECKER] Checking how many space(s) will be used. 24 | [CHECKER] For row 5, there will be 8 space(s) here. 25 | [LOG] Add int variable i successfully. 26 | [CHECKER] Checking if j is a variable name. 27 | [CHECKER] j is a variable name. Accept. 28 | [CHECKER] Checking if variable j has already used. 29 | [CHECKER] Variable j has not been used yet. 30 | [CHECKER] Checking how many space(s) will be used. 31 | [CHECKER] For row 6, there will be 8 space(s) here. 32 | [LOG] Add int variable j successfully. 33 | [CHECKER] Checking if variable i has already used. 34 | [CHECKER] Variable i has already used. 35 | [CHECKER] Checking if variable n has already used. 36 | [CHECKER] Variable n has already used. 37 | [CHECKER] Checking how many space(s) will be used. 38 | [CHECKER] For row 7, there will be 8 space(s) here. 39 | [LOG] Add a for with a variable end successfully. 40 | [CHECKER] Checking if variable j has already used. 41 | [CHECKER] Variable j has already used. 42 | [CHECKER] Checking how many space(s) will be used. 43 | [CHECKER] For row 8, there will be 12 space(s) here. 44 | [LOG] Add a for successfully. 45 | [CHECKER] Checking how many space(s) will be used. 46 | [CHECKER] For row 9, there will be 16 space(s) here. 47 | [LOG] Make a random number successfully. 48 | [CHECKER] Checking how many space(s) will be used. 49 | [CHECKER] For row 10, there will be 16 space(s) here. 50 | [LOG] Make a string or a space successfully. 51 | [CHECKER] Checking if sf/continue/break is in a fs. 52 | [CHECKER] Sf/continue/break is in a fs. 53 | [CHECKER] Checking how many space(s) will be used. 54 | [CHECKER] For row 11, there will be 12 space(s) here. 55 | [LOG] End a for successfully. 56 | [CHECKER] Checking how many space(s) will be used. 57 | [CHECKER] For row 12, there will be 12 space(s) here. 58 | [LOG] Make a string or a space successfully. 59 | [CHECKER] Checking if sf/continue/break is in a fs. 60 | [CHECKER] Sf/continue/break is in a fs. 61 | [CHECKER] Checking how many space(s) will be used. 62 | [CHECKER] For row 13, there will be 8 space(s) here. 63 | [LOG] End a for successfully. 64 | -------------------------------------------------------------------------------- /tools/configurstion-file-analysis/examples/Luogu P1018/analysis.log: -------------------------------------------------------------------------------- 1 | [LOG] Makein function was written successfully. 2 | [CHECKER] Checking if n is a variable name. 3 | [CHECKER] n is a variable name. Accept. 4 | [CHECKER] Checking if variable n has already used. 5 | [CHECKER] Variable n has not been used yet. 6 | [CHECKER] Checking how many space(s) will be used. 7 | [CHECKER] For row 2, there will be 8 space(s) here. 8 | [LOG] Add int variable n successfully. 9 | [CHECKER] Checking if k is a variable name. 10 | [CHECKER] k is a variable name. Accept. 11 | [CHECKER] Checking if variable k has already used. 12 | [CHECKER] Variable k has not been used yet. 13 | [CHECKER] Checking how many space(s) will be used. 14 | [CHECKER] For row 3, there will be 8 space(s) here. 15 | [LOG] Add int variable k successfully. 16 | [CHECKER] Checking if i is a variable name. 17 | [CHECKER] i is a variable name. Accept. 18 | [CHECKER] Checking if variable i has already used. 19 | [CHECKER] Variable i has not been used yet. 20 | [CHECKER] Checking how many space(s) will be used. 21 | [CHECKER] For row 4, there will be 8 space(s) here. 22 | [LOG] Add int variable i successfully. 23 | [CHECKER] Checking if variable n has already used. 24 | [CHECKER] Variable n has already used. 25 | [CHECKER] Checking how many space(s) will be used. 26 | [CHECKER] For row 5, there will be 8 space(s) here. 27 | [LOG] Assign variable n with a random number successfully. 28 | [CHECKER] Checking if variable k has already used. 29 | [CHECKER] Variable k has already used. 30 | [CHECKER] Checking how many space(s) will be used. 31 | [CHECKER] For row 6, there will be 8 space(s) here. 32 | [LOG] Assign variable k with a random number successfully. 33 | [CHECKER] Checking if variable n has already used. 34 | [CHECKER] Variable n has already used. 35 | [CHECKER] Checking how many space(s) will be used. 36 | [CHECKER] For row 7, there will be 8 space(s) here. 37 | [LOG] Make a variable number successfully. 38 | [CHECKER] Checking how many space(s) will be used. 39 | [CHECKER] For row 8, there will be 8 space(s) here. 40 | [LOG] Make a string or a space successfully. 41 | [CHECKER] Checking if variable k has already used. 42 | [CHECKER] Variable k has already used. 43 | [CHECKER] Checking how many space(s) will be used. 44 | [CHECKER] For row 9, there will be 8 space(s) here. 45 | [LOG] Make a variable number successfully. 46 | [CHECKER] Checking how many space(s) will be used. 47 | [CHECKER] For row 10, there will be 8 space(s) here. 48 | [LOG] Make a string or a space successfully. 49 | [CHECKER] Checking if variable i has already used. 50 | [CHECKER] Variable i has already used. 51 | [CHECKER] Checking if variable n has already used. 52 | [CHECKER] Variable n has already used. 53 | [CHECKER] Checking how many space(s) will be used. 54 | [CHECKER] For row 11, there will be 8 space(s) here. 55 | [LOG] Add a for with a variable end successfully. 56 | [CHECKER] Checking how many space(s) will be used. 57 | [CHECKER] For row 12, there will be 12 space(s) here. 58 | [LOG] Make a random number successfully. 59 | [CHECKER] Checking if sf/continue/break is in a fs. 60 | [CHECKER] Sf/continue/break is in a fs. 61 | [CHECKER] Checking how many space(s) will be used. 62 | [CHECKER] For row 13, there will be 8 space(s) here. 63 | [LOG] End a for successfully. 64 | [CHECKER] Checking how many space(s) will be used. 65 | [CHECKER] For row 14, there will be 8 space(s) here. 66 | [LOG] Make a string or a space successfully. 67 | -------------------------------------------------------------------------------- /examples/Luogu P3366/std.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | namespace luosw { 6 | namespace IO { 7 | template < typename T > 8 | inline T read() { 9 | T ret = 0, f = 1; 10 | char ch = getchar(); 11 | while (ch < '0' || ch > '9') { 12 | if (ch == '-') 13 | f = -f; 14 | ch = getchar(); 15 | } 16 | while (ch >= '0' && ch <= '9') 17 | ret = ret * 10 + ch - '0', ch = getchar(); 18 | return ret * f; 19 | } 20 | template < typename T > 21 | void write(T x) { 22 | if (x < 0) { 23 | putchar('-'); 24 | x = -x; 25 | } 26 | T y = 10, len = 1; 27 | while (y <= x) { 28 | y *= 10; 29 | len++; 30 | } 31 | while (len--) { 32 | y /= 10; 33 | putchar(x / y + 48); 34 | x %= y; 35 | } 36 | } 37 | template < typename T > 38 | void write(T x, bool flag) { 39 | if (x < 0) { 40 | putchar('-'); 41 | x = -x; 42 | } 43 | T y = 10, len = 1; 44 | while (y <= x) { 45 | y *= 10; 46 | len++; 47 | } 48 | while (len--) { 49 | y /= 10; 50 | putchar(x / y + 48); 51 | x %= y; 52 | } 53 | if (flag) 54 | putchar('\n'); 55 | } 56 | } // namespace IO 57 | namespace tools { 58 | template < typename T > 59 | T cmax(T a, T b) { 60 | return max(a, b); 61 | } 62 | template < typename T > 63 | T cmin(T a, T b) { 64 | return min(a, b); 65 | } 66 | template < typename T > 67 | T cgcd(T a, T b) { 68 | return __gcd(a, b); 69 | } 70 | template < typename T > 71 | T clcm(T a, T b) { 72 | return a * b / cgcd(a, b); 73 | } 74 | } // namespace tools 75 | } // namespace luosw 76 | #define read(t) t = luosw::IO::read< int >() 77 | #define write(t) luosw::IO::write< int >(t, true) 78 | template < typename T > 79 | class mcs { 80 | private: 81 | T n; 82 | T fa[10000]; 83 | int size[10000]; 84 | 85 | public: 86 | void init(T s) { 87 | for (T i = 0; i < s; i++) { 88 | fa[i] = i; 89 | size[i] = 1; 90 | } 91 | } 92 | mcs() { 93 | } 94 | mcs(T size) { 95 | init(size); 96 | } 97 | T getRoot(T node) { 98 | if (fa[node] != node) 99 | fa[node] = getRoot(fa[node]); 100 | return fa[node]; 101 | } 102 | bool check(T n1, T n2) { 103 | return getRoot(n1) == getRoot(n2); 104 | } 105 | void merge(T n1, T n2) { 106 | int r1 = getRoot(n1); 107 | int r2 = getRoot(n2); 108 | if (r1 == r2) 109 | return; 110 | if (size[r1] > size[r2]) 111 | swap(r1, r2); 112 | fa[r1] = r2; 113 | size[r2] += size[r1]; 114 | } 115 | }; 116 | 117 | mcs< int > a; 118 | 119 | class Edge { 120 | public: 121 | int v, next, w; 122 | friend bool operator<(const Edge e1, const Edge e2) { 123 | return e1.w < e2.w; 124 | } 125 | }; 126 | 127 | vector< Edge > g; 128 | 129 | int n, m, ans, cnt; 130 | bool flag; 131 | signed main() { 132 | read(n), read(m); 133 | a.init(n); 134 | for (int i = 0; i < m; i++) { 135 | Edge temp; 136 | read(temp.v), read(temp.next), read(temp.w); 137 | g.push_back(temp); 138 | } 139 | sort(g.begin(), g.end()); 140 | for (int i = 0; i < m; i++) { 141 | Edge temp = g[i]; 142 | if (!a.check(temp.v, temp.next)) { 143 | a.merge(temp.v, temp.next); 144 | ans += temp.w; 145 | if (++cnt == n - 1) { 146 | flag = true; 147 | break; 148 | } 149 | } 150 | } 151 | if (!flag) { 152 | puts("orz"); 153 | return 0; 154 | } 155 | write(ans); 156 | #ifdef debug 157 | system("pause"); 158 | #endif 159 | return 0; 160 | } 161 | -------------------------------------------------------------------------------- /tools/configurstion-file-analysis/examples/Luogu P1003/analysis.log: -------------------------------------------------------------------------------- 1 | [LOG] Makein function was written successfully. 2 | [CHECKER] Checking if n is a variable name. 3 | [CHECKER] n is a variable name. Accept. 4 | [CHECKER] Checking if variable n has already used. 5 | [CHECKER] Variable n has not been used yet. 6 | [CHECKER] Checking how many space(s) will be used. 7 | [CHECKER] For row 2, there will be 8 space(s) here. 8 | [LOG] Add int variable n successfully. 9 | [CHECKER] Checking if variable n has already used. 10 | [CHECKER] Variable n has already used. 11 | [CHECKER] Checking how many space(s) will be used. 12 | [CHECKER] For row 3, there will be 8 space(s) here. 13 | [LOG] Assign variable n to 1000 successfully. 14 | [CHECKER] Checking if i is a variable name. 15 | [CHECKER] i is a variable name. Accept. 16 | [CHECKER] Checking if variable i has already used. 17 | [CHECKER] Variable i has not been used yet. 18 | [CHECKER] Checking how many space(s) will be used. 19 | [CHECKER] For row 4, there will be 8 space(s) here. 20 | [LOG] Add int variable i successfully. 21 | [CHECKER] Checking if j is a variable name. 22 | [CHECKER] j is a variable name. Accept. 23 | [CHECKER] Checking if variable j has already used. 24 | [CHECKER] Variable j has not been used yet. 25 | [CHECKER] Checking how many space(s) will be used. 26 | [CHECKER] For row 5, there will be 8 space(s) here. 27 | [LOG] Add int variable j successfully. 28 | [CHECKER] Checking if variable n has already used. 29 | [CHECKER] Variable n has already used. 30 | [CHECKER] Checking how many space(s) will be used. 31 | [CHECKER] For row 6, there will be 8 space(s) here. 32 | [LOG] Make a variable number successfully. 33 | [CHECKER] Checking how many space(s) will be used. 34 | [CHECKER] For row 7, there will be 8 space(s) here. 35 | [LOG] Make a string or a space successfully. 36 | [CHECKER] Checking if variable i has already used. 37 | [CHECKER] Variable i has already used. 38 | [CHECKER] Checking if variable n has already used. 39 | [CHECKER] Variable n has already used. 40 | [CHECKER] Checking how many space(s) will be used. 41 | [CHECKER] For row 8, there will be 8 space(s) here. 42 | [LOG] Add a for with a variable end successfully. 43 | [CHECKER] Checking if variable j has already used. 44 | [CHECKER] Variable j has already used. 45 | [CHECKER] Checking how many space(s) will be used. 46 | [CHECKER] For row 9, there will be 12 space(s) here. 47 | [LOG] Add a for successfully. 48 | [CHECKER] Checking how many space(s) will be used. 49 | [CHECKER] For row 10, there will be 16 space(s) here. 50 | [LOG] Make a random number successfully. 51 | [CHECKER] Checking how many space(s) will be used. 52 | [CHECKER] For row 11, there will be 16 space(s) here. 53 | [LOG] Make a string or a space successfully. 54 | [CHECKER] Checking if sf/continue/break is in a fs. 55 | [CHECKER] Sf/continue/break is in a fs. 56 | [CHECKER] Checking how many space(s) will be used. 57 | [CHECKER] For row 12, there will be 12 space(s) here. 58 | [LOG] End a for successfully. 59 | [CHECKER] Checking how many space(s) will be used. 60 | [CHECKER] For row 13, there will be 12 space(s) here. 61 | [LOG] Make a string or a space successfully. 62 | [CHECKER] Checking if sf/continue/break is in a fs. 63 | [CHECKER] Sf/continue/break is in a fs. 64 | [CHECKER] Checking how many space(s) will be used. 65 | [CHECKER] For row 14, there will be 8 space(s) here. 66 | [LOG] End a for successfully. 67 | [CHECKER] Checking if variable i has already used. 68 | [CHECKER] Variable i has already used. 69 | [CHECKER] Checking how many space(s) will be used. 70 | [CHECKER] For row 15, there will be 8 space(s) here. 71 | [LOG] Add a for successfully. 72 | [CHECKER] Checking how many space(s) will be used. 73 | [CHECKER] For row 16, there will be 12 space(s) here. 74 | [LOG] Make a random number successfully. 75 | [CHECKER] Checking how many space(s) will be used. 76 | [CHECKER] For row 17, there will be 12 space(s) here. 77 | [LOG] Make a string or a space successfully. 78 | [CHECKER] Checking if sf/continue/break is in a fs. 79 | [CHECKER] Sf/continue/break is in a fs. 80 | [CHECKER] Checking how many space(s) will be used. 81 | [CHECKER] For row 18, there will be 8 space(s) here. 82 | [LOG] End a for successfully. 83 | -------------------------------------------------------------------------------- /examples/Luogu P1093/data-Luogu_P1093/Luogu_P10931.in: -------------------------------------------------------------------------------- 1 | 300 2 | 60 55 7 3 | 35 74 24 4 | 87 13 3 5 | 100 15 19 6 | 31 73 6 7 | 78 75 99 8 | 62 35 80 9 | 18 95 98 10 | 11 98 14 11 | 55 94 28 12 | 21 11 5 13 | 38 36 20 14 | 69 92 88 15 | 1 86 7 16 | 62 0 78 17 | 3 30 12 18 | 17 14 99 19 | 94 54 95 20 | 36 30 99 21 | 75 12 23 22 | 0 65 72 23 | 46 5 12 24 | 3 30 7 25 | 40 6 51 26 | 72 11 90 27 | 100 94 96 28 | 99 24 40 29 | 52 4 84 30 | 10 92 16 31 | 96 25 63 32 | 88 97 77 33 | 80 26 61 34 | 17 67 62 35 | 9 74 12 36 | 95 97 97 37 | 25 10 90 38 | 81 5 75 39 | 54 21 90 40 | 83 61 27 41 | 35 39 21 42 | 94 51 4 43 | 7 3 96 44 | 43 14 67 45 | 97 89 17 46 | 52 52 85 47 | 81 31 16 48 | 32 23 99 49 | 64 75 56 50 | 31 81 25 51 | 74 50 94 52 | 60 50 27 53 | 24 3 84 54 | 41 56 98 55 | 61 6 14 56 | 63 3 7 57 | 49 18 41 58 | 81 32 33 59 | 67 15 64 60 | 37 25 82 61 | 44 84 48 62 | 59 70 81 63 | 67 85 66 64 | 18 62 0 65 | 6 30 67 66 | 50 75 6 67 | 86 40 0 68 | 10 9 1 69 | 22 78 72 70 | 45 56 13 71 | 100 4 63 72 | 88 8 99 73 | 78 15 25 74 | 41 36 13 75 | 62 28 53 76 | 68 8 86 77 | 92 8 8 78 | 1 46 46 79 | 61 62 21 80 | 13 98 36 81 | 86 98 68 82 | 93 89 27 83 | 32 93 85 84 | 78 31 86 85 | 15 67 48 86 | 2 42 24 87 | 28 68 16 88 | 95 82 97 89 | 68 53 90 90 | 60 32 61 91 | 12 69 15 92 | 86 60 94 93 | 60 52 1 94 | 35 100 80 95 | 25 93 17 96 | 94 79 29 97 | 86 77 37 98 | 4 2 46 99 | 68 38 56 100 | 79 33 26 101 | 17 87 27 102 | 60 33 32 103 | 85 30 79 104 | 71 32 6 105 | 85 13 80 106 | 13 33 51 107 | 62 14 35 108 | 22 32 87 109 | 84 16 50 110 | 19 20 86 111 | 71 56 25 112 | 72 70 88 113 | 36 98 85 114 | 2 57 5 115 | 60 35 84 116 | 71 73 51 117 | 36 7 14 118 | 6 74 69 119 | 52 86 37 120 | 96 72 89 121 | 90 59 79 122 | 51 86 25 123 | 86 13 79 124 | 24 31 54 125 | 4 2 46 126 | 93 91 71 127 | 43 24 99 128 | 42 66 26 129 | 66 81 29 130 | 93 24 82 131 | 43 9 85 132 | 48 6 22 133 | 88 6 100 134 | 12 51 9 135 | 7 93 32 136 | 86 24 15 137 | 89 88 0 138 | 24 43 20 139 | 1 57 92 140 | 10 99 14 141 | 4 97 97 142 | 32 33 62 143 | 51 76 36 144 | 65 3 1 145 | 74 20 22 146 | 4 72 42 147 | 71 8 10 148 | 65 75 26 149 | 16 48 41 150 | 40 6 23 151 | 53 74 37 152 | 71 62 3 153 | 5 84 35 154 | 28 76 57 155 | 68 75 23 156 | 1 63 21 157 | 89 4 41 158 | 90 19 97 159 | 97 53 46 160 | 0 15 58 161 | 21 99 87 162 | 69 30 44 163 | 43 88 38 164 | 1 18 59 165 | 75 12 69 166 | 32 91 53 167 | 53 2 4 168 | 28 65 52 169 | 75 12 59 170 | 19 77 6 171 | 92 38 81 172 | 46 70 72 173 | 56 47 0 174 | 62 31 81 175 | 95 87 64 176 | 70 70 7 177 | 80 84 5 178 | 45 4 86 179 | 9 99 78 180 | 64 27 21 181 | 26 83 2 182 | 78 80 31 183 | 40 56 41 184 | 85 98 91 185 | 17 55 50 186 | 44 83 26 187 | 58 80 9 188 | 4 36 59 189 | 100 47 90 190 | 4 46 60 191 | 98 48 53 192 | 45 43 84 193 | 25 54 50 194 | 29 62 42 195 | 19 100 73 196 | 78 69 6 197 | 43 85 76 198 | 82 38 66 199 | 13 94 16 200 | 27 84 63 201 | 45 7 19 202 | 8 61 71 203 | 62 8 0 204 | 57 85 37 205 | 95 75 96 206 | 56 81 87 207 | 94 0 92 208 | 81 53 32 209 | 30 81 79 210 | 25 71 62 211 | 46 21 68 212 | 82 8 76 213 | 11 56 97 214 | 29 46 17 215 | 19 15 20 216 | 69 42 100 217 | 58 66 2 218 | 19 36 35 219 | 27 7 100 220 | 98 37 83 221 | 40 77 91 222 | 37 39 97 223 | 96 44 67 224 | 49 59 0 225 | 84 61 44 226 | 13 18 64 227 | 60 93 10 228 | 32 92 17 229 | 28 43 4 230 | 100 86 1 231 | 75 26 29 232 | 97 76 62 233 | 51 95 65 234 | 67 0 7 235 | 58 36 30 236 | 42 11 36 237 | 2 55 70 238 | 86 43 73 239 | 89 94 77 240 | 24 5 90 241 | 55 55 62 242 | 3 52 27 243 | 4 63 57 244 | 96 40 13 245 | 35 44 21 246 | 79 69 72 247 | 46 80 82 248 | 49 23 84 249 | 70 64 28 250 | 92 48 85 251 | 35 80 45 252 | 16 52 11 253 | 7 85 48 254 | 43 79 45 255 | 75 80 33 256 | 74 43 30 257 | 55 59 92 258 | 23 1 88 259 | 68 11 61 260 | 43 1 24 261 | 28 90 72 262 | 27 75 22 263 | 4 26 86 264 | 97 71 71 265 | 52 29 89 266 | 3 16 82 267 | 84 9 19 268 | 79 19 6 269 | 70 98 77 270 | 4 51 63 271 | 33 19 92 272 | 53 71 97 273 | 35 19 21 274 | 59 32 73 275 | 54 30 65 276 | 58 57 21 277 | 97 7 56 278 | 1 73 11 279 | 78 26 71 280 | 36 95 24 281 | 13 49 46 282 | 47 2 46 283 | 13 98 23 284 | 22 94 30 285 | 87 53 0 286 | 26 98 90 287 | 91 56 80 288 | 83 90 15 289 | 44 36 29 290 | 30 58 52 291 | 28 20 41 292 | 33 44 45 293 | 38 12 66 294 | 9 40 17 295 | 95 10 53 296 | 36 99 7 297 | 24 43 27 298 | 33 56 80 299 | 13 52 68 300 | 60 66 77 301 | 1 87 37 302 | -------------------------------------------------------------------------------- /examples/Luogu P1093/data-Luogu_P1093/Luogu_P10936.in: -------------------------------------------------------------------------------- 1 | 300 2 | 84 76 23 3 | 96 33 1 4 | 98 48 74 5 | 94 4 39 6 | 25 56 40 7 | 2 42 84 8 | 32 2 48 9 | 46 25 45 10 | 25 52 17 11 | 95 34 0 12 | 21 48 69 13 | 25 43 45 14 | 71 61 96 15 | 53 50 15 16 | 84 3 8 17 | 92 37 6 18 | 21 11 19 19 | 84 76 46 20 | 50 54 99 21 | 23 95 49 22 | 55 30 65 23 | 66 58 1 24 | 84 38 93 25 | 2 96 9 26 | 25 0 16 27 | 21 64 62 28 | 16 6 40 29 | 67 63 80 30 | 100 93 21 31 | 51 93 54 32 | 52 33 57 33 | 41 0 6 34 | 24 23 8 35 | 35 80 8 36 | 36 5 99 37 | 37 89 28 38 | 3 12 35 39 | 77 64 68 40 | 96 44 94 41 | 42 14 75 42 | 35 95 35 43 | 78 10 88 44 | 21 57 94 45 | 70 68 11 46 | 49 45 31 47 | 93 96 48 48 | 56 68 21 49 | 22 1 54 50 | 61 74 12 51 | 73 47 19 52 | 38 42 48 53 | 57 87 7 54 | 51 26 99 55 | 91 100 90 56 | 78 22 73 57 | 6 55 98 58 | 56 56 38 59 | 36 77 13 60 | 10 39 100 61 | 26 33 67 62 | 68 92 54 63 | 62 36 55 64 | 84 71 8 65 | 60 88 51 66 | 42 59 76 67 | 26 50 13 68 | 62 33 43 69 | 69 83 56 70 | 44 22 63 71 | 9 53 70 72 | 88 60 45 73 | 5 41 80 74 | 11 71 41 75 | 12 30 29 76 | 86 90 17 77 | 10 16 14 78 | 60 100 74 79 | 82 13 74 80 | 71 8 0 81 | 24 11 61 82 | 92 29 0 83 | 73 49 7 84 | 5 7 78 85 | 16 48 95 86 | 10 91 79 87 | 53 53 24 88 | 74 64 72 89 | 80 13 91 90 | 26 62 46 91 | 82 99 0 92 | 98 63 40 93 | 5 49 7 94 | 24 65 3 95 | 96 32 0 96 | 97 41 54 97 | 91 22 87 98 | 47 42 37 99 | 36 92 11 100 | 88 1 57 101 | 39 43 82 102 | 83 10 9 103 | 86 39 69 104 | 9 67 95 105 | 34 18 58 106 | 72 68 15 107 | 58 30 99 108 | 5 64 39 109 | 24 33 43 110 | 35 77 80 111 | 15 45 37 112 | 36 98 43 113 | 14 86 59 114 | 58 19 100 115 | 65 40 59 116 | 28 6 3 117 | 33 83 34 118 | 95 28 29 119 | 68 48 89 120 | 67 2 44 121 | 13 9 57 122 | 82 54 95 123 | 55 19 63 124 | 56 93 81 125 | 53 83 71 126 | 87 26 53 127 | 46 35 62 128 | 95 38 92 129 | 33 8 31 130 | 20 92 65 131 | 66 95 56 132 | 90 16 64 133 | 35 35 53 134 | 6 18 62 135 | 43 1 31 136 | 60 80 34 137 | 66 67 89 138 | 45 58 18 139 | 77 0 27 140 | 65 2 65 141 | 32 31 57 142 | 27 30 68 143 | 60 60 6 144 | 47 88 40 145 | 14 83 21 146 | 10 15 26 147 | 29 90 5 148 | 74 14 2 149 | 85 18 51 150 | 49 65 99 151 | 40 51 35 152 | 51 12 50 153 | 40 46 14 154 | 43 56 11 155 | 28 33 48 156 | 71 55 5 157 | 97 83 77 158 | 25 17 75 159 | 69 40 22 160 | 63 71 0 161 | 83 88 52 162 | 57 73 91 163 | 100 33 97 164 | 6 45 55 165 | 48 78 68 166 | 31 11 10 167 | 85 70 63 168 | 30 36 75 169 | 11 14 67 170 | 66 76 2 171 | 0 99 53 172 | 70 63 25 173 | 0 43 92 174 | 83 75 20 175 | 33 20 6 176 | 58 91 41 177 | 2 70 29 178 | 76 31 85 179 | 7 75 1 180 | 35 13 93 181 | 95 55 68 182 | 10 37 76 183 | 60 77 37 184 | 8 23 1 185 | 8 97 81 186 | 97 99 33 187 | 18 92 28 188 | 0 79 45 189 | 46 51 100 190 | 29 30 51 191 | 3 75 1 192 | 86 77 31 193 | 61 6 45 194 | 77 74 98 195 | 53 91 21 196 | 19 5 84 197 | 76 25 18 198 | 41 47 39 199 | 30 30 15 200 | 74 27 83 201 | 58 82 13 202 | 50 87 54 203 | 77 52 88 204 | 49 16 99 205 | 65 84 48 206 | 31 5 93 207 | 85 16 6 208 | 69 50 30 209 | 84 97 26 210 | 92 22 19 211 | 44 16 35 212 | 56 81 38 213 | 55 66 74 214 | 37 38 14 215 | 91 5 15 216 | 42 60 79 217 | 80 53 100 218 | 2 36 90 219 | 56 94 74 220 | 16 4 38 221 | 78 97 45 222 | 19 34 58 223 | 78 66 79 224 | 46 5 43 225 | 3 13 17 226 | 56 3 51 227 | 90 45 14 228 | 99 37 81 229 | 50 36 23 230 | 18 25 50 231 | 6 41 45 232 | 2 23 64 233 | 56 82 35 234 | 40 53 41 235 | 5 53 37 236 | 6 35 34 237 | 80 49 26 238 | 55 48 55 239 | 81 94 74 240 | 66 38 45 241 | 97 77 37 242 | 26 46 39 243 | 92 76 72 244 | 66 5 14 245 | 54 87 45 246 | 46 32 33 247 | 66 5 24 248 | 94 39 43 249 | 42 56 99 250 | 34 56 22 251 | 16 43 74 252 | 94 33 53 253 | 57 32 31 254 | 8 55 2 255 | 77 72 45 256 | 40 8 13 257 | 98 36 44 258 | 15 43 96 259 | 80 73 69 260 | 46 43 41 261 | 40 9 46 262 | 3 36 90 263 | 92 58 76 264 | 4 22 54 265 | 6 12 20 266 | 62 63 57 267 | 85 28 74 268 | 82 65 4 269 | 59 29 91 270 | 24 70 15 271 | 44 74 46 272 | 0 14 97 273 | 47 73 98 274 | 13 66 97 275 | 67 23 41 276 | 79 39 12 277 | 84 10 75 278 | 49 66 8 279 | 26 45 22 280 | 97 98 78 281 | 84 47 29 282 | 57 40 23 283 | 6 60 54 284 | 77 3 46 285 | 91 11 32 286 | 9 100 17 287 | 53 46 27 288 | 18 44 80 289 | 71 66 55 290 | 47 92 46 291 | 44 48 89 292 | 53 61 68 293 | 80 33 63 294 | 54 52 31 295 | 42 48 49 296 | 84 74 47 297 | 83 40 76 298 | 66 0 34 299 | 88 92 95 300 | 24 12 99 301 | 18 32 34 302 | -------------------------------------------------------------------------------- /examples/Luogu P1093/data-Luogu_P1093/Luogu_P10939.in: -------------------------------------------------------------------------------- 1 | 300 2 | 42 42 1 3 | 38 14 28 4 | 42 45 62 5 | 28 48 11 6 | 65 98 64 7 | 58 22 96 8 | 61 55 54 9 | 1 63 50 10 | 35 48 39 11 | 85 18 10 12 | 55 14 86 13 | 1 15 96 14 | 41 84 21 15 | 79 11 58 16 | 77 23 76 17 | 11 41 11 18 | 25 61 18 19 | 62 97 28 20 | 61 53 39 21 | 23 22 98 22 | 38 62 80 23 | 15 59 72 24 | 17 97 33 25 | 33 100 28 26 | 80 43 6 27 | 73 1 37 28 | 34 97 86 29 | 20 47 88 30 | 74 30 20 31 | 46 46 34 32 | 99 80 30 33 | 23 14 30 34 | 68 74 64 35 | 82 49 49 36 | 11 56 38 37 | 88 16 53 38 | 73 27 39 39 | 80 13 80 40 | 100 85 10 41 | 61 51 9 42 | 77 75 38 43 | 51 4 42 44 | 68 2 2 45 | 85 79 61 46 | 11 63 90 47 | 11 1 77 48 | 18 55 29 49 | 61 97 93 50 | 9 85 83 51 | 68 10 74 52 | 60 91 82 53 | 95 2 42 54 | 22 59 34 55 | 90 28 39 56 | 28 98 60 57 | 90 19 91 58 | 71 63 82 59 | 55 22 20 60 | 87 12 67 61 | 51 10 49 62 | 44 21 97 63 | 69 42 60 64 | 91 20 19 65 | 53 73 12 66 | 74 35 36 67 | 38 19 89 68 | 6 17 27 69 | 54 85 1 70 | 47 12 2 71 | 71 39 47 72 | 60 59 18 73 | 57 16 95 74 | 54 53 41 75 | 53 64 58 76 | 45 18 0 77 | 87 0 22 78 | 69 60 68 79 | 65 66 55 80 | 87 35 80 81 | 23 23 99 82 | 91 93 34 83 | 83 58 12 84 | 12 65 17 85 | 57 77 60 86 | 29 6 4 87 | 7 1 2 88 | 41 23 20 89 | 51 35 62 90 | 87 16 45 91 | 22 78 49 92 | 44 70 1 93 | 73 57 29 94 | 83 70 35 95 | 92 63 7 96 | 70 88 63 97 | 5 18 47 98 | 91 37 21 99 | 62 76 40 100 | 72 45 20 101 | 87 93 41 102 | 75 44 39 103 | 73 49 12 104 | 82 10 24 105 | 36 48 81 106 | 73 90 66 107 | 14 55 86 108 | 78 7 12 109 | 75 62 24 110 | 25 17 40 111 | 87 58 91 112 | 21 83 93 113 | 54 30 8 114 | 82 49 44 115 | 6 50 91 116 | 78 50 31 117 | 32 10 33 118 | 64 39 31 119 | 34 28 35 120 | 70 13 2 121 | 84 41 56 122 | 76 53 8 123 | 32 54 19 124 | 89 74 18 125 | 39 85 68 126 | 60 22 5 127 | 0 28 73 128 | 91 81 36 129 | 24 35 9 130 | 21 96 9 131 | 41 43 58 132 | 95 39 58 133 | 43 36 1 134 | 69 24 46 135 | 21 100 18 136 | 42 88 85 137 | 80 61 16 138 | 20 17 100 139 | 3 7 48 140 | 75 0 25 141 | 26 78 34 142 | 57 17 11 143 | 97 74 94 144 | 62 90 39 145 | 90 58 24 146 | 17 37 14 147 | 5 55 50 148 | 72 67 47 149 | 68 30 65 150 | 44 81 30 151 | 76 57 59 152 | 68 64 58 153 | 36 77 33 154 | 71 63 37 155 | 28 19 72 156 | 71 5 46 157 | 62 67 45 158 | 93 40 36 159 | 65 21 9 160 | 2 68 32 161 | 21 5 65 162 | 58 8 46 163 | 11 26 67 164 | 8 24 38 165 | 51 90 46 166 | 54 97 44 167 | 22 64 1 168 | 70 43 29 169 | 84 16 35 170 | 89 30 3 171 | 69 20 18 172 | 37 79 74 173 | 23 95 9 174 | 73 78 59 175 | 72 16 8 176 | 72 67 28 177 | 65 37 97 178 | 25 97 20 179 | 62 14 22 180 | 100 8 80 181 | 59 96 78 182 | 92 26 2 183 | 98 63 40 184 | 56 59 53 185 | 43 59 84 186 | 21 34 54 187 | 12 41 41 188 | 17 28 1 189 | 65 16 8 190 | 14 59 17 191 | 1 13 100 192 | 1 96 74 193 | 27 81 43 194 | 65 0 61 195 | 41 57 61 196 | 40 27 83 197 | 68 51 2 198 | 70 86 37 199 | 25 27 77 200 | 9 11 70 201 | 59 63 90 202 | 11 1 76 203 | 22 82 74 204 | 63 25 1 205 | 22 31 0 206 | 74 6 5 207 | 53 78 87 208 | 28 32 72 209 | 29 60 98 210 | 54 60 14 211 | 83 8 12 212 | 65 4 45 213 | 13 34 35 214 | 97 48 90 215 | 49 66 97 216 | 92 98 25 217 | 5 97 19 218 | 28 50 33 219 | 82 46 29 220 | 35 10 54 221 | 18 64 55 222 | 50 60 18 223 | 24 51 81 224 | 50 13 65 225 | 52 9 41 226 | 90 32 49 227 | 20 70 9 228 | 94 23 39 229 | 71 92 50 230 | 47 14 33 231 | 12 24 36 232 | 35 20 68 233 | 63 66 96 234 | 24 62 24 235 | 42 40 68 236 | 82 64 69 237 | 88 51 43 238 | 72 63 65 239 | 30 92 85 240 | 17 16 13 241 | 33 9 97 242 | 85 95 48 243 | 97 8 27 244 | 29 64 88 245 | 37 6 46 246 | 70 65 88 247 | 30 6 2 248 | 81 46 18 249 | 26 89 90 250 | 65 39 68 251 | 6 10 48 252 | 26 14 49 253 | 35 8 66 254 | 32 22 84 255 | 7 68 50 256 | 49 91 22 257 | 9 64 55 258 | 5 7 15 259 | 50 76 66 260 | 18 15 49 261 | 88 9 14 262 | 38 32 35 263 | 83 79 88 264 | 13 48 50 265 | 32 48 94 266 | 4 35 59 267 | 28 36 91 268 | 47 65 14 269 | 42 9 7 270 | 35 55 24 271 | 29 44 71 272 | 44 56 68 273 | 23 59 54 274 | 87 41 20 275 | 44 44 6 276 | 71 26 46 277 | 69 83 54 278 | 48 7 9 279 | 65 6 23 280 | 66 54 99 281 | 80 95 45 282 | 13 80 16 283 | 40 16 84 284 | 99 92 100 285 | 92 95 30 286 | 49 27 91 287 | 2 46 55 288 | 41 72 67 289 | 77 15 63 290 | 20 48 3 291 | 68 84 58 292 | 43 48 4 293 | 3 2 26 294 | 34 26 5 295 | 87 42 66 296 | 6 55 65 297 | 96 58 91 298 | 57 3 67 299 | 2 13 4 300 | 72 50 84 301 | 91 76 78 302 | -------------------------------------------------------------------------------- /examples/Luogu P1093/data-Luogu_P1093/Luogu_P10937.in: -------------------------------------------------------------------------------- 1 | 300 2 | 89 50 52 3 | 8 38 55 4 | 92 72 4 5 | 93 74 74 6 | 36 40 64 7 | 3 54 99 8 | 31 35 53 9 | 85 62 3 10 | 50 86 65 11 | 61 47 35 12 | 98 9 6 13 | 21 22 21 14 | 23 27 69 15 | 78 77 47 16 | 62 89 90 17 | 81 46 94 18 | 6 35 53 19 | 31 63 14 20 | 49 74 85 21 | 74 74 55 22 | 91 85 23 23 | 32 25 91 24 | 67 28 67 25 | 24 16 83 26 | 50 9 90 27 | 60 71 96 28 | 96 4 60 29 | 43 35 37 30 | 32 20 14 31 | 42 14 12 32 | 40 50 78 33 | 85 35 34 34 | 23 11 78 35 | 51 69 58 36 | 49 48 46 37 | 74 88 42 38 | 41 63 21 39 | 32 15 84 40 | 58 21 29 41 | 16 3 11 42 | 80 62 88 43 | 73 50 34 44 | 13 9 13 45 | 79 52 69 46 | 82 14 33 47 | 100 22 69 48 | 48 69 55 49 | 62 91 24 50 | 92 59 37 51 | 17 72 74 52 | 4 79 100 53 | 75 29 87 54 | 8 10 8 55 | 32 68 36 56 | 87 12 31 57 | 52 85 71 58 | 77 85 98 59 | 37 19 28 60 | 30 74 46 61 | 25 15 78 62 | 7 60 96 63 | 48 9 92 64 | 91 6 59 65 | 36 28 33 66 | 80 44 76 67 | 89 5 7 68 | 17 11 70 69 | 31 2 49 70 | 73 49 59 71 | 93 99 65 72 | 65 40 61 73 | 22 0 93 74 | 43 92 38 75 | 0 3 87 76 | 91 29 100 77 | 88 65 83 78 | 80 99 58 79 | 84 65 29 80 | 20 90 86 81 | 22 23 43 82 | 47 59 35 83 | 87 100 4 84 | 4 76 18 85 | 21 1 71 86 | 88 80 99 87 | 37 28 62 88 | 40 55 72 89 | 85 37 41 90 | 33 64 3 91 | 57 30 94 92 | 100 60 67 93 | 68 76 69 94 | 15 61 50 95 | 33 29 45 96 | 7 32 20 97 | 2 67 89 98 | 95 52 48 99 | 99 11 87 100 | 45 61 95 101 | 39 93 82 102 | 82 89 25 103 | 74 83 3 104 | 31 84 56 105 | 44 7 70 106 | 6 19 30 107 | 76 54 19 108 | 94 61 75 109 | 22 10 99 110 | 37 89 65 111 | 45 23 56 112 | 73 32 23 113 | 59 13 70 114 | 4 25 70 115 | 3 22 42 116 | 61 26 18 117 | 24 50 63 118 | 82 42 66 119 | 0 43 53 120 | 97 44 31 121 | 47 42 13 122 | 91 18 5 123 | 77 64 87 124 | 89 15 67 125 | 85 69 68 126 | 20 99 25 127 | 5 13 92 128 | 1 36 70 129 | 71 50 87 130 | 69 100 83 131 | 86 51 76 132 | 63 16 37 133 | 43 96 27 134 | 75 0 80 135 | 8 92 35 136 | 74 73 100 137 | 43 83 48 138 | 67 45 21 139 | 56 89 17 140 | 79 71 3 141 | 65 33 33 142 | 88 68 26 143 | 99 43 84 144 | 31 27 6 145 | 1 32 53 146 | 70 51 72 147 | 18 38 16 148 | 68 67 15 149 | 51 4 96 150 | 4 34 77 151 | 7 92 25 152 | 91 23 67 153 | 95 25 11 154 | 67 94 85 155 | 72 45 4 156 | 44 69 93 157 | 0 25 52 158 | 85 68 9 159 | 77 97 51 160 | 9 4 27 161 | 97 86 63 162 | 63 22 30 163 | 24 38 74 164 | 51 36 80 165 | 28 56 0 166 | 32 32 80 167 | 73 78 74 168 | 64 93 9 169 | 98 68 49 170 | 61 2 70 171 | 0 75 78 172 | 100 61 99 173 | 27 21 66 174 | 3 10 3 175 | 59 16 99 176 | 28 4 98 177 | 10 16 3 178 | 45 53 62 179 | 29 9 8 180 | 50 64 78 181 | 20 39 37 182 | 96 59 92 183 | 9 34 17 184 | 42 70 45 185 | 20 64 6 186 | 88 99 6 187 | 47 36 75 188 | 96 32 36 189 | 24 36 94 190 | 72 14 23 191 | 30 66 4 192 | 89 64 5 193 | 19 66 64 194 | 84 95 9 195 | 35 70 29 196 | 50 42 61 197 | 17 59 98 198 | 41 18 86 199 | 75 32 81 200 | 73 24 65 201 | 52 31 60 202 | 73 84 20 203 | 65 11 3 204 | 55 85 56 205 | 17 84 65 206 | 36 47 75 207 | 51 93 20 208 | 41 12 75 209 | 22 10 24 210 | 66 43 54 211 | 68 14 27 212 | 80 69 94 213 | 12 92 85 214 | 97 48 92 215 | 32 42 75 216 | 91 20 66 217 | 4 5 14 218 | 83 76 15 219 | 32 25 85 220 | 65 33 100 221 | 5 11 64 222 | 93 2 45 223 | 63 57 55 224 | 24 36 82 225 | 44 75 77 226 | 65 69 26 227 | 42 77 68 228 | 5 87 33 229 | 44 86 69 230 | 8 23 39 231 | 22 18 89 232 | 93 28 12 233 | 15 51 14 234 | 88 53 45 235 | 0 27 2 236 | 72 29 100 237 | 94 69 22 238 | 53 66 99 239 | 44 90 11 240 | 95 89 40 241 | 8 26 23 242 | 97 77 83 243 | 53 71 74 244 | 92 95 69 245 | 58 17 19 246 | 2 59 21 247 | 1 47 83 248 | 46 22 85 249 | 100 47 4 250 | 68 58 30 251 | 37 94 30 252 | 22 54 23 253 | 21 44 18 254 | 95 96 32 255 | 28 95 34 256 | 78 97 12 257 | 78 62 72 258 | 47 5 73 259 | 20 36 94 260 | 67 56 70 261 | 20 51 88 262 | 67 6 31 263 | 80 85 76 264 | 46 36 52 265 | 17 10 77 266 | 82 31 89 267 | 31 85 99 268 | 26 16 17 269 | 13 19 54 270 | 35 55 96 271 | 98 21 29 272 | 99 93 75 273 | 8 18 35 274 | 12 32 67 275 | 49 25 37 276 | 82 9 68 277 | 13 85 7 278 | 87 83 58 279 | 31 52 55 280 | 74 86 27 281 | 56 11 15 282 | 59 8 86 283 | 64 51 31 284 | 61 100 59 285 | 48 44 66 286 | 24 9 49 287 | 4 75 32 288 | 16 38 24 289 | 93 80 75 290 | 52 73 26 291 | 97 36 34 292 | 1 45 37 293 | 99 83 31 294 | 62 87 85 295 | 96 81 55 296 | 67 57 20 297 | 54 42 55 298 | 50 42 95 299 | 45 44 2 300 | 13 89 45 301 | 38 97 95 302 | -------------------------------------------------------------------------------- /examples/Luogu P1093/data-Luogu_P1093/Luogu_P10938.in: -------------------------------------------------------------------------------- 1 | 300 2 | 79 13 45 3 | 62 87 58 4 | 2 0 99 5 | 42 50 56 6 | 17 99 73 7 | 60 84 39 8 | 83 93 3 9 | 47 83 54 10 | 83 33 59 11 | 60 57 82 12 | 76 7 78 13 | 16 45 93 14 | 56 95 75 15 | 34 28 27 16 | 64 25 54 17 | 54 66 98 18 | 37 57 31 19 | 35 100 21 20 | 64 80 64 21 | 42 1 12 22 | 80 56 22 23 | 83 50 34 24 | 48 9 69 25 | 11 95 65 26 | 36 34 92 27 | 12 16 25 28 | 65 11 21 29 | 51 59 17 30 | 81 57 99 31 | 79 12 7 32 | 93 84 52 33 | 78 57 84 34 | 5 33 19 35 | 43 93 67 36 | 45 35 6 37 | 56 61 29 38 | 72 79 67 39 | 16 44 13 40 | 96 59 46 41 | 75 78 65 42 | 88 92 74 43 | 99 90 1 44 | 1 71 38 45 | 82 89 47 46 | 49 57 60 47 | 87 76 67 48 | 78 15 91 49 | 16 27 59 50 | 80 63 32 51 | 70 75 40 52 | 4 0 37 53 | 40 84 5 54 | 15 75 21 55 | 100 40 75 56 | 47 5 61 57 | 87 32 33 58 | 22 60 28 59 | 58 67 81 60 | 28 70 91 61 | 63 82 69 62 | 15 82 72 63 | 8 59 91 64 | 7 20 66 65 | 85 14 74 66 | 46 25 6 67 | 19 82 4 68 | 79 95 47 69 | 5 9 20 70 | 45 40 55 71 | 12 40 29 72 | 14 81 7 73 | 85 16 39 74 | 3 13 76 75 | 78 37 70 76 | 97 13 12 77 | 98 70 34 78 | 34 75 89 79 | 13 43 4 80 | 75 89 15 81 | 33 31 56 82 | 95 66 25 83 | 72 74 2 84 | 98 98 74 85 | 38 3 92 86 | 73 56 8 87 | 6 51 4 88 | 71 51 57 89 | 96 39 87 90 | 74 47 91 91 | 65 70 65 92 | 84 90 69 93 | 77 46 2 94 | 80 82 19 95 | 55 16 19 96 | 25 67 54 97 | 68 81 17 98 | 21 42 43 99 | 13 62 35 100 | 66 72 20 101 | 32 65 63 102 | 23 55 51 103 | 67 98 25 104 | 47 32 50 105 | 60 97 46 106 | 70 88 65 107 | 98 24 16 108 | 73 86 76 109 | 12 59 80 110 | 51 39 51 111 | 1 20 48 112 | 3 96 91 113 | 31 59 79 114 | 68 33 62 115 | 42 99 33 116 | 0 62 54 117 | 92 34 8 118 | 57 17 1 119 | 16 32 64 120 | 27 51 77 121 | 11 6 98 122 | 12 54 17 123 | 67 71 11 124 | 74 47 12 125 | 74 70 35 126 | 24 24 11 127 | 68 88 13 128 | 33 98 0 129 | 88 49 26 130 | 1 7 79 131 | 19 31 34 132 | 74 57 17 133 | 33 98 92 134 | 15 43 31 135 | 62 13 66 136 | 95 88 31 137 | 21 92 52 138 | 10 54 12 139 | 26 44 90 140 | 11 24 68 141 | 92 56 95 142 | 65 5 99 143 | 36 90 82 144 | 90 42 64 145 | 12 52 40 146 | 33 19 39 147 | 23 32 11 148 | 49 39 86 149 | 57 50 64 150 | 50 20 12 151 | 83 71 9 152 | 32 44 52 153 | 43 75 39 154 | 93 17 97 155 | 56 61 30 156 | 89 48 67 157 | 42 46 100 158 | 6 12 34 159 | 20 73 28 160 | 38 4 60 161 | 2 92 26 162 | 85 78 62 163 | 32 17 27 164 | 70 60 36 165 | 10 69 36 166 | 29 7 3 167 | 22 91 56 168 | 24 20 74 169 | 47 90 74 170 | 53 45 43 171 | 97 78 68 172 | 23 12 19 173 | 84 66 69 174 | 59 66 26 175 | 98 91 6 176 | 61 65 83 177 | 44 77 66 178 | 39 34 57 179 | 27 25 51 180 | 68 49 91 181 | 76 34 65 182 | 66 77 91 183 | 48 12 47 184 | 16 0 84 185 | 68 85 2 186 | 97 1 36 187 | 0 62 3 188 | 38 24 2 189 | 54 81 69 190 | 29 45 90 191 | 82 53 91 192 | 86 26 88 193 | 62 76 42 194 | 45 92 89 195 | 30 85 53 196 | 50 54 47 197 | 72 23 4 198 | 82 51 74 199 | 79 43 6 200 | 18 54 7 201 | 80 39 49 202 | 43 85 10 203 | 33 43 36 204 | 40 98 20 205 | 27 52 35 206 | 3 78 62 207 | 58 14 61 208 | 93 7 69 209 | 18 63 94 210 | 35 93 20 211 | 91 17 50 212 | 23 13 32 213 | 42 40 43 214 | 19 89 21 215 | 25 50 76 216 | 33 60 83 217 | 80 10 49 218 | 93 25 73 219 | 4 76 56 220 | 74 22 72 221 | 17 31 11 222 | 16 17 56 223 | 91 29 46 224 | 19 69 75 225 | 38 98 78 226 | 13 80 69 227 | 73 85 74 228 | 10 17 7 229 | 83 53 9 230 | 93 0 41 231 | 69 95 89 232 | 48 40 0 233 | 28 1 60 234 | 74 69 17 235 | 39 29 65 236 | 46 5 92 237 | 43 77 46 238 | 43 71 34 239 | 85 14 85 240 | 86 14 5 241 | 2 4 95 242 | 78 24 77 243 | 15 72 1 244 | 32 7 77 245 | 82 56 11 246 | 46 55 27 247 | 92 31 37 248 | 77 90 89 249 | 15 52 43 250 | 25 73 90 251 | 0 83 2 252 | 70 28 55 253 | 74 36 91 254 | 54 7 50 255 | 99 82 43 256 | 27 11 16 257 | 79 2 75 258 | 90 73 19 259 | 33 33 40 260 | 25 90 11 261 | 40 21 6 262 | 2 57 74 263 | 24 60 87 264 | 17 13 79 265 | 88 31 43 266 | 24 0 43 267 | 43 54 13 268 | 78 78 84 269 | 1 13 18 270 | 49 17 45 271 | 40 84 9 272 | 67 22 71 273 | 10 43 76 274 | 16 100 88 275 | 46 18 86 276 | 20 54 75 277 | 24 94 41 278 | 71 58 27 279 | 24 38 96 280 | 10 89 55 281 | 31 20 21 282 | 25 65 54 283 | 19 24 88 284 | 54 89 42 285 | 63 78 67 286 | 34 23 97 287 | 93 22 10 288 | 64 39 45 289 | 66 71 84 290 | 100 0 94 291 | 24 66 43 292 | 15 18 5 293 | 19 50 8 294 | 73 78 23 295 | 21 57 8 296 | 72 27 67 297 | 72 60 37 298 | 37 15 60 299 | 75 51 40 300 | 11 88 80 301 | 86 99 15 302 | -------------------------------------------------------------------------------- /examples/Luogu P1093/data-Luogu_P1093/Luogu_P109310.in: -------------------------------------------------------------------------------- 1 | 300 2 | 77 74 15 3 | 26 73 66 4 | 1 80 80 5 | 86 18 8 6 | 49 5 51 7 | 87 40 17 8 | 37 23 42 9 | 75 35 79 10 | 2 74 100 11 | 50 31 71 12 | 97 95 96 13 | 10 67 29 14 | 88 16 27 15 | 100 79 26 16 | 71 3 1 17 | 39 94 68 18 | 16 56 35 19 | 75 3 13 20 | 18 53 34 21 | 29 0 1 22 | 9 5 36 23 | 25 26 30 24 | 45 79 99 25 | 84 30 84 26 | 89 85 4 27 | 67 97 92 28 | 100 5 44 29 | 84 98 64 30 | 92 65 37 31 | 55 2 74 32 | 67 12 74 33 | 100 91 72 34 | 67 3 55 35 | 72 30 82 36 | 47 89 97 37 | 81 34 3 38 | 85 57 19 39 | 88 13 56 40 | 11 76 49 41 | 35 100 88 42 | 59 45 47 43 | 13 84 64 44 | 99 27 16 45 | 9 67 53 46 | 69 40 76 47 | 84 42 59 48 | 41 50 62 49 | 15 29 16 50 | 56 57 13 51 | 13 17 51 52 | 34 20 65 53 | 97 21 58 54 | 62 80 68 55 | 58 32 16 56 | 34 7 33 57 | 54 16 68 58 | 29 65 55 59 | 94 58 70 60 | 93 46 63 61 | 98 51 17 62 | 100 91 58 63 | 35 24 16 64 | 62 2 11 65 | 62 20 30 66 | 34 47 1 67 | 85 14 90 68 | 57 67 66 69 | 56 63 5 70 | 75 59 99 71 | 77 80 65 72 | 44 0 22 73 | 80 92 18 74 | 49 55 68 75 | 2 77 43 76 | 25 62 48 77 | 17 8 65 78 | 4 82 95 79 | 87 59 27 80 | 58 62 37 81 | 8 38 5 82 | 18 64 61 83 | 11 65 63 84 | 100 63 84 85 | 65 54 72 86 | 15 92 12 87 | 39 8 64 88 | 9 71 93 89 | 73 24 62 90 | 99 88 91 91 | 8 6 32 92 | 18 99 16 93 | 84 10 37 94 | 11 93 84 95 | 98 66 97 96 | 76 34 76 97 | 71 32 84 98 | 30 24 62 99 | 54 29 42 100 | 93 33 42 101 | 79 34 2 102 | 16 58 89 103 | 66 51 72 104 | 79 11 36 105 | 0 46 89 106 | 42 22 80 107 | 26 89 77 108 | 93 40 53 109 | 21 57 74 110 | 43 54 38 111 | 74 74 2 112 | 58 42 46 113 | 68 13 68 114 | 79 54 3 115 | 37 62 47 116 | 17 24 9 117 | 39 11 24 118 | 58 58 0 119 | 24 70 15 120 | 39 61 63 121 | 26 38 100 122 | 17 22 30 123 | 80 35 98 124 | 26 95 22 125 | 43 79 17 126 | 30 2 12 127 | 52 37 68 128 | 51 55 74 129 | 91 64 53 130 | 11 13 63 131 | 33 7 80 132 | 9 71 31 133 | 27 74 14 134 | 74 48 40 135 | 8 72 7 136 | 6 29 39 137 | 42 36 7 138 | 73 22 33 139 | 77 48 63 140 | 22 57 20 141 | 26 0 63 142 | 74 93 38 143 | 1 67 14 144 | 59 21 49 145 | 62 63 82 146 | 54 87 83 147 | 58 70 35 148 | 24 68 56 149 | 25 65 58 150 | 77 51 60 151 | 41 6 76 152 | 42 69 51 153 | 95 33 61 154 | 97 23 20 155 | 1 55 77 156 | 1 63 69 157 | 40 54 61 158 | 7 74 13 159 | 84 37 2 160 | 8 75 37 161 | 63 36 2 162 | 71 58 73 163 | 67 78 88 164 | 95 5 46 165 | 88 0 15 166 | 87 28 71 167 | 2 85 38 168 | 49 93 1 169 | 25 45 30 170 | 54 34 64 171 | 52 9 35 172 | 84 5 53 173 | 35 53 39 174 | 63 60 13 175 | 99 77 8 176 | 18 23 2 177 | 65 20 92 178 | 16 51 74 179 | 25 18 68 180 | 49 43 4 181 | 59 49 69 182 | 94 31 36 183 | 42 64 37 184 | 80 35 59 185 | 97 99 70 186 | 74 77 60 187 | 63 95 46 188 | 12 34 16 189 | 97 77 38 190 | 89 89 88 191 | 56 69 64 192 | 85 46 85 193 | 64 26 65 194 | 68 15 15 195 | 94 27 11 196 | 96 74 96 197 | 87 66 92 198 | 55 69 81 199 | 30 37 56 200 | 77 52 17 201 | 41 33 4 202 | 29 96 70 203 | 79 77 46 204 | 35 44 51 205 | 70 49 59 206 | 36 57 33 207 | 9 24 18 208 | 34 86 100 209 | 11 19 73 210 | 59 53 52 211 | 23 78 98 212 | 98 80 32 213 | 45 61 83 214 | 68 73 89 215 | 87 20 85 216 | 30 79 25 217 | 16 25 87 218 | 44 92 49 219 | 76 51 78 220 | 54 86 75 221 | 21 65 81 222 | 83 41 55 223 | 72 32 85 224 | 53 70 97 225 | 56 90 53 226 | 29 63 21 227 | 100 4 39 228 | 55 48 39 229 | 72 70 1 230 | 62 47 47 231 | 66 59 9 232 | 8 99 72 233 | 90 11 34 234 | 59 66 23 235 | 71 51 85 236 | 46 42 24 237 | 7 40 69 238 | 10 92 8 239 | 73 62 80 240 | 39 95 17 241 | 3 92 44 242 | 6 82 24 243 | 42 2 35 244 | 46 71 72 245 | 34 35 55 246 | 43 0 19 247 | 86 33 49 248 | 77 16 18 249 | 33 45 54 250 | 79 76 16 251 | 79 82 25 252 | 12 58 10 253 | 84 3 30 254 | 81 91 22 255 | 39 80 65 256 | 94 11 14 257 | 10 62 55 258 | 25 98 60 259 | 50 0 77 260 | 95 43 97 261 | 46 95 19 262 | 87 16 8 263 | 26 57 83 264 | 11 30 94 265 | 49 67 85 266 | 43 100 85 267 | 98 36 37 268 | 12 32 47 269 | 60 88 12 270 | 64 75 9 271 | 85 33 21 272 | 41 58 84 273 | 42 50 35 274 | 46 14 34 275 | 82 35 18 276 | 57 40 86 277 | 30 98 81 278 | 48 40 97 279 | 17 53 71 280 | 12 97 99 281 | 86 64 14 282 | 82 41 26 283 | 29 5 50 284 | 27 21 61 285 | 46 88 96 286 | 36 86 21 287 | 85 39 17 288 | 94 4 91 289 | 73 12 62 290 | 17 34 59 291 | 74 4 44 292 | 72 92 82 293 | 43 48 6 294 | 74 61 58 295 | 82 53 52 296 | 83 6 62 297 | 4 73 58 298 | 18 36 23 299 | 95 40 36 300 | 54 35 35 301 | 59 84 16 302 | -------------------------------------------------------------------------------- /examples/Luogu P1093/data-Luogu_P1093/Luogu_P10932.in: -------------------------------------------------------------------------------- 1 | 300 2 | 5 27 95 3 | 89 78 45 4 | 22 52 61 5 | 93 95 2 6 | 83 59 48 7 | 81 76 32 8 | 62 34 98 9 | 14 41 62 10 | 80 84 13 11 | 95 68 42 12 | 99 46 65 13 | 7 57 67 14 | 39 92 79 15 | 33 99 6 16 | 50 53 40 17 | 31 29 6 18 | 24 65 93 19 | 98 84 60 20 | 37 11 40 21 | 95 25 27 22 | 43 34 23 23 | 78 78 13 24 | 74 41 77 25 | 74 52 60 26 | 71 14 41 27 | 30 83 15 28 | 40 78 5 29 | 95 77 44 30 | 45 75 31 31 | 84 74 90 32 | 3 60 29 33 | 45 29 80 34 | 21 18 47 35 | 31 39 37 36 | 27 59 16 37 | 87 66 34 38 | 59 64 42 39 | 39 10 86 40 | 80 30 4 41 | 49 22 38 42 | 95 97 93 43 | 6 19 84 44 | 56 21 65 45 | 37 47 94 46 | 28 55 88 47 | 35 29 46 48 | 79 4 8 49 | 55 43 17 50 | 58 51 88 51 | 43 84 97 52 | 9 44 61 53 | 48 18 71 54 | 33 98 42 55 | 33 100 43 56 | 62 12 89 57 | 22 42 78 58 | 63 68 87 59 | 68 73 50 60 | 66 90 46 61 | 61 36 17 62 | 89 3 0 63 | 61 18 43 64 | 54 0 83 65 | 96 18 57 66 | 6 41 98 67 | 17 12 25 68 | 88 71 26 69 | 100 21 17 70 | 96 32 35 71 | 14 21 76 72 | 95 9 84 73 | 41 99 21 74 | 94 62 42 75 | 87 15 16 76 | 0 79 3 77 | 30 14 38 78 | 72 92 39 79 | 78 22 26 80 | 3 47 62 81 | 0 23 42 82 | 86 89 80 83 | 10 60 11 84 | 55 12 2 85 | 84 73 46 86 | 31 79 40 87 | 97 3 12 88 | 95 89 44 89 | 49 6 9 90 | 48 22 65 91 | 56 73 35 92 | 58 39 36 93 | 0 41 87 94 | 34 34 57 95 | 67 23 83 96 | 84 98 58 97 | 92 40 3 98 | 92 1 15 99 | 3 59 42 100 | 59 31 61 101 | 92 83 23 102 | 66 50 17 103 | 1 72 48 104 | 72 88 11 105 | 41 29 83 106 | 88 81 79 107 | 1 47 83 108 | 47 82 88 109 | 10 47 44 110 | 61 41 99 111 | 84 92 3 112 | 38 62 81 113 | 77 92 63 114 | 47 41 32 115 | 91 52 17 116 | 38 37 20 117 | 1 85 19 118 | 27 68 86 119 | 6 20 65 120 | 5 71 47 121 | 92 38 66 122 | 79 13 20 123 | 75 77 59 124 | 78 40 97 125 | 59 52 92 126 | 11 45 90 127 | 0 58 11 128 | 22 15 33 129 | 27 40 39 130 | 16 75 69 131 | 40 89 17 132 | 81 86 82 133 | 69 33 3 134 | 45 13 76 135 | 95 48 13 136 | 33 31 91 137 | 44 1 69 138 | 34 1 78 139 | 69 41 12 140 | 43 96 63 141 | 30 73 7 142 | 27 98 15 143 | 40 87 42 144 | 1 21 31 145 | 21 14 5 146 | 87 20 26 147 | 3 22 65 148 | 36 20 42 149 | 31 6 54 150 | 84 55 61 151 | 19 87 18 152 | 4 66 57 153 | 94 90 72 154 | 100 27 64 155 | 17 62 5 156 | 16 38 61 157 | 64 1 96 158 | 16 68 60 159 | 16 40 18 160 | 66 100 52 161 | 85 44 73 162 | 89 18 17 163 | 76 37 17 164 | 41 28 0 165 | 71 89 65 166 | 11 62 33 167 | 43 98 57 168 | 55 83 78 169 | 18 72 12 170 | 20 77 3 171 | 74 55 16 172 | 85 33 92 173 | 67 15 54 174 | 98 29 95 175 | 30 42 21 176 | 40 17 0 177 | 90 50 43 178 | 40 85 99 179 | 81 28 92 180 | 31 67 0 181 | 35 22 34 182 | 7 8 21 183 | 72 85 16 184 | 85 47 60 185 | 95 72 64 186 | 82 32 32 187 | 33 9 50 188 | 23 37 52 189 | 24 69 45 190 | 43 22 40 191 | 7 14 56 192 | 86 64 27 193 | 72 16 49 194 | 32 2 28 195 | 21 65 2 196 | 28 49 30 197 | 26 83 70 198 | 55 64 100 199 | 54 53 29 200 | 39 32 66 201 | 29 74 63 202 | 93 64 6 203 | 69 37 0 204 | 45 96 73 205 | 25 31 70 206 | 42 49 13 207 | 21 54 44 208 | 33 65 65 209 | 89 21 29 210 | 15 44 95 211 | 87 20 84 212 | 91 71 82 213 | 7 35 36 214 | 11 45 18 215 | 87 4 19 216 | 52 16 86 217 | 31 61 99 218 | 5 82 58 219 | 93 22 99 220 | 13 56 37 221 | 48 84 94 222 | 24 80 86 223 | 71 82 65 224 | 64 16 54 225 | 36 51 99 226 | 72 91 86 227 | 76 79 3 228 | 88 79 6 229 | 7 60 28 230 | 1 97 57 231 | 100 4 76 232 | 93 31 18 233 | 88 55 90 234 | 38 18 68 235 | 93 23 62 236 | 16 80 70 237 | 15 45 22 238 | 12 20 83 239 | 68 78 64 240 | 21 61 18 241 | 53 71 54 242 | 76 73 22 243 | 64 50 80 244 | 75 4 15 245 | 54 86 13 246 | 3 48 44 247 | 54 35 5 248 | 30 3 83 249 | 51 31 23 250 | 70 97 41 251 | 52 82 37 252 | 96 8 79 253 | 63 7 89 254 | 46 84 57 255 | 52 42 11 256 | 54 7 56 257 | 65 68 92 258 | 51 100 9 259 | 19 50 64 260 | 60 32 56 261 | 52 56 87 262 | 18 32 3 263 | 45 36 86 264 | 1 96 47 265 | 88 20 54 266 | 25 65 47 267 | 77 95 52 268 | 88 70 94 269 | 61 22 88 270 | 8 92 98 271 | 23 23 90 272 | 25 29 73 273 | 88 16 64 274 | 58 51 97 275 | 16 75 26 276 | 42 77 100 277 | 14 84 58 278 | 59 73 91 279 | 23 72 43 280 | 70 50 82 281 | 88 22 1 282 | 24 42 25 283 | 87 10 76 284 | 3 89 62 285 | 49 97 60 286 | 35 47 31 287 | 27 100 70 288 | 65 100 90 289 | 25 7 91 290 | 96 56 73 291 | 24 86 55 292 | 66 94 23 293 | 21 50 29 294 | 25 33 95 295 | 62 71 38 296 | 8 95 83 297 | 91 84 35 298 | 10 79 25 299 | 28 93 24 300 | 18 38 28 301 | 18 3 50 302 | -------------------------------------------------------------------------------- /examples/Luogu P1093/data-Luogu_P1093/Luogu_P10934.in: -------------------------------------------------------------------------------- 1 | 300 2 | 9 87 45 3 | 37 0 73 4 | 64 22 61 5 | 29 59 78 6 | 37 41 26 7 | 67 76 61 8 | 94 86 83 9 | 69 70 15 10 | 81 48 17 11 | 60 24 30 12 | 53 52 33 13 | 77 34 21 14 | 7 79 20 15 | 75 83 100 16 | 39 28 70 17 | 93 72 35 18 | 91 21 56 19 | 86 57 23 20 | 59 68 33 21 | 53 28 59 22 | 87 100 61 23 | 29 95 26 24 | 65 51 68 25 | 8 95 41 26 | 17 98 9 27 | 11 14 38 28 | 89 60 91 29 | 45 76 71 30 | 47 29 2 31 | 96 30 93 32 | 73 10 36 33 | 49 21 62 34 | 19 26 88 35 | 1 63 11 36 | 61 25 26 37 | 57 45 73 38 | 50 100 66 39 | 98 60 24 40 | 11 33 14 41 | 91 94 12 42 | 14 1 87 43 | 55 54 20 44 | 84 8 9 45 | 33 39 99 46 | 3 73 79 47 | 61 81 82 48 | 36 51 59 49 | 6 91 69 50 | 11 13 50 51 | 79 67 44 52 | 63 26 22 53 | 42 16 89 54 | 16 19 35 55 | 10 34 0 56 | 22 55 85 57 | 83 65 40 58 | 30 51 20 59 | 58 18 3 60 | 9 14 77 61 | 78 96 96 62 | 20 2 88 63 | 59 28 23 64 | 13 78 30 65 | 2 0 22 66 | 70 35 44 67 | 22 98 22 68 | 23 21 27 69 | 69 14 7 70 | 26 16 61 71 | 58 4 38 72 | 50 67 35 73 | 11 11 93 74 | 68 18 56 75 | 20 57 11 76 | 35 31 59 77 | 84 49 75 78 | 44 14 59 79 | 87 73 33 80 | 23 99 2 81 | 96 18 34 82 | 61 17 53 83 | 39 62 47 84 | 20 52 68 85 | 24 65 62 86 | 86 55 94 87 | 4 10 55 88 | 20 38 39 89 | 21 53 85 90 | 55 51 46 91 | 47 91 13 92 | 93 97 59 93 | 7 6 36 94 | 44 88 85 95 | 62 15 53 96 | 87 66 56 97 | 100 69 43 98 | 32 32 79 99 | 35 12 16 100 | 70 92 60 101 | 48 4 97 102 | 100 42 28 103 | 63 88 85 104 | 35 86 87 105 | 95 87 24 106 | 17 39 50 107 | 52 8 53 108 | 53 70 66 109 | 4 22 64 110 | 74 53 23 111 | 88 26 0 112 | 10 63 98 113 | 44 95 19 114 | 34 77 39 115 | 35 25 75 116 | 19 33 66 117 | 24 66 5 118 | 46 2 20 119 | 34 100 6 120 | 28 31 68 121 | 11 52 10 122 | 9 14 50 123 | 58 9 49 124 | 22 27 24 125 | 41 96 26 126 | 69 28 30 127 | 89 87 69 128 | 23 22 52 129 | 55 22 95 130 | 7 10 9 131 | 14 8 5 132 | 74 53 49 133 | 82 99 38 134 | 82 58 56 135 | 72 27 23 136 | 4 79 13 137 | 70 33 85 138 | 24 97 84 139 | 30 64 57 140 | 5 5 40 141 | 57 18 6 142 | 76 72 2 143 | 31 3 33 144 | 93 7 82 145 | 16 41 28 146 | 93 64 30 147 | 73 68 74 148 | 82 97 76 149 | 22 57 72 150 | 80 15 48 151 | 71 39 82 152 | 55 27 99 153 | 76 99 80 154 | 51 62 38 155 | 22 79 96 156 | 36 98 62 157 | 85 39 66 158 | 82 91 99 159 | 23 90 0 160 | 8 96 57 161 | 11 34 5 162 | 32 53 45 163 | 12 60 57 164 | 96 21 39 165 | 37 91 1 166 | 31 28 84 167 | 65 29 62 168 | 71 61 15 169 | 55 68 90 170 | 4 13 38 171 | 99 77 19 172 | 87 3 43 173 | 60 53 90 174 | 25 31 84 175 | 22 15 62 176 | 41 25 35 177 | 73 5 69 178 | 40 20 53 179 | 99 8 9 180 | 68 40 7 181 | 63 34 52 182 | 1 79 32 183 | 96 54 13 184 | 76 15 17 185 | 60 36 29 186 | 59 36 25 187 | 59 47 89 188 | 85 35 69 189 | 45 9 1 190 | 78 51 90 191 | 81 79 71 192 | 20 2 73 193 | 46 8 25 194 | 25 30 39 195 | 85 33 74 196 | 15 55 1 197 | 98 69 70 198 | 76 93 22 199 | 85 96 56 200 | 17 50 79 201 | 23 9 88 202 | 88 44 42 203 | 27 33 65 204 | 19 13 78 205 | 36 21 58 206 | 43 80 28 207 | 66 88 97 208 | 81 70 32 209 | 90 53 33 210 | 37 19 15 211 | 30 73 50 212 | 42 70 33 213 | 35 10 47 214 | 18 48 75 215 | 80 3 14 216 | 71 80 20 217 | 26 57 47 218 | 100 23 86 219 | 18 77 39 220 | 7 48 33 221 | 39 41 51 222 | 10 14 96 223 | 54 27 100 224 | 77 10 7 225 | 52 37 4 226 | 3 24 56 227 | 39 21 55 228 | 40 59 75 229 | 78 14 70 230 | 48 81 1 231 | 41 3 0 232 | 18 88 70 233 | 38 31 32 234 | 71 9 11 235 | 47 7 43 236 | 25 83 25 237 | 43 70 7 238 | 12 40 64 239 | 99 2 90 240 | 62 15 82 241 | 73 85 66 242 | 22 7 35 243 | 88 16 86 244 | 79 58 25 245 | 46 13 52 246 | 85 43 35 247 | 46 25 13 248 | 61 14 38 249 | 63 89 58 250 | 48 75 61 251 | 6 95 22 252 | 65 44 30 253 | 64 76 29 254 | 52 7 98 255 | 16 10 94 256 | 52 39 74 257 | 31 45 88 258 | 1 87 95 259 | 66 55 83 260 | 65 28 17 261 | 90 37 18 262 | 95 78 1 263 | 93 88 80 264 | 47 29 76 265 | 85 12 97 266 | 37 35 12 267 | 91 28 43 268 | 10 95 39 269 | 26 91 14 270 | 97 43 50 271 | 91 83 83 272 | 21 63 39 273 | 97 80 54 274 | 35 60 77 275 | 39 82 67 276 | 70 4 36 277 | 62 99 37 278 | 42 24 88 279 | 78 2 44 280 | 56 66 8 281 | 12 61 6 282 | 65 22 57 283 | 11 1 61 284 | 30 58 58 285 | 73 45 91 286 | 38 93 62 287 | 78 70 81 288 | 48 39 29 289 | 32 38 54 290 | 13 72 37 291 | 17 24 24 292 | 22 94 76 293 | 43 47 43 294 | 67 92 22 295 | 70 33 1 296 | 96 77 63 297 | 96 15 83 298 | 96 30 94 299 | 70 28 36 300 | 69 15 78 301 | 52 93 56 302 | -------------------------------------------------------------------------------- /examples/Luogu P1093/data-Luogu_P1093/Luogu_P10935.in: -------------------------------------------------------------------------------- 1 | 300 2 | 89 18 57 3 | 96 85 33 4 | 64 20 67 5 | 73 18 21 6 | 86 92 8 7 | 28 81 73 8 | 37 50 27 9 | 11 6 47 10 | 31 72 38 11 | 20 89 89 12 | 19 21 69 13 | 9 69 36 14 | 18 82 59 15 | 62 29 12 16 | 54 91 77 17 | 55 35 36 18 | 46 64 37 19 | 65 23 78 20 | 40 34 29 21 | 60 52 28 22 | 29 42 46 23 | 8 75 3 24 | 27 6 26 25 | 26 67 67 26 | 82 85 84 27 | 34 53 33 28 | 83 84 63 29 | 23 37 31 30 | 77 9 40 31 | 20 10 41 32 | 77 84 99 33 | 69 27 32 34 | 75 77 37 35 | 15 77 69 36 | 84 28 39 37 | 81 80 29 38 | 18 43 16 39 | 66 90 55 40 | 42 83 64 41 | 23 30 48 42 | 30 88 51 43 | 91 65 44 44 | 99 48 72 45 | 73 51 48 46 | 31 73 26 47 | 56 9 6 48 | 67 37 39 49 | 50 56 10 50 | 78 41 30 51 | 4 47 10 52 | 54 80 57 53 | 27 9 21 54 | 46 11 20 55 | 23 77 54 56 | 59 7 5 57 | 16 63 83 58 | 84 76 0 59 | 87 62 99 60 | 17 62 37 61 | 34 23 87 62 | 27 4 21 63 | 69 98 72 64 | 50 62 4 65 | 85 65 39 66 | 15 40 20 67 | 19 36 21 68 | 30 13 86 69 | 2 55 96 70 | 39 96 36 71 | 43 41 12 72 | 30 98 59 73 | 79 16 61 74 | 69 8 91 75 | 80 63 81 76 | 97 0 1 77 | 83 19 47 78 | 9 38 72 79 | 16 7 83 80 | 80 96 43 81 | 25 52 76 82 | 64 42 23 83 | 52 23 18 84 | 5 63 14 85 | 68 30 23 86 | 31 71 85 87 | 94 41 69 88 | 95 91 14 89 | 73 83 25 90 | 47 41 64 91 | 88 11 25 92 | 51 10 22 93 | 39 44 79 94 | 89 84 86 95 | 99 100 97 96 | 36 93 32 97 | 100 14 68 98 | 26 89 77 99 | 69 96 36 100 | 11 78 49 101 | 60 20 39 102 | 50 33 2 103 | 86 16 50 104 | 98 60 66 105 | 100 23 26 106 | 48 54 84 107 | 96 100 70 108 | 30 51 23 109 | 42 17 36 110 | 67 34 40 111 | 48 4 57 112 | 71 12 59 113 | 58 81 43 114 | 15 21 6 115 | 58 83 21 116 | 16 1 18 117 | 23 81 11 118 | 40 22 49 119 | 52 72 16 120 | 99 81 3 121 | 91 11 25 122 | 76 58 59 123 | 69 80 71 124 | 6 13 61 125 | 57 13 34 126 | 60 60 15 127 | 24 44 39 128 | 59 18 5 129 | 81 2 40 130 | 29 20 29 131 | 99 98 19 132 | 33 5 42 133 | 13 62 93 134 | 19 36 29 135 | 70 97 7 136 | 48 34 94 137 | 51 36 24 138 | 77 29 21 139 | 46 97 44 140 | 85 13 14 141 | 53 84 81 142 | 46 9 100 143 | 8 16 9 144 | 55 99 33 145 | 55 11 86 146 | 84 64 68 147 | 3 74 0 148 | 0 16 6 149 | 90 87 21 150 | 74 90 14 151 | 87 21 81 152 | 52 11 62 153 | 39 79 45 154 | 36 81 62 155 | 96 100 88 156 | 30 86 89 157 | 21 80 68 158 | 49 96 66 159 | 27 81 92 160 | 92 21 11 161 | 15 48 80 162 | 82 27 4 163 | 31 33 59 164 | 13 52 16 165 | 91 29 87 166 | 38 54 95 167 | 76 25 55 168 | 18 14 36 169 | 79 81 26 170 | 74 91 70 171 | 26 49 68 172 | 72 90 15 173 | 1 42 76 174 | 24 94 32 175 | 0 75 25 176 | 96 86 28 177 | 13 11 0 178 | 99 97 93 179 | 44 35 10 180 | 15 66 47 181 | 99 6 4 182 | 24 39 86 183 | 24 10 58 184 | 10 6 56 185 | 63 54 94 186 | 4 25 22 187 | 51 73 34 188 | 69 3 74 189 | 20 29 65 190 | 58 88 84 191 | 84 58 2 192 | 5 2 94 193 | 39 55 91 194 | 63 21 84 195 | 46 17 99 196 | 55 3 34 197 | 4 95 34 198 | 10 13 28 199 | 2 14 92 200 | 89 66 87 201 | 72 48 16 202 | 65 14 45 203 | 36 67 72 204 | 79 49 28 205 | 73 76 0 206 | 91 31 17 207 | 27 48 1 208 | 98 76 85 209 | 45 58 97 210 | 98 53 60 211 | 81 64 91 212 | 36 7 41 213 | 87 73 48 214 | 60 95 28 215 | 43 81 70 216 | 52 48 70 217 | 5 39 73 218 | 71 31 5 219 | 99 71 39 220 | 40 84 6 221 | 23 34 47 222 | 80 4 78 223 | 56 20 31 224 | 40 54 1 225 | 54 80 72 226 | 26 53 90 227 | 16 93 91 228 | 13 46 41 229 | 14 86 96 230 | 22 65 65 231 | 79 26 29 232 | 72 64 33 233 | 21 1 94 234 | 34 18 60 235 | 83 33 2 236 | 15 77 28 237 | 94 84 4 238 | 79 34 37 239 | 26 24 62 240 | 33 19 99 241 | 97 68 34 242 | 29 14 40 243 | 19 11 19 244 | 65 98 79 245 | 75 83 23 246 | 33 99 22 247 | 74 22 90 248 | 14 27 49 249 | 94 78 75 250 | 42 70 88 251 | 22 93 47 252 | 21 79 99 253 | 23 57 71 254 | 35 6 75 255 | 1 73 44 256 | 65 66 2 257 | 76 67 27 258 | 14 43 64 259 | 42 32 7 260 | 79 77 84 261 | 29 93 3 262 | 61 52 31 263 | 11 63 81 264 | 37 6 67 265 | 48 92 37 266 | 29 58 11 267 | 25 54 70 268 | 26 4 99 269 | 39 12 24 270 | 41 68 45 271 | 99 49 85 272 | 56 56 82 273 | 27 45 67 274 | 8 46 26 275 | 43 8 98 276 | 59 67 19 277 | 38 96 5 278 | 97 8 96 279 | 22 76 49 280 | 36 66 74 281 | 43 37 14 282 | 45 49 34 283 | 52 28 63 284 | 65 79 89 285 | 71 92 97 286 | 27 62 33 287 | 88 21 81 288 | 96 9 99 289 | 3 52 22 290 | 27 58 34 291 | 14 79 8 292 | 4 55 71 293 | 46 32 63 294 | 97 50 29 295 | 60 90 67 296 | 15 92 98 297 | 57 92 82 298 | 56 43 30 299 | 89 44 53 300 | 72 39 72 301 | 94 40 53 302 | -------------------------------------------------------------------------------- /examples/Luogu P1093/data-Luogu_P1093/Luogu_P10933.in: -------------------------------------------------------------------------------- 1 | 300 2 | 2 50 36 3 | 89 19 12 4 | 87 52 100 5 | 34 51 35 6 | 15 82 83 7 | 46 30 90 8 | 95 19 86 9 | 60 90 97 10 | 54 72 18 11 | 0 77 14 12 | 89 4 59 13 | 67 29 79 14 | 79 81 89 15 | 63 13 87 16 | 62 56 54 17 | 18 63 3 18 | 60 93 54 19 | 54 39 96 20 | 62 49 64 21 | 74 43 7 22 | 8 68 30 23 | 90 38 89 24 | 86 86 60 25 | 10 93 23 26 | 30 97 81 27 | 25 31 60 28 | 23 6 2 29 | 84 69 57 30 | 86 29 4 31 | 13 27 33 32 | 63 22 12 33 | 96 55 75 34 | 59 87 28 35 | 55 83 63 36 | 84 64 45 37 | 52 30 13 38 | 34 99 93 39 | 92 20 36 40 | 83 29 95 41 | 68 86 41 42 | 25 3 18 43 | 42 92 3 44 | 50 59 99 45 | 47 90 4 46 | 42 13 64 47 | 34 87 56 48 | 2 63 92 49 | 23 85 93 50 | 83 72 38 51 | 30 28 23 52 | 32 61 65 53 | 12 99 28 54 | 1 47 73 55 | 100 8 23 56 | 98 94 75 57 | 3 41 23 58 | 51 99 52 59 | 33 30 60 60 | 46 47 1 61 | 32 23 37 62 | 27 18 99 63 | 71 33 62 64 | 77 71 34 65 | 89 47 24 66 | 23 6 31 67 | 10 77 63 68 | 45 62 86 69 | 79 53 10 70 | 69 9 89 71 | 100 58 1 72 | 95 52 72 73 | 89 72 15 74 | 42 65 55 75 | 78 67 30 76 | 47 22 34 77 | 54 76 30 78 | 24 8 71 79 | 38 99 49 80 | 4 28 80 81 | 47 63 38 82 | 32 90 95 83 | 36 77 51 84 | 46 74 32 85 | 40 61 67 86 | 52 19 3 87 | 77 62 60 88 | 57 97 66 89 | 28 33 5 90 | 53 15 85 91 | 76 18 0 92 | 24 14 64 93 | 65 46 49 94 | 52 48 12 95 | 93 40 50 96 | 61 32 47 97 | 50 98 88 98 | 82 0 76 99 | 37 94 29 100 | 92 27 7 101 | 17 91 3 102 | 26 82 20 103 | 82 93 25 104 | 43 37 84 105 | 53 99 58 106 | 88 68 66 107 | 17 4 4 108 | 74 13 39 109 | 82 41 97 110 | 25 19 81 111 | 30 39 92 112 | 31 41 82 113 | 68 14 89 114 | 39 93 100 115 | 30 75 23 116 | 87 82 49 117 | 73 65 73 118 | 42 68 36 119 | 9 73 9 120 | 14 50 79 121 | 45 18 38 122 | 14 28 31 123 | 27 57 64 124 | 57 38 14 125 | 80 90 95 126 | 55 64 7 127 | 52 91 80 128 | 35 80 45 129 | 28 26 85 130 | 55 67 79 131 | 47 51 66 132 | 2 90 53 133 | 82 56 89 134 | 52 50 98 135 | 56 58 62 136 | 55 73 18 137 | 49 36 34 138 | 90 20 49 139 | 8 79 53 140 | 72 74 65 141 | 30 59 64 142 | 97 29 18 143 | 1 71 38 144 | 79 14 74 145 | 17 57 37 146 | 51 6 13 147 | 32 0 18 148 | 34 12 73 149 | 89 91 94 150 | 27 71 11 151 | 72 44 81 152 | 69 47 72 153 | 78 77 36 154 | 37 72 62 155 | 10 61 29 156 | 11 95 15 157 | 84 94 2 158 | 34 93 54 159 | 99 11 92 160 | 65 28 13 161 | 29 24 51 162 | 10 94 45 163 | 100 63 93 164 | 37 94 38 165 | 71 22 90 166 | 20 93 8 167 | 32 76 96 168 | 68 92 27 169 | 23 42 53 170 | 86 96 35 171 | 39 92 85 172 | 67 91 2 173 | 43 12 82 174 | 78 86 75 175 | 34 16 45 176 | 27 42 82 177 | 79 82 20 178 | 67 83 13 179 | 90 27 98 180 | 30 38 100 181 | 4 44 42 182 | 39 83 44 183 | 13 33 80 184 | 98 97 91 185 | 26 93 75 186 | 8 51 19 187 | 50 43 32 188 | 2 41 65 189 | 42 3 58 190 | 91 98 90 191 | 65 74 45 192 | 30 38 64 193 | 60 76 26 194 | 50 80 11 195 | 32 10 34 196 | 38 98 62 197 | 98 76 14 198 | 16 39 66 199 | 41 14 13 200 | 11 14 84 201 | 99 49 25 202 | 32 99 61 203 | 40 70 54 204 | 79 88 24 205 | 10 76 100 206 | 67 37 21 207 | 94 67 86 208 | 3 72 22 209 | 69 6 75 210 | 90 46 53 211 | 71 29 83 212 | 72 24 15 213 | 79 66 84 214 | 95 33 1 215 | 28 94 14 216 | 67 78 45 217 | 9 59 92 218 | 8 74 50 219 | 81 40 45 220 | 84 32 34 221 | 60 43 76 222 | 96 53 81 223 | 67 72 8 224 | 58 15 64 225 | 40 22 48 226 | 82 34 89 227 | 60 97 19 228 | 24 88 54 229 | 32 77 34 230 | 14 7 62 231 | 24 53 17 232 | 36 97 20 233 | 51 4 78 234 | 7 22 93 235 | 61 97 87 236 | 3 41 24 237 | 1 98 90 238 | 29 18 60 239 | 78 18 57 240 | 37 31 58 241 | 53 0 83 242 | 69 18 49 243 | 2 53 16 244 | 9 73 14 245 | 32 86 75 246 | 65 74 3 247 | 73 57 95 248 | 84 70 77 249 | 60 3 92 250 | 88 79 11 251 | 69 30 97 252 | 8 0 35 253 | 25 8 84 254 | 3 46 16 255 | 0 5 48 256 | 76 44 45 257 | 94 24 20 258 | 41 92 11 259 | 23 45 69 260 | 56 14 46 261 | 26 23 34 262 | 33 44 54 263 | 52 12 93 264 | 45 32 99 265 | 37 86 58 266 | 92 54 97 267 | 51 82 59 268 | 66 16 27 269 | 1 28 32 270 | 65 75 92 271 | 29 76 17 272 | 56 16 84 273 | 57 88 44 274 | 93 26 80 275 | 10 14 13 276 | 71 32 89 277 | 95 37 56 278 | 64 52 59 279 | 55 16 4 280 | 56 9 48 281 | 52 5 26 282 | 61 77 62 283 | 49 100 75 284 | 65 76 33 285 | 39 31 79 286 | 18 93 44 287 | 80 19 5 288 | 30 94 9 289 | 94 36 83 290 | 15 15 67 291 | 88 10 49 292 | 93 81 31 293 | 18 6 18 294 | 84 81 62 295 | 82 38 44 296 | 91 47 1 297 | 67 76 75 298 | 84 29 4 299 | 7 16 37 300 | 80 94 68 301 | 78 44 92 302 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # 如何做出贡献 2 | 3 | 感谢您对 CarYon 的支持。如果您想要做出贡献,可以采用以下的方法之一。 4 | 5 | ## 提交 Issue 6 | 7 | 当您发现 CarYon 中存在的 Bug 或者您认为可以加入的实用功能的时候,可以提出 Issue 。 8 | 9 | 在您提出 Issue 时,请遵守以下的原则: 10 | 11 | 12 | - 请您使用中文、英语、德语或日语提出您的问题,其他语言我们可能无法理解。 13 | - Please post your Issues in Chinese, English, German or Japanese only. We may not be able to understand other languages. 14 | - Posten Sie Issues nur auf Chinesisch, Englisch, Deutsch oder Japanisch. Die anderen Sprachen können wir leider nicht verstehen. 15 | - 中国語、英語、ドイツ語または日本語でIssuesをお書きください。他の言語での場合においては理解できない可能性があります。 16 | - 在提出问题之前,请先查看是否有其他人提出过同样的问题。 17 | - 若是 Bug 反馈,请您写清问题的现象、复现方式、C++ 版本,最好能够附带上您编写的代码。 18 | - 若是功能请求,请您先确定 CarYon 没有类似功能。 19 | 20 | ## 提交 Pull Request 21 | 22 | 您也可以直接 Fork 代码后对不足之处进行改进。改进之后您可以提交 Pull Request ,请求将改进内容合并到主仓库。 23 | 24 | 在您提出 Pull Request 时,请遵守以下的原则: 25 | 26 | - 请确保您的代码规范清晰可读。 27 | 28 | - 请说明清您做了什么样的改进。 29 | 30 | 您提交代码的同时,即代表您愿意将您的代码以 ISC 协议并入 CarYon 项目。 31 | 32 | 如果您的代码被合并,可选择在光荣榜留名。 33 | 34 | --- 35 | 36 | # How to contribute 37 | 38 | Thank you for your support to CarYon. If you want to contribute, you can use one of the following methods. 39 | 40 | ## Submit Issue 41 | 42 | When you find bugs in CarYon or useful features that you think can be added, you can raise an issue. 43 | 44 | When you raise an issue, please observe the following principles: 45 | 46 | 47 | - Please ask your questions in Chinese, English, German or Japanese. We may not understand other languages. 48 | - Please post your Issues in Chinese, English, German or Japanese only. We may not be able to understand other languages. 49 | - Posten Sie Issues nur auf Chinesisch, Englisch, Deutsch oder Japanisch. Die anderen Sprachen können wir leider nicht verstehen. 50 | - Chinese, English, ドイツ语または日本語でIssuesをお書きください. He の言语での事件においては懂できない遊數があります。 51 | - Before asking a question, please check if anyone else has asked the same question. 52 | - If it is a bug feedback, please write down the symptom, recurrence method, and C++ version of the problem. It is best to attach the code you wrote. 53 | - If it is a feature request, please make sure that CarYon does not have similar features. 54 | 55 | ## Submit Pull Request 56 | 57 | You can also directly Fork the code and make improvements to the shortcomings. After the improvement, you can submit a Pull Request to request that the improvement content be merged into the main warehouse. 58 | 59 | When you submit a Pull Request, please observe the following principles: 60 | 61 | - Please make sure your code specifications are clear and readable. 62 | 63 | - Please explain what improvements you have made. 64 | 65 | When you submit the code, you are willing to incorporate your code into the CarYon project under the ISC agreement. 66 | 67 | If your code is merged, you can choose to stay on the Hall of Fame. 68 | 69 | --- 70 | 71 | # Как внести свой вклад 72 | 73 | Спасибо за вашу поддержку CarYon. Если вы хотите внести свой вклад, вы можете использовать один из следующих методов. 74 | 75 | ## Отправить вопрос 76 | 77 | Когда вы обнаружите ошибки в CarYon или полезные функции, которые, по вашему мнению, могут быть добавлены, вы можете поднять проблему. 78 | 79 | Когда вы поднимаете вопрос, соблюдайте следующие принципы: 80 | 81 | 82 | - Пожалуйста, задавайте свои вопросы на китайском, английском, немецком или японском языках. Мы можем не понимать другие языки. 83 | - Пожалуйста, опубликуйте ваши вопросы только на китайском, английском, немецком или японском языках. Возможно, мы не сможем понять другие языки. 84 | - Posten Sie Issues nur auf Chinesisch, английский, немецкий или японский язык. 85 | - Китайский, английский, ド イ ツ 语 ま た は 日本語 で Вопросы を お 書 き く だ さ い. Он の 言语 で の 事件 に お い て は 懂 で き な い 遊 が あ り ま す。 86 | - Перед тем, как задать вопрос, пожалуйста, проверьте, задавал ли кто-либо еще тот же вопрос. 87 | - Если это сообщение об ошибке, пожалуйста, запишите симптом, метод повторения и версию проблемы на C ++. Лучше всего приложить написанный вами код. 88 | - Если это запрос функции, убедитесь, что CarYon не имеет аналогичных функций. 89 | 90 | ## Отправить запрос на извлечение 91 | 92 | Вы также можете напрямую форкнуть код и внести исправления в недостатки. После улучшения вы можете отправить запрос на извлечение, чтобы запросить слияние содержимого улучшения в основной склад. 93 | 94 | Когда вы отправляете запрос на извлечение, соблюдайте следующие принципы: 95 | 96 | - Пожалуйста, убедитесь, что ваши спецификации кода понятны и читабельны. 97 | 98 | - Пожалуйста, объясните, какие улучшения вы сделали. 99 | 100 | Когда вы отправляете код, вы готовы включить его в проект CarYon в соответствии с соглашением ISC. 101 | 102 | Если ваш код объединен, вы можете остаться в Зале Славы. 103 | -------------------------------------------------------------------------------- /tools/configurstion-file-analysis/analysis.hpp: -------------------------------------------------------------------------------- 1 | #ifndef ANALYSIS_HPP 2 | #define ANALYSIS_HPP 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | struct _finddata_t info; 8 | ofstream fout("test.cpp"); 9 | std::string type; 10 | int start_d,end_d; 11 | int CNT,_CNT,if_cnt,for_cnt,tab_cnt; 12 | string _variable[10000]={""}; 13 | int _i=0; 14 | string maketab(){ 15 | clog<<"[CHECKER] Checking how many space(s) will be used.\n"; 16 | string temp; 17 | temp=" "; 18 | tab_cnt=if_cnt+for_cnt; 19 | int i; 20 | for(i=0;i='a' and type[0]<='z')or(type[0]>='A' and type[0]<='Z')or(type[0]=='_')or(type[0]=='$'))){ 131 | return false; 132 | } 133 | for(int i=1;i='a' and type[i]<='z')or(type[i]>='A' and type[i]<='Z')or(type[i]=='_')or(type[i]=='$')or(type[i]>='0' and type[i]<='9'))){ 135 | clog<<"[CHECKER] "< 大陆简体](README.md) [US English](README.en-us.md) **RU Русский** 6 | 7 | # Предисловие 8 | 9 | ## Для чего это? 10 | 11 | При проведении своего собственного конкурса OI, вы столкнулись со следующими проблемами 12 | 13 | - Хотите быстро сгенерировать абзац текста? 14 | - Хотите быстро выполнить математические операции для генерации данных? 15 | - Хотите генерировать тестовые данные по очереди, не дожидаясь freopen? 16 | - Хотите сгенерировать набор случайных данных или рядов? 17 | - Быстро генерировать данные для соответствия двум программам? 18 | 19 | Затем вы можете использовать CarYon и C++ для быстрой генерации данных. В настоящее время поддерживаются следующие функции: 20 | 21 | - Случайно генерировать абзац, несколько слов, несколько букв 22 | - Без ограничений RAND_MAX, свободно составлять случайные числа 23 | Разрабатываемая математическая библиотека поддерживает несколько функций 24 | - Создайте несколько кругов, правильных многоугольников и дробей и используйте их для расчетов 25 | 26 | ------ 27 | 28 | **Выполните test.cpp для создания надежных данных в течение 1 минуты** 29 | 30 | Я надеюсь, что вы все можете помочь улучшить этот проект. Надеюсь, что этот проект поможет всем сэкономить время! 31 | 32 | ## что-то не так? 33 | 34 | Перейдите в репозиторий Github, чтобы опубликовать вопрос, чтобы задать вопросы, и вы можете опубликовать эту статью. 35 | 36 | Мой номер Луогу: luosw 37 | 38 | # Инструкции по использованию 39 | 40 | ## Как установить? 41 | 42 | ### установка npm (стабильная версия) 43 | 44 | Вы можете перейти в репозиторий GitHub, чтобы загрузить последнюю версию, ссылка находится в следующем заголовке, и ее также можно использовать с установленным node-js: 45 | 46 | ```sh 47 | $ npm install datamaker-caryon --save 48 | ``` 49 | 50 | Установите стабильную версию этого генератора данных. 51 | 52 | ### GitHub репозиторий (последняя версия) 53 | 54 | https://github.com/luosiwei-cmd/caryon 55 | 56 | Пожалуйста, не забудьте пометить ~ 57 | 58 | ### exe установка (стабильная версия) 59 | 60 | 61 | Посетите http://luosw.fun/caryon/caryon-setup.exe, чтобы загрузить установочный пакет, запустить установочный пакет, в установочном каталоге (по умолчанию C: // Program Files (x86) / CarYon) вы можете найти соответствующий `caryon.h` файл. 62 | 63 | ## Генерация данных 64 | 65 | Следующие основные операции должны включать файл заголовка `caryon.h`. Обратите внимание, что папка каталога программы должна содержать файл` caryon.h.gch`, сгенерированный после того, как файл заголовка скомпилирован перед использованием генератора данных. 66 | 67 | ```cpp 68 | makein (1,10) { 69 | csh(); 70 | ххххх; 71 | } 72 | ``` 73 | 74 | Эта операция используется для генерации файла: `1.in-10.in`, вы можете свободно изменять два параметра` makein` для замены. Например, `makein (3,5)` сгенерирует `3.in-5.in`. 75 | 76 | Когда мы выполним `test.cpp`, мы обнаружим, что в корневом каталоге есть дополнительная папка, которая содержит файлы из` 1.in ~ 10.in`, что является результатом изготовления. 77 | 78 | `csh();` Команда не должна быть изменена или заменена! 79 | 80 | Последующий: 81 | 82 | ```cpp 83 | dataname = ""; 84 | ``` 85 | 86 | Это необходимо для заполнения префикса, такого как следующая программа: 87 | 88 | ```cpp 89 | #include "caryon.h" 90 | using namespace std; 91 | using namespace ca; 92 | int main () { 93 | dataname = "chen_zhe-ак-ioi"; 94 | makein (1,10) { 95 | csh(); 96 | ххх; 97 | } 98 | } 99 | ``` 100 | 101 | Он сгенерирует `chen_zhe-ak-ioi1.in ~ chen_zhe-ak-ioi10.in` в папке` data-chen_zhe-ak-ioi` в корневом каталоге. 102 | 103 | **Обратите внимание, что из-за новой версии пробелы не могут появляться в поле `dataname`! ! ** 104 | 105 | После того, как все наши вещи сделаны, не забудьте использовать 106 | 107 | ```cpp 108 | closefile (); 109 | ``` 110 | 111 | Функция для освобождения места в памяти. (Эффект похож на fclose, вам не нужно его писать) 112 | 113 | Мы научились создавать в файлах, как создавать соответствующие файлы? Давайте обогатим предыдущий пример: 114 | 115 | ```cpp 116 | #include "caryon.h" 117 | using namespace std; 118 | using namespace ca; 119 | int main () { 120 | dataname = "chen_zhe-ак-ioi"; 121 | makein (1,10) { 122 | csh(); 123 | ххх; 124 | } 125 | makeout (1,10); 126 | } 127 | ``` 128 | 129 | В это время в каталоге, где находится `test.cpp`, должен быть файл` std.exe`, который обычно называют стандартной программой. Обратите внимание, что стандартной программой должен быть скомпилированный файл `std.exe`, прежде чем можно будет создать соответствующий файл out. 130 | 131 | Давайте создадим случайное число ниже: 132 | 133 | ```cpp 134 | cyrand (а, b); 135 | ``` 136 | 137 | Его функция - возвращать случайное число между `a` и` b`. 138 | 139 | MT19337 (или метод вращения Мейсона), используемый этим случайным числом, преодолевает ограничение RAND_MAX, которое поставляется с C ++. 140 | 141 | (Если вы хотите сгенерировать случайное число в диапазоне «long long», используйте `cyrand_ll ()`). 142 | 143 | Давайте посмотрим, как хранить целочисленные переменные во входном файле: 144 | 145 | ```cpp 146 | inint (); 147 | instring (""); 148 | ``` 149 | 150 | Обе эти функции используются для ввода данных в файл `in`. Если мы хотим ввести случайное число, мы пишем: 151 | 152 | ```cpp 153 | inint (cyrand ()); 154 | ``` 155 | 156 | Вот и все. 157 | 158 | Например, следующая программа: 159 | 160 | ```cpp 161 | #include "caryon.h" 162 | using namespace std; 163 | using namespace ca; 164 | int main () { 165 | dataname = "test"; 166 | makein (1,10) { 167 | csh(); 168 | inint (cyrand (0100)); 169 | } 170 | } 171 | ``` 172 | 173 | Вы найдете файл test1.in-test10.in в папке data-test в каталоге. Откройте эти файлы с помощью Блокнота, и вы найдете случайное число в каждом файле. 174 | 175 | Если вы не знаете, как открыть файл `in` и файл` out` с помощью Блокнота, щелкните правой кнопкой мыши файл и выберите Открыть метод, чтобы найти свой Блокнот. Или вы можете использовать Dev-C ++, открыть программное обеспечение и перетащить в него файл `in`. 176 | 177 | Для этой программы, если мы напишем `std.cpp` так: 178 | 179 | ```cpp 180 | #include 181 | using namespace std; 182 | int main () { 183 | int a; 184 | cin >> а; 185 | cout << а + 10; 186 | return 0; 187 | } 188 | ``` 189 | 190 | После компиляции измените `test.cpp` на: 191 | 192 | ```cpp 193 | #include "caryon.h" 194 | using namespace std; 195 | using namespace ca; 196 | int main () { 197 | dataname = "test"; 198 | makein (1,10) { 199 | csh(); 200 | inint (cyrand (0100)); 201 | } 202 | makeout (1,10); 203 | } 204 | ``` 205 | 206 | Затем используйте Блокнот, чтобы открыть файлы `in` и` out` соответственно, и вы можете обнаружить, что это результат добавления $ 10 $ к числу каждого файла `in`. 207 | 208 | Благодаря поддержке функций новой версии, при создании файла будет отображаться подсказка, поэтому вам не нужно беспокоиться о том, какой черный ящик продолжает прыгать и прыгать! 209 | 210 | Так работает весь генератор данных. 211 | 212 | Мы также можем генерировать много случайных вещей, таких как: 213 | 214 | ```cpp 215 | cyrand_bool (); // Случайное логическое значение 216 | cyrand_engs (); // Случайные английские строчные буквы 217 | cyrand_engb (); // Случайные английские заглавные буквы 218 | cyrand_formatc (); // случайный escape-символ 219 | cyrand_word (a); // Случайное слово длины a 220 | cyrand_article (a); // Случайный абзац со словарем 221 | cyrand_letter (); // Случайные символы 222 | ``` 223 | ### Функция инструмента 224 | 225 | Для нужд генерации данных CarYon предоставляет несколько простых инструментальных функций. 226 | 227 | 1. Функция choice: 228 | 229 | Параметр представляет собой массив, начальный индекс и конечный индекс. 230 | 231 | В конце концов, будет возвращено случайное значение между двумя индексами этого массива. 232 | 233 | Например: 234 | 235 | ```cpp 236 | choice(а,1,10); 237 | ``` 238 | 239 | 2. Функция doubleRandom: 240 | 241 | Возвращает число с плавающей запятой от 0 до 1. 242 | 243 | Например: 244 | 245 | ```cpp 246 | doubleRandom (); 247 | ``` 248 | Эти вещи можно использовать, чтобы представить себе DIY и достичь желаемого эффекта. 249 | 250 | ### Обычно используемые константы 251 | 252 | CarYon предоставляет некоторые часто используемые константы. 253 | 254 | `PI` 255 | 256 | Это значение пи. `3.1415926...` 257 | 258 | `E` 259 | 260 | Ценность природной базы. `2.7182818...` 261 | 262 | `ALPHABET_SMALL` 263 | 264 | Строка, содержащая все строчные буквы. "`abcdefghijklmnopqrstuvwxyz`". 265 | 266 | `ALPHABET_CAPITAL` 267 | 268 | Строка, содержащая все заглавные буквы. "`ABCDEFGHIJKLMNOPQRSTUVWXYZ`". 269 | 270 | `ALPHABET` 271 | 272 | Строка, содержащая все буквы. "`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`". 273 | 274 | `NUMBERS` 275 | 276 | Строка, содержащая все числа. "`0123456789`". 277 | 278 | ## Соответствие программы 279 | 280 | В ходе конкурса для проверки правильности алгоритма низкой сложности мы обычно используем другой алгоритм низкого уровня для решения той же проблемы, а затем используем большую выборку для сравнения сгенерированных результатов двух программ. 281 | 282 | Теперь CarYon наконец-то поддерживает функцию съемки! ! ! 283 | 284 | Соответствие программы можно условно разделить на следующие этапы: 285 | 286 | 1. Напишите `myprogram.cpp` в текущем каталоге и скомпилируйте его в файл` myprogram.exe`; 287 | 2. Напишите `test.cpp` и` std.cpp` в соответствии с модулем генерации данных; 288 | 3. Добавьте строку после `test.cpp`: 289 | 290 | ```cpp 291 | debug(/ * начало * /, / * конец * /); 292 | ``` 293 | 294 | Например, вы уверенно отправляете свои высокоточные a + b. В настоящее время вам необходимо сопоставить вашу программу с низкими значениями точности. 295 | 296 | Сначала поместите следующую высокоточную версию a + b в ваш `myprogram.cpp` и скомпилируйте ее в `myprogram.exe`: 297 | 298 | ```cpp 299 | #include 300 | #include 301 | using namespace std; 302 | int main() 303 | { 304 | string a,b; 305 | int xa[500]={},xb[500]={},tot[500]={}; 306 | cin>>a>>b; 307 | for(int i=0;i=0;i--) 321 | cout< 大陆简体](README.md) **US English** [RU Русский](README.ru.md) 8 | 9 | # Front 10 | 11 | Have you ever encountered the following problems when holding a self-contained OI match: 12 | 13 | - Want to quickly produce a paragraph of text? 14 | - Want to quickly perform mathematical operations to generate data? 15 | - Want to generate test data one by one without using freopen? 16 | - Want to generate a set of random data or series? 17 | - Quickly generate data to match the two programs? 18 | 19 | Then, you can use CarYon and C++ to quickly generate data. Previously supported features are: 20 | 21 | - Randomly generate a chapter, some words, some words 22 | - Get out of the limitation of RAND_MAX, freely draft random numbers 23 | - Mathematics library under development, supporting multiple features 24 | - Create some circles, regular polygons and fractions, and use it to perform calculations 25 | 26 | ------ 27 | 28 | Perform **test.cpp** in real **1** within minutes to have the intensity data 29 | 30 | Hope you guys can help improve this project. Hope this item can help everyone save time! 31 | 32 | ## Something wrong? 33 | 34 | You are welcome to send an issue to the Github repository to ask questions, and you are also welcome to post in this chapter. 35 | 36 | # Instructions for use 37 | 38 | ## How to install? 39 | 40 | ### **npm** installation (stable version) 41 | 42 | You can go to the GitHub repository to download the latest version, the link is in the next title, and it can also be used with node-js installed: 43 | 44 | ```shell 45 | $ npm install datamaker-caryon --save 46 | ``` 47 | 48 | nstall the stable version of this data generator. 49 | 50 | ### **GitHub** repository (latest version) 51 | 52 | https://github.com/luosiwei-cmd/caryon 53 | 54 | Everyone, remember to star~ 55 | 56 | ### **exe** installation (stable version) 57 | 58 | Visit **[http://luosw.fun/caryon/caryon-setup.exe to](https://translate.google.com/translate?hl=zh-CN&prev=_t&sl=auto&tl=en&u=http://luosw.fun/caryon/caryon-setup.exe)** download the installation package, run the installation package, in the installation directory (the default isC://Program Files(x86)/CarYon) can find the corresponding `caryon.h` file. 59 | 60 | ## Data generation 61 | 62 | The basic operations below are to include the header file `caryon.h` . Note that the header file must be included in the program’s directory folder after being compiled 63 | 64 | Only the `caryon.h.gch` file produced later can the data generator be used. 65 | 66 | ```cpp 67 | makein(1,10){ 68 | csh(); 69 | xxxxx; 70 | } 71 | ``` 72 | 73 | This operation is used to create files: `1. In-10.in` , you can freely change the two parameters of `makein` for replacement. E.g`makein(3,5)` is to produce `3.in-5.in` .When we finish `test.cpp` , we will find that there is an extra folder in the root directory. There are files from `1.in to 10.in`. This isIs the result of manufacturing 74 | 75 | `csh();`The command must not be changed or replaced! 76 | 77 | Here: 78 | 79 | ```cpp 80 | dataname=""; 81 | ``` 82 | 83 | This is to fill in the prefix, such as the following program: 84 | 85 | ```cpp 86 | #include"caryon.h" 87 | using namespace std; 88 | using namespace ca; 89 | int main(){ 90 | dataname="chen_zhe-ak-ioi"; 91 | makein(1,10){ 92 | csh(); 93 | xxx; 94 | } 95 | } 96 | ``` 97 | 98 | It will be created in the folder `data-chen_zhe-ak- ioi` of the root directory into `chen_zhe-ak-ioi1.in~chen_zhe-ak-ioi10.in` . 99 | 100 | Note that due to the new version, no spaces can appear in the dataname field! ! ! 101 | 102 | After all our things are done, remember to us 103 | 104 | ```cpp 105 | closefile(); 106 | ``` 107 | 108 | Function to free up memory space. (The effect is similar to fclose, you don’t need to write it) 109 | 110 | We have learned to create` in` files, how to create corresponding` out `files? Let's enrich the previous examples: 111 | 112 | ```cpp 113 | #include"caryon.h" 114 | using namespace std; 115 | using namespace ca; 116 | int main(){ 117 | dataname="chen_zhe-ak-ioi"; 118 | makein(1,10){ 119 | csh(); 120 | xxx; 121 | } 122 | makeout(1,10); 123 | } 124 | ``` 125 | 126 | At this time, there must be a `std.exe` file in the directory where `test.cpp` is located , which is commonly known as a standard program. Note that it must be the standard. 127 | 128 | After the program is compiled, the `std.exe` file can produce the corresponding out file. 129 | 130 | Let's create a random number below: 131 | 132 | ```cpp 133 | cyrand(a,b); 134 | ``` 135 | 136 | Its function is to return a random number between `a` and `b` . 137 | 138 | The MT19337 (or Mason rotation method) used by this random number breaks through the limitation of C++'s native RAND_MAX. 139 | 140 | (If you want to generate a random number in the `long long` range, use `cyrand_ll()`). 141 | 142 | Let's take a look at how to store integer variables in the input file: 143 | 144 | ```cpp 145 | inint(a); 146 | instring(b); 147 | ``` 148 | 149 | Both of these functions are used to input things into the `in` file. If we want to input a random number, we write: 150 | 151 | ```cpp 152 | inint(cyrand()); 153 | ``` 154 | 155 | That's it. 156 | 157 | For Example: 158 | 159 | ```cpp 160 | #include"caryon.h" 161 | using namespace std; 162 | using namespace ca; 163 | int main(){ 164 | dataname="test"; 165 | makein(1,10){ 166 | csh(); 167 | inint(cyrand(0,100)); 168 | } 169 | } 170 | ``` 171 | 172 | Of Contents will find in the data-test folder in the display will appear `test1.in-test10.in` files, Using Notepad to open these files, 173 | 174 | You will find that every file has a random number. 175 | 176 | If you don’t know how to use Notepad to open `in` files and `out` files, please right-click the file, click Open Mode, and find your note 177 | 178 | this. Or you can use Dev-C++, open the software, and drag the `in` file into it. 179 | 180 | For this program, if we write `std.cpp` like this : 181 | 182 | ```cpp 183 | #include 184 | using namespace std; 185 | int main(){ 186 | int a; 187 | cin>>a; 188 | cout< //No need to write this line 239 | graph example; 240 | ``` 241 | 242 | This generates a graph with edge weight type T. 243 | 244 | #### Join the edge 245 | 246 | To add edges to the generated graph, you need: 247 | 248 | ```cpp 249 | example.addedge(/*start*/,/*end*/,cyrand(/*min*/,/*max*/)) 250 | ``` 251 | 252 | #### Make a random graph 253 | 254 | ```cpp 255 | rand_graph(n,m,min,max,randfunc); 256 | ``` 257 | 258 | It can return a random graph with `n `points`m` edges and side weights between `min` and `max`. 259 | 260 | If you want to assign a value to the generated graph, directly: 261 | 262 | ```cpp 263 | example=rand_graph(n,m,min,max); 264 | ``` 265 | 266 | #### Graph class member functions 267 | 268 | Here are some useful functions: 269 | 270 | ```cpp 271 | example.is_connect(); 272 | ``` 273 | 274 | This function returns a Boolean value, which represents whether the graph is connected. 275 | 276 | ```cpp 277 | example.output(); 278 | ``` 279 | 280 | Output this graph. 281 | 282 | ```cpp 283 | example=rand_dag(n,m,min,max,randfunc); 284 | ``` 285 | 286 | Returns a directed acyclic graph. 287 | 288 | ```cpp 289 | example=rand_tree(n,k,min,max,randfunc); 290 | ``` 291 | 292 | Return a k-ary tree with n points. 293 | 294 | ```cpp 295 | example=connect_graph(n,m,min,max,randfunc); 296 | ``` 297 | 298 | Make a random connected graph. 299 | 300 | ### Tool function 301 | 302 | For the needs of data generation, CarYon provides some simple tool functions. 303 | 304 | 1. The choice function: 305 | 306 | The parameter is an array, a starting index, and a ending index. 307 | 308 | Eventually, a random value between the two subscripts of this array will be returned. 309 | 310 | E.g: 311 | 312 | ```cpp 313 | choice(a,1,10); 314 | ``` 315 | 316 | 2. The doubleRandom function: 317 | 318 | Returns a floating point number between 0 and 1. 319 | 320 | E.g: 321 | 322 | ```cpp 323 | doubleRandom(); 324 | ``` 325 | ### Commonly used constants 326 | 327 | CarYon provides some commonly used constants. 328 | 329 | `PI` 330 | 331 | That is the value of pi. `3.1415926...` 332 | 333 | `E` 334 | 335 | The value of the natural base. `2.7182818...` 336 | 337 | `ALPHABET_SMALL` 338 | 339 | A string containing all lowercase letters. "`abcdefghijklmnopqrstuvwxyz`". 340 | 341 | `ALPHABET_CAPITAL` 342 | 343 | A string containing all capital letters. "`ABCDEFGHIJKLMNOPQRSTUVWXYZ`". 344 | 345 | `ALPHABET` 346 | 347 | A string containing all letters. "`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`". 348 | 349 | `NUMBERS` 350 | 351 | A string containing all numbers. "`0123456789`". 352 | 353 | There is also a math library. 354 | 355 | ## Program match 356 | 357 | In the course of the competition, in order to check whether the algorithm with low complexity is correct, it is usually used to compile a low-level algorithm to solve the same problem. 358 | 359 | Then use a large sample at the same time to shoot the results of these two programs. 360 | 361 | Now CarYon finally supports the camera-matching function! ! ! 362 | 363 | The matching of the program can be divided into the following steps: 364 | 365 | 1. Write `myprogram.cpp` in the current directory and compile it into a `myprogram.exe` file; 366 | 2. Write `test.cpp `and `std.cpp` according to the data generation module ; 367 | 3. Add a line after`test.cpp`: 368 | 369 | ```cpp 370 | debug(/*start*/,/*end*/); 371 | ``` 372 | 373 | For example, if you are confidently submitting the high-precision a+b, you need to use low-precision values to match your program. 374 | 375 | First, put the following high-precision version a+b into your `myprogram.cpp` and compile it into `myprogram.exe` : 376 | 377 | ```cpp 378 | #include 379 | #include 380 | using namespace std; 381 | int main() 382 | { 383 | string a,b; 384 | int xa[500]={},xb[500]={},tot[500]={}; 385 | cin>>a>>b; 386 | for(int i=0;i=0;i--) 400 | cout< 5 | #endif 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #if __cplusplus >= 201103L 24 | # include 25 | # include 26 | # include 27 | # include 28 | # include 29 | # include 30 | # include 31 | # include 32 | # include 33 | #endif 34 | 35 | // C++ 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | #include 57 | #include 58 | #include 59 | #include 60 | #include 61 | #include 62 | #include 63 | #include 64 | #include 65 | #include 66 | #include 67 | #include 68 | 69 | #if __cplusplus >= 201103L 70 | # include 71 | # include 72 | # include 73 | # include 74 | # include 75 | # include 76 | # include 77 | # include 78 | # include 79 | # include 80 | # include 81 | # include 82 | # include 83 | # include 84 | # include 85 | # include 86 | # include 87 | # include 88 | # include 89 | #endif 90 | #define makein(m, n) for (__ci = m; __ci <= n; __ci++) 91 | #define fs(i, x, y, z) for (long long i = x; i <= y; i += z) 92 | #define ft(i, x, y, z) for (long long i = x; i >= y; i += z) 93 | #ifndef CarYon 94 | # define CarYon 3.7 95 | #endif 96 | std::string dataname; 97 | int cprime[1000000]; 98 | int __ci; 99 | int __cnt; 100 | const int __N = 151, __moda = 1000000007; 101 | int maxtime = 1000; 102 | long double runtime; 103 | bool ___flag = false; 104 | void csh() { 105 | __cnt = 0; 106 | } 107 | int cgcd(int a, int b) { 108 | int t = 1; 109 | while (t != 0) { 110 | t = a % b; 111 | a = b; 112 | b = t; 113 | } 114 | return a; 115 | } 116 | template < typename T1, typename T2 > 117 | void ms(T1* a, T2 b) { 118 | memset(a, b, sizeof(a)); 119 | } 120 | template < typename T > 121 | int sz(T* a) { 122 | return sizeof(a); 123 | } 124 | int lcm(int x, int y) { 125 | return x / cgcd(x, y) * y; 126 | } 127 | std::stringstream sp; 128 | namespace crand { 129 | bool isInit; 130 | int MTindex; 131 | long long MT[624]; 132 | void csrand(int seed) { 133 | MTindex = 0; 134 | isInit = 1; 135 | MT[0] = seed; 136 | for (int i = 1; i < 624; i++) { 137 | int t = 1812433253 * (MT[i - 1] ^ (MT[i - 1] >> 30)) + i; 138 | MT[i] = t & 0xffffffff; 139 | } 140 | } 141 | inline void generate() { 142 | for (int i = 0; i < 624; i++) { 143 | long long y = (MT[i] & 0x80000000) + (MT[(i + 1) % 624] & 0x7fffffff); 144 | MT[i] = MT[(i + 397) % 624] ^ (y >> 1); 145 | if (y % 2 == 1) 146 | MT[i] ^= 2147483647; 147 | } 148 | } 149 | inline int cyrand() { 150 | if (!isInit) 151 | #if __cplusplus <= 201103L 152 | csrand((int)time(NULL)); 153 | #else 154 | csrand((int)time(nullptr)); 155 | #endif 156 | if (MTindex == 0) 157 | generate(); 158 | int y = MT[MTindex]; 159 | y = y ^ (y >> 11); 160 | y = y ^ ((y << 7) & 1636928640); 161 | y = y ^ ((y << 15) & 1022730752); 162 | y = y ^ (y >> 18); 163 | MTindex = (MTindex + 1) % 624; 164 | return y; 165 | } 166 | inline long long cyrand_ll() { 167 | return ((long long)(cyrand()) << 31) + cyrand(); 168 | } 169 | inline int cyrand(int a, int b) { 170 | if (a > b) 171 | a = b; 172 | if (a == b) 173 | return a; 174 | else 175 | return cyrand() % (b - a + 1) + a; 176 | } 177 | inline long long cyrand_ll(long long a, long long b) { 178 | if (a > b) 179 | a = b; 180 | if (a == b) 181 | return a; 182 | else 183 | return cyrand_ll() % (b - a + 1) + a; 184 | } 185 | inline bool cyrand_bool() { 186 | if (cyrand(0, 1) == 0) 187 | return false; 188 | else 189 | return true; 190 | } 191 | inline char cyrand_letter() { 192 | return cyrand(32, 126); 193 | } 194 | inline char cyrand_engs() { 195 | return 'a' + cyrand(0, 26); 196 | } 197 | inline char cyrand_engb() { 198 | return 'A' + cyrand(0, 26); 199 | } 200 | inline char cyrand_fomatc() { 201 | switch (cyrand(0, 4)) { 202 | case 0: { 203 | return '\n'; 204 | break; 205 | } 206 | case 1: { 207 | return '\t'; 208 | break; 209 | } 210 | case 2: { 211 | return '\r'; 212 | break; 213 | } 214 | case 3: { 215 | return '\v'; 216 | break; 217 | } 218 | case 4: { 219 | return '\f'; 220 | break; 221 | } 222 | } 223 | } 224 | inline std::string cyrand_word(int a) { 225 | std::string chen_zhe; 226 | for (int kkksc03 = 0; kkksc03 < a; kkksc03++) { 227 | char t=cyrand_engs(); 228 | chen_zhe += t; 229 | } 230 | return chen_zhe; 231 | } 232 | inline std::string cyrand_article(int a) { 233 | std::string soha; 234 | soha = cyrand_word(cyrand(1, 10)); 235 | for (int lzn = 1; lzn < a; lzn++) { 236 | soha = soha + " " + cyrand_word(cyrand(1, 10)); 237 | } 238 | return soha; 239 | } 240 | template < typename T > 241 | inline T choice(T* a, int lbound, int ubound) { 242 | return a[cyrand(lbound, ubound)]; 243 | } 244 | inline double doubleRandom() { 245 | srand(time(0)); 246 | return (double)(rand() / (double)RAND_MAX); 247 | } 248 | void RandomP(int* arr,int size){ 249 | for(int i=0;i tmp) { 269 | return false; 270 | } 271 | } 272 | else if (flag == 2) { 273 | if (arr[i] < tmp) { 274 | return false; 275 | } 276 | } 277 | else if (flag == 3) { 278 | if (arr[i] >= tmp) { 279 | return false; 280 | } 281 | } 282 | else if (flag == 4) { 283 | if (arr[i] <= tmp) { 284 | return false; 285 | } 286 | } 287 | } 288 | return true; 289 | } 290 | inline void randomArr(int* arr, int n, int lower, int upper, int flag) { 291 | for (int i = 0; i < n;) { 292 | int tmp = cyrand(lower, upper); 293 | if (__checktmp(arr, tmp, flag, i - 1)) { 294 | arr[i++] = tmp; 295 | } 296 | } 297 | } 298 | } // namespace crand 299 | namespace cgraph { 300 | template < typename T > 301 | struct edge { 302 | int v; 303 | T w; 304 | bool operator<(const edge& rw) const // priority_queue 305 | { 306 | return w > rw.w; 307 | } 308 | }; 309 | template < typename T > 310 | struct U { 311 | std::vector< edge< T > > u; 312 | }; 313 | template < typename T > 314 | struct graph { // graph 315 | int n, m; 316 | std::vector< U< T > > g; 317 | graph() { 318 | ; 319 | } 320 | 321 | void update(int ntemp) { 322 | U< T > updatemp; 323 | updatemp.u.clear(); 324 | while (g.size() <= ntemp) 325 | g.push_back(updatemp); 326 | } 327 | int ccmax(int a, int b) { 328 | if (a > b) 329 | return a; 330 | else 331 | return b; 332 | } 333 | void addedge(int u, int v, T w) { 334 | n = ccmax(n, u); 335 | n = ccmax(n, v); 336 | update(ccmax(u, v)); 337 | m++; 338 | edge< T > tmp; 339 | tmp.v = v, tmp.w = w; 340 | g[u].u.push_back(tmp); 341 | } 342 | bool is_connect() { 343 | const int vstsize = n + 1; 344 | int vstn = 0; 345 | bool vst[vstsize]; 346 | memset(vst, false, sizeof(vst)); 347 | std::queue< int > q; 348 | int begin = crand::cyrand(1, n); 349 | vst[begin] = true; 350 | vstn = 1; 351 | q.push(begin); 352 | while (!q.empty()) { 353 | int tmp = q.front(); 354 | q.pop(); 355 | for (int i = 0; i < g[tmp].u.size(); i++) { 356 | if (!vst[g[tmp].u[i].v]) { 357 | vst[g[tmp].u[i].v] = true; 358 | vstn++; 359 | q.push(g[tmp].u[i].v); 360 | } 361 | } 362 | } 363 | return ((vstn == n) ? true : false); 364 | } 365 | void output(graph< T > c) { 366 | std::cout << c; 367 | } 368 | }; 369 | template < typename T > 370 | std::ostream& operator<<(std::ostream& os, const graph< T >& c) { 371 | os << c.n << ' ' << c.m << '\n'; 372 | for (int i = 1; i <= c.n; i++) { 373 | for (int j = 0; j < c.g[i].u.size(); j++) 374 | os << i << ' ' << c.g[i].u[j].v << ' ' << c.g[i].u[j].w << '\n'; 375 | } 376 | return os; 377 | } 378 | template < typename T > 379 | graph< T > operator+(graph< T > a, graph< T > b) { 380 | graph< T > ret; 381 | ret = a; 382 | ret.m = a.m + b.m; 383 | ret.update(ret.n); 384 | for (int i = 1; i <= b.n; i++) { 385 | for (int j = 0; j < b.g[i].u.size(); j++) { 386 | ret.g[i].u.push_back(b.g[i].u[j]); 387 | } 388 | } 389 | return ret; 390 | } 391 | 392 | template < typename T > 393 | graph< T > rand_graph(int n, int m, T mn, T mx, T (*randfunc)(T, T)) { 394 | graph< T > ret; 395 | ret.n = n; 396 | ret.m = m; 397 | 398 | ret.update(n); 399 | 400 | for (int i = 1; i <= m; i++) { 401 | edge< T > tmp; 402 | tmp.v = crand::cyrand(1, m); 403 | tmp.w = randfunc(mn, mx); 404 | ret.g[crand::cyrand(1, n)].u.push_back(tmp); 405 | } 406 | return ret; 407 | } 408 | 409 | struct caryon_node2 { 410 | int num, id1, id2; 411 | }; 412 | 413 | bool crayon_cmp1(caryon_node2 a, caryon_node2 b) { 414 | return a.num < b.num; 415 | } 416 | 417 | template < typename T > 418 | graph< T > rand_dag(int n, int m, T mn, T mx, T (*randfunc)(T, T)) { 419 | graph< T > ret; 420 | ret.update(n); 421 | ret.n = n; 422 | ret.m = m; 423 | for (int i = 1; i <= m; i++) { 424 | edge< T > tmp; 425 | int utmp = crand::cyrand(1, crand::cyrand(1, n - 1)); 426 | tmp.v = crand::cyrand(utmp + 1, n); 427 | tmp.w = randfunc(mn, mx); 428 | ret.g[utmp].u.push_back(tmp); 429 | } 430 | return ret; 431 | } 432 | 433 | struct caryon_node1 { 434 | int id; 435 | int soncnt; 436 | }; 437 | 438 | template < typename T > 439 | graph< T > rand_tree(int n, int k, T mn, T mx, T (*randfunc)(T, T)) { 440 | graph< T > ret; 441 | ret.n = n; 442 | ret.m = n - 1; 443 | ret.update(n); 444 | std::vector< caryon_node1 > t; 445 | std::vector< int > hash; 446 | for (int i = 1; i <= n; i++) { 447 | hash.push_back(i); 448 | } 449 | random_shuffle(hash.begin(), hash.end()); 450 | caryon_node1 updatemp; 451 | updatemp.id = hash[0]; 452 | updatemp.soncnt = 0; 453 | t.push_back(updatemp); 454 | for (int j = 2; j <= n; j++) { 455 | int i = hash[j - 1]; 456 | std::swap(t[crand::cyrand(0, t.size() - 1)], t[t.size() - 1]); 457 | t[t.size() - 1].soncnt++; 458 | if (t[t.size() - 1].soncnt == k) 459 | t.pop_back(); 460 | edge< T > tmp; 461 | tmp.v = t[t.size() - 1].id; 462 | tmp.w = randfunc(mn, mx); 463 | ret.g[i].u.push_back(tmp); 464 | updatemp.id = i; 465 | updatemp.soncnt = 0; 466 | t.push_back(updatemp); 467 | } 468 | return ret; 469 | } 470 | 471 | template < typename T > 472 | graph< T > connect_graph(int n, int m, T mn, T mx, T (*randfunc)(T, T)) { 473 | int k = crand::cyrand(1, n); 474 | graph< T > ret; 475 | do { 476 | ret = rand_graph(n, m, mn, mx, crand::cyrand); 477 | } while (!ret.isconnect()); 478 | } 479 | } // namespace cgraph 480 | namespace inout { 481 | inline void inint(int a) { 482 | std::string c, ccci, tnmp; 483 | std::stringstream ss, cci; 484 | if (__cnt == 0) { 485 | if (!___flag) { 486 | std::string a666 = "mkdir data-" + dataname; 487 | system(a666.c_str()); 488 | ___flag = true; 489 | } 490 | cci << __ci; 491 | cci >> ccci; 492 | std::string name = "data-" + dataname + "./" + dataname + ccci + ".in"; 493 | freopen(name.c_str(), "w", stdout); 494 | freopen(name.c_str(), "r", stdin); 495 | } 496 | ss << a; 497 | ss >> c; 498 | std::cin >> tnmp; 499 | c = tnmp + c; 500 | std::cout << c; 501 | ++__cnt; 502 | } 503 | inline void instring(std::string a) { 504 | std::string ccci, tnmp; 505 | if (__cnt == 0) { 506 | if (!___flag) { 507 | std::string a666 = "mkdir data-" + dataname; 508 | system(a666.c_str()); 509 | ___flag = true; 510 | } 511 | std::stringstream cci; 512 | cci << __ci; 513 | cci >> ccci; 514 | std::string name = "data-" + dataname + "./" + dataname + ccci + ".in"; 515 | freopen(name.c_str(), "w", stdout); 516 | freopen(name.c_str(), "r", stdin); 517 | } 518 | std::cin >> tnmp; 519 | a = tnmp + a; 520 | std::cout << a; 521 | ++__cnt; 522 | } 523 | template < typename T > 524 | inline void ingraph(cgraph::graph< T > a) { 525 | std::string ccci, tnmp; 526 | if (__cnt == 0) { 527 | if (!___flag) { 528 | std::string a666 = "mkdir data-" + dataname; 529 | system(a666.c_str()); 530 | ___flag = true; 531 | } 532 | std::stringstream cci; 533 | cci << __ci; 534 | cci >> ccci; 535 | std::string name = "data-" + dataname + "./" + dataname + ccci + ".in"; 536 | freopen(name.c_str(), "w", stdout); 537 | freopen(name.c_str(), "r", stdin); 538 | } 539 | a.output(a); 540 | ++__cnt; 541 | } 542 | template < typename T > 543 | inline void in(T a) { 544 | std::string c, ccci, tnmp; 545 | std::stringstream ss, cci; 546 | if (__cnt == 0) { 547 | if (!___flag) { 548 | std::string a666 = "mkdir data-" + dataname; 549 | system(a666.c_str()); 550 | ___flag = true; 551 | } 552 | cci << __ci; 553 | cci >> ccci; 554 | std::string name = "data-" + dataname + "./" + dataname + ccci + ".in"; 555 | freopen(name.c_str(), "w", stdout); 556 | freopen(name.c_str(), "r", stdin); 557 | } 558 | ss << a; 559 | ss >> c; 560 | std::cin >> tnmp; 561 | c = tnmp + c; 562 | std::cout << c; 563 | ++__cnt; 564 | } 565 | inline void inspace() { 566 | std::string ccci, tnmp; 567 | if (__cnt == 0) { 568 | if (!___flag) { 569 | std::string a666 = "mkdir data-" + dataname; 570 | system(a666.c_str()); 571 | ___flag = true; 572 | } 573 | std::stringstream cci; 574 | cci << __ci; 575 | cci >> ccci; 576 | std::string name = "data-" + dataname + "./" + dataname + ccci + ".in"; 577 | freopen(name.c_str(), "w", stdout); 578 | freopen(name.c_str(), "r", stdin); 579 | } 580 | std::cin >> tnmp; 581 | std::string a = tnmp + " "; 582 | std::cout << a; 583 | ++__cnt; 584 | } 585 | inline void inendl() { 586 | std::string ccci, tnmp; 587 | if (__cnt == 0) { 588 | if (!___flag) { 589 | std::string a666 = "mkdir data-" + dataname; 590 | system(a666.c_str()); 591 | ___flag = true; 592 | } 593 | std::stringstream cci; 594 | cci << __ci; 595 | cci >> ccci; 596 | std::string name = "data-" + dataname + "./" + dataname + ccci + ".in"; 597 | freopen(name.c_str(), "w", stdout); 598 | freopen(name.c_str(), "r", stdin); 599 | } 600 | std::cin >> tnmp; 601 | std::string a = tnmp + "\n"; 602 | std::cout << a; 603 | ++__cnt; 604 | } 605 | inline void out(int a) { 606 | freopen("CON.exe", "w", stdout); 607 | freopen("CON.exe", "r", stdin); 608 | std::stringstream aa; 609 | std::string aaa; 610 | aa << a; 611 | aa >> aaa; 612 | std::string abc; 613 | std::string name = "data-" + dataname + "./" + dataname + aaa + ".in"; 614 | freopen(name.c_str(), "r", stdin); 615 | std::string outname = "data-" + dataname + "./" + dataname + aaa + ".out"; 616 | freopen(outname.c_str(), "w", stdout); 617 | system("std.exe"); 618 | } 619 | inline void makeout(int b, int a) { 620 | MessageBox(NULL, 621 | "In files are already generated, you can find them in the " 622 | "new folder " 623 | "in this directory.", 624 | "CarYon", MB_ICONINFORMATION); 625 | for (int i = b; i <= a; ++i) { 626 | out(i); 627 | freopen("CON.exe", "r", stdin); 628 | freopen("CON.exe", "w", stdout); 629 | std::stringstream _a; 630 | std::string _i; 631 | _a << i; 632 | _a >> _i; 633 | } 634 | MessageBox(NULL, 635 | "Out files are already generated, you can find them in the " 636 | "new folder " 637 | "in this directory.", 638 | "CarYon", MB_ICONINFORMATION); 639 | } 640 | inline void closefile() { 641 | freopen("CON.exe", "w", stdout); 642 | freopen("CON.exe", "r", stdin); 643 | } 644 | } // namespace inout 645 | namespace cydebug { 646 | std::stringstream __re; 647 | void makeDebugFile(int a, int b) { 648 | std::string ___a = "mkdir debug-" + dataname; 649 | system(___a.c_str()); 650 | for (int i = a; i <= b; ++i) { 651 | std::stringstream debug1; 652 | std::string Debug1; 653 | debug1 << i; 654 | debug1 >> Debug1; 655 | std::string debugname1 = 656 | "debug-" + dataname + "./" + dataname + Debug1 + ".ans"; 657 | std::string debugname2 = 658 | "data-" + dataname + "./" + dataname + Debug1 + ".in"; 659 | freopen(debugname1.c_str(), "w", stdout); 660 | freopen(debugname2.c_str(), "r", stdin); 661 | long double clock1 = clock(); 662 | __re << system("myprogram.exe") << std::endl; 663 | runtime = (int)(clock() - clock1); 664 | sp << runtime << std::endl; 665 | } 666 | inout::closefile(); 667 | } 668 | void compareFile(int a, int b) { 669 | int ____cnt = 0; 670 | freopen("Debug.log", "w", stdout); 671 | for (int i = a; i <= b; i++) { 672 | inout::closefile(); 673 | freopen("Debug.log", "a", stdout); 674 | std::cout << "Comparing " << i << ".out and " << i << ".ans...\n"; 675 | std::stringstream debug1; 676 | std::string Debug1; 677 | debug1 << i; 678 | debug1 >> Debug1; 679 | std::string command = "tools\\Compare\\NOIPStyle.exe debug-" + 680 | dataname + "\\" + dataname + Debug1 + 681 | ".ans data-" + dataname + "\\" + dataname + 682 | Debug1 + ".out"; 683 | int flag = system(command.c_str()); 684 | sp >> runtime; 685 | int __tmp; 686 | __re >> __tmp; 687 | freopen("Debug.log", "a", stdout); 688 | if (__tmp != 0) { 689 | std::cout << "TestCase " << i << ", result: RE.\n"; 690 | } 691 | else if (runtime > maxtime) { 692 | std::cout << "TestCase " << i 693 | << ", result: TLE. The program\'s runtime is " << runtime 694 | << " ms.\n"; 695 | } 696 | else if (flag == 1) { 697 | std::cout << "TestCase " << i << ", result: AC.\n"; 698 | ____cnt++; 699 | } 700 | else if (flag == 0) { 701 | std::cout << "TestCase " << i << ", result: WA.\n"; 702 | } 703 | else if (flag == -1) { 704 | std::cout << "TestCase " << i << ", result: Judgement failed.\n"; 705 | } 706 | else { 707 | std::cout << "TestCase " << i << ", result: UKE.\n"; 708 | } 709 | } 710 | inout::closefile(); 711 | std::cout << "Compare is compeleted." << std::endl; 712 | long double score = (long double)____cnt * 1.0 / (b - a + 1) * 100; 713 | std::stringstream tempp; 714 | std::string tmp; 715 | tempp << score; 716 | tempp >> tmp; 717 | std::string command = "The score is " + tmp + "\n"; 718 | MessageBox(NULL, command.c_str(), "CarYon", MB_ICONINFORMATION); 719 | } 720 | void debug(int a, int b) { 721 | makeDebugFile(a, b); 722 | MessageBox(NULL, "Debug files were maked successfully.", "CarYon", 723 | MB_ICONINFORMATION); 724 | compareFile(a, b); 725 | MessageBox(NULL, "Debug successfully.", "CarYon", MB_ICONINFORMATION); 726 | system("pause"); 727 | } 728 | } // namespace cydebug 729 | namespace cconst { 730 | const long double PI = 3.141592653589793238462643383279502884197169399; 731 | const long double E = 2.7182818284590452353602874713527; 732 | const std::string ALPHABET_SMALL = "abcdefghijklmnopqrstuvwxyz"; 733 | const std::string ALPHABET_CAPITAL = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 734 | const std::string ALPHABET = 735 | "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; 736 | const std::string NUMBERS = "0123456789"; 737 | const int INF = 0x7f7f7f; 738 | } // namespace cconst 739 | #if __cplusplus >= 201103L 740 | namespace caryon_cpp11 { 741 | template < typename T > 742 | T choice_plus(std::initializer_list< T > a) { 743 | std::vector< T > b; 744 | for (auto i : a) { 745 | b.push_back(i); 746 | } 747 | return b[crand::cyrand(1, b.size()) - 1]; 748 | } 749 | } // namespace caryon_cpp11 750 | #endif 751 | namespace cmath { 752 | class quadtri { 753 | public: 754 | int a, b, c; 755 | char s; 756 | int Delta; 757 | quadtri() { 758 | a = 1; 759 | b = 0; 760 | c = 0; 761 | s = 'x'; 762 | Delta = 0; 763 | } 764 | quadtri(int x, int y, int z, char tmp) { 765 | a = x; 766 | b = y; 767 | c = z; 768 | s = tmp; 769 | Delta = b * b - 4 * a * c; 770 | } 771 | void make(char abc) { 772 | s = abc; 773 | a = crand::cyrand(-100, 100); 774 | while (a == 0) { 775 | a = crand::cyrand(-100, 100); 776 | } 777 | b = crand::cyrand(-100, 100); 778 | c = crand::cyrand(-100, 100); 779 | } 780 | void makeDelta() { 781 | Delta = b * b - 4 * a * c; 782 | } 783 | void makecanfac(char abc) { 784 | do { 785 | s = abc; 786 | a = crand::cyrand(-100, 100); 787 | while (a == 0) { 788 | a = crand::cyrand(-100, 100); 789 | } 790 | b = crand::cyrand(-100, 100); 791 | c = crand::cyrand(-100, 100); 792 | Delta = b * b - 4 * a * c; 793 | } while (!(Delta == (int)sqrt(Delta) * (int)sqrt(Delta))); 794 | } 795 | quadtri operator+(const quadtri cc) const { 796 | quadtri tmp; 797 | tmp.a = a + cc.a; 798 | tmp.b = b + cc.b; 799 | tmp.c = c + cc.c; 800 | return tmp; 801 | } 802 | quadtri operator-(const quadtri aaa) const { 803 | quadtri tmp; 804 | tmp.a = a - aaa.a; 805 | tmp.b = b - aaa.b; 806 | tmp.c = c - aaa.c; 807 | return tmp; 808 | } 809 | quadtri operator+(const int aaa) const { 810 | quadtri tmp; 811 | tmp.a = a; 812 | tmp.b = b; 813 | tmp.c = tmp.c + aaa; 814 | return tmp; 815 | } 816 | quadtri operator-(const int aaa) const { 817 | return *this + (-a); 818 | } 819 | }; 820 | class stpolyon { 821 | public: 822 | long double length, perimeter; 823 | long long edge; 824 | long double oprc(bool flag) { 825 | if (flag) { 826 | perimeter = (long double)edge * length; 827 | } 828 | return (long double)edge * length; 829 | } 830 | }; 831 | class kucan { // By Billy2007 832 | public: 833 | long long p, q, dlt[__N][__N]; 834 | kucan() { 835 | p = 1, q = 1; 836 | ms(dlt, 0); 837 | } 838 | kucan operator+(const kucan b) const { 839 | kucan c; 840 | if (b.p == p && b.q == q) { 841 | fs(i, 1, p, 1) { 842 | fs(j, 1, q, 1) { 843 | c.dlt[i][j] = dlt[i][j] + b.dlt[i][j]; 844 | } 845 | } 846 | c.p = p; 847 | c.q = q; 848 | } 849 | else { 850 | fs(i, 1, p, 1) { 851 | fs(j, 1, q, 1) { 852 | c.dlt[i][j] = dlt[i][j]; //+b.dlt[i][j]; 853 | } 854 | } 855 | fs(i, 1, b.p, 1) { 856 | fs(j, 1, b.q, 1) { 857 | c.dlt[i + p][j + q] = b.dlt[i][j]; 858 | } 859 | } 860 | c.p = p + b.p; 861 | c.q = q + b.q; 862 | } 863 | return c; 864 | } 865 | kucan operator-(const kucan b) const { 866 | kucan c; 867 | if (b.p == p && b.q == q) { 868 | fs(i, 1, p, 1) { 869 | fs(j, 1, q, 1) { 870 | c.dlt[i][j] = dlt[i][j] - b.dlt[i][j]; 871 | } 872 | } 873 | c.p = p; 874 | c.q = q; 875 | } 876 | return c; 877 | } 878 | kucan operator*(const kucan b) const { 879 | kucan c; 880 | if (b.p == q) { 881 | c.p = p; 882 | c.q = b.q; 883 | fs(i, 1, c.p, 1) { 884 | fs(j, 1, c.q, 1) { 885 | long long jk = 0; 886 | fs(k, 1, q, 1) { 887 | jk += dlt[i][k] * b.dlt[k][j]; 888 | jk %= __moda; 889 | } 890 | c.dlt[i][j] = jk; 891 | c.dlt[i][j] %= __moda; 892 | } 893 | } 894 | } 895 | return c; 896 | } 897 | kucan operator*(const long long b) const { 898 | kucan c; 899 | fs(i, 1, p, 1) { 900 | fs(j, 1, q, 1) { 901 | c.dlt[i][j] = dlt[i][j] * b; 902 | } 903 | } 904 | c.p = p; 905 | c.q = q; 906 | return c; 907 | } 908 | void out() { 909 | fs(i, 1, p, 1) { 910 | fs(j, 1, q, 1) { 911 | std::cout << dlt[i][j]; 912 | std::cout << ' '; 913 | } 914 | std::cout << std::endl; 915 | } 916 | } 917 | }; 918 | class circle { 919 | public: 920 | long double r, c, area; 921 | long double oprc(bool flag) { 922 | if (flag) 923 | c = 2 * r * cconst::PI; 924 | return 2 * r * cconst::PI; 925 | } 926 | long double opra(bool flag) { 927 | if (flag) 928 | area = cconst::PI * r * r; 929 | return cconst::PI * r * r; 930 | } 931 | circle operator+(const circle x) const { 932 | circle tmp; 933 | tmp.r = r + x.r; 934 | tmp.c = 2 * r * cconst::PI; 935 | tmp.area = cconst::PI * r * r; 936 | return tmp; 937 | } 938 | circle operator-(const circle x) const { 939 | circle tmp; 940 | tmp.r = r - x.r; 941 | tmp.c = 2 * r * cconst::PI; 942 | tmp.area = cconst::PI * r * r; 943 | return tmp; 944 | } 945 | bool operator>(const circle b) const { 946 | circle c = *this - b; 947 | if (c.r > 0) 948 | return true; 949 | else 950 | return false; 951 | } 952 | bool operator>=(const circle b) const { 953 | return !(b > *this); 954 | } 955 | bool operator<(const circle b) const { 956 | return b > *this; 957 | } 958 | bool operator<=(const circle b) const { 959 | return !(*this > b); 960 | } 961 | bool operator==(const circle b) const { 962 | return !(*this > b) && !(b > *this); 963 | } 964 | bool operator!=(const circle b) const { 965 | return !(*this == b); 966 | } 967 | }; 968 | inline long double 969 | cdistance(long double a1, long double a2, long double b1, long double b2) { 970 | return sqrt((a1 - b1) * (a1 - b1) + (a2 - b2) * (a2 - b2)); 971 | } 972 | template < typename T > 973 | inline T cabs(T a) { 974 | return a > 0 ? a : -a; 975 | } 976 | inline int cmin(int a, int b) { 977 | return a < b ? a : b; 978 | } 979 | inline int cmax(int a, int b) { 980 | return a > b ? a : b; 981 | } 982 | template < typename T > 983 | T cgcd(T a, T b) { 984 | return a == 0 ? b : cgcd(b % a, a); 985 | } 986 | inline bool isprime(int a) { 987 | if (a < 2) 988 | return false; 989 | for (int i = 2; i <= sqrt(a); ++i) { 990 | if (a % i == 0) 991 | return false; 992 | } 993 | return true; 994 | } 995 | inline int cmakeprime(int a, int b) { 996 | int prcnt = 0; 997 | for (int i = a; i <= b; i++) { 998 | if (isprime(i)) { 999 | cprime[prcnt++] = i; 1000 | } 1001 | } 1002 | } 1003 | inline int crprimenum(int beg, int end) { 1004 | return cprime[crand::cyrand(beg, end)]; 1005 | } 1006 | class rectangle { 1007 | public: 1008 | int a, b, peri, area; 1009 | rectangle() { 1010 | a = 0; 1011 | b = 0; 1012 | peri = 0; 1013 | area = 0; 1014 | } 1015 | void makePeri() { 1016 | peri = (a + b) * 2; 1017 | } 1018 | void makeArea() { 1019 | area = a * b; 1020 | } 1021 | }; 1022 | class triangle { 1023 | public: 1024 | int a, b, c, h1, h2, h3, peri, area; 1025 | triangle() { 1026 | a = b = c = h1 = h2 = h3 = peri = area = 0; 1027 | } 1028 | void makePeri() { 1029 | peri = a + b + c; 1030 | } 1031 | void makeArea() { 1032 | int p = (a + b + c) / 2; 1033 | area = sqrt(p * (p - a) * (p - b) * (p - c)); 1034 | } 1035 | }; 1036 | class frac { // By GoneTime&luosw 1037 | private: 1038 | void huaj() { 1039 | long long kk = cgcd(son, mom); 1040 | son /= kk; 1041 | mom /= kk; 1042 | } 1043 | bool fu() { 1044 | huaj(); 1045 | if (son < 0 && mom < 0) { 1046 | son = -son; 1047 | mom = -mom; 1048 | return 0; 1049 | } 1050 | else if (son > 0 && mom > 0) { 1051 | return 0; 1052 | } 1053 | else 1054 | return 1; 1055 | } 1056 | 1057 | public: 1058 | int son, mom; 1059 | frac() { 1060 | son = 0; 1061 | mom = 1; 1062 | } 1063 | frac(int a, int b) { 1064 | son = a; 1065 | mom = b; 1066 | } 1067 | long double value() { 1068 | return (long double)son * 1.0 / mom; 1069 | } 1070 | std::string take(bool flag) { 1071 | int c = cgcd(son, mom); 1072 | son /= c; 1073 | mom /= c; 1074 | std::stringstream tmp1, tmp2; 1075 | std::string aaa, bbb; 1076 | tmp1 << son; 1077 | tmp1 >> aaa; 1078 | tmp2 << mom; 1079 | tmp2 >> bbb; 1080 | return (flag) ? aaa + '/' + bbb : aaa + ' ' + bbb; 1081 | } 1082 | std::string fracr(bool flag) { 1083 | std::stringstream tmp1, tmp2; 1084 | std::string aaa, bbb; 1085 | tmp1 << son; 1086 | tmp1 >> aaa; 1087 | tmp2 << mom; 1088 | tmp2 >> bbb; 1089 | return (flag) ? aaa + '/' + bbb : aaa + ' ' + bbb; 1090 | } 1091 | frac operator*(const frac b) const { 1092 | frac c; 1093 | c.son = son * b.son; 1094 | c.mom = mom * b.mom; 1095 | c.huaj(); 1096 | return c; 1097 | } 1098 | frac operator/(const frac b) const { 1099 | frac c; 1100 | c.son = son * b.mom; 1101 | c.mom = mom * b.son; 1102 | c.huaj(); 1103 | return c; 1104 | } 1105 | frac operator+(const frac b) const { 1106 | frac c; 1107 | c.mom = lcm(mom, b.mom); 1108 | c.son = son * (c.mom / mom) + b.son * (c.mom / b.mom); 1109 | c.huaj(); 1110 | return c; 1111 | } 1112 | frac operator-(const frac b) const { 1113 | frac c; 1114 | c.mom = lcm(mom, b.mom); 1115 | c.son = son * (c.mom / mom) - b.son * (c.mom / b.mom); 1116 | c.huaj(); 1117 | return c; 1118 | } 1119 | frac operator+(const int a) const { 1120 | frac tmp; 1121 | frac abc; 1122 | abc.son = a; 1123 | abc.mom = 1; 1124 | tmp = *this + abc; 1125 | return tmp; 1126 | } 1127 | frac operator-(const int a) const { 1128 | return *this + (-a); 1129 | } 1130 | frac operator*(const int a) const { 1131 | frac tmp, abc; 1132 | abc.son = a; 1133 | abc.mom = 1; 1134 | tmp = tmp * abc; 1135 | return tmp; 1136 | } 1137 | frac operator/(const int a) const { 1138 | frac tmp, abc; 1139 | abc.son = a; 1140 | abc.mom = 1; 1141 | tmp = tmp / abc; 1142 | return tmp; 1143 | } 1144 | bool operator>(const frac b) const { 1145 | frac c = *this - b; 1146 | if (c.fu()) 1147 | return 0; 1148 | else 1149 | return 1; 1150 | } 1151 | bool operator<(const frac b) const { 1152 | return b > *this; 1153 | } 1154 | bool operator<=(const frac b) const { 1155 | return !(*this > b); 1156 | } 1157 | bool operator>=(const frac b) const { 1158 | return !(b > *this); 1159 | } 1160 | bool operator!=(const frac b) const { 1161 | return (b > *this) || (*this > b); 1162 | } 1163 | bool operator==(const frac b) const { 1164 | return !(*this > b) && !(b > *this); 1165 | } 1166 | }; 1167 | } // namespace cmath 1168 | namespace cgeo { 1169 | class point { 1170 | public: 1171 | double x, y; 1172 | point() { 1173 | x = 0; 1174 | y = 0; 1175 | } 1176 | point(int a, int b) { 1177 | x = a; 1178 | y = b; 1179 | } 1180 | double pointDis(point b) { 1181 | return sqrt((x - b.x) * (x - b.x) + (y - b.y) * (y - b.y)); 1182 | } 1183 | }; 1184 | class line { 1185 | public: 1186 | double k, b; 1187 | line() { 1188 | k = 0; 1189 | b = 0; 1190 | } 1191 | line makeLine(point a, point b) { 1192 | line tmp; 1193 | tmp.k = (a.y - b.y) / (a.x - b.x); 1194 | tmp.b = a.y - ((a.y - b.y) / (a.x - b.x) * a.x); 1195 | return tmp; 1196 | } 1197 | }; 1198 | class hypotenuse { 1199 | public: 1200 | double k; 1201 | hypotenuse() { 1202 | k = 1; 1203 | } 1204 | hypotenuse makeHypotenuse(point a) { 1205 | hypotenuse tmp; 1206 | tmp.k = a.x * a.y; 1207 | } 1208 | }; 1209 | class parabola { 1210 | public: 1211 | double a, b, c; 1212 | parabola() { 1213 | a = 1; 1214 | b = 0; 1215 | c = 0; 1216 | } 1217 | }; 1218 | } // namespace cgeo 1219 | namespace ca { 1220 | using namespace cydebug; 1221 | using namespace cgeo; 1222 | using namespace cmath; 1223 | using namespace cgraph; 1224 | using namespace crand; 1225 | using namespace inout; 1226 | using namespace cconst; 1227 | #if __cplusplus >= 201103L 1228 | using namespace caryon_cpp11; 1229 | #endif 1230 | } // namespace ca 1231 | #endif 1232 | --------------------------------------------------------------------------------