版本比较
出题/配置题目
标题
增加 1 行删除 1 行
11造题相关出题/配置题目正文
增加 44 行删除 45 行
123456728910111213148 行未改动232425261927282930317 行未改动394041423543444546474048495051523 行未改动56575859525354556057616263646566596061626364656667676970686970717272737475767778798081828384858687888990737475767778798081929394959697828384858687888990919293949596979899100### 制作题目配置文件~就是生成 `config.yml`。~
c++ 程序已被淘汰,前往以下网页制作:https://thchfhch1.github.io/tool/TestCaseManager.html
::::info[清除\r\n]## dos2unix.cpp待更新。
**dos2unix.cpp**```cpp#include <cstdio>
const int SIZE = 100000000;8 行未改动 std::fclose(fout); return 0;}```## work.cpp**work.cpp**```cpp#include<bits/stdc++.h>#include<fstream>using namespace std;7 行未改动 For(i,1,n){ op<<"dos2unix.exe data/"<<i<<".in"; string in1; getline(op,in1); system(in1.c_str()); cerr<<"in1: "<<in1<<'\n'; cerr<<in1<<'\n'; op.clear(); op<<"dos2unix.exe data/"<<i<<".out"; string out1; getline(op,out1); system(out1.c_str()); cerr<<"out1: "<<out1<<'\n'; cerr<<out1<<'\n'; op.clear(); }}
3 行未改动 solve(); return 0;}```::::
::::info[一键制作题目配置文件]就是生成 `config.yml`。```cpp#include<bits/stdc++.h>#include <iostream>#include <string>#include <cstdlib>#include <cstdio>
using namespace std;#define il inlinetypedef long long LL;typedef unsigned long long ULL;//#define int LLtypedef const int& ci;#define For(i,t,n) for(int i=t;i<=n;++i)#define foR(i,t,n) for(int i=t;i>=n;--i)const int inf=0x3f3f3f3f;const int MAXN=1e5+5;
int n,sc,tl,ml,l,r;string fn="";int main(){ int cnt[] = {3, 7, 7, 5, 2, 15}; char buf[256];
void solve(){ cerr<<"tot: ";cin>>n;// cerr<<"filename: ";cin>>fn; For(id,1,n){ cerr<<"case #"<<id<<" >\n"; cerr<<"range[l,r]: "; cin>>l>>r; cerr<<"score: "; cin>>sc; cerr<<"timeLimit/ms: "; cin>>tl; cerr<<"memoryLimit/MB: "; cin>>ml; For(i,l,r){ cout<<fn<<i<<".in:\n"; cout<<" timeLimit: "<<tl<<'\n'; cout<<" memoryLimit: "<<ml*1000<<'\n'; cout<<" score: "<<sc<<'\n'; cout<<" subtaskId: "<<id<<'\n'; } cerr<<'\n'; }} for (int sub = 1; sub <= 6; ++sub) { int max_idx = cnt[sub - 1]; for (int i = 1; i <= max_idx; ++i) { // 拼接文件名 subX_Y.in sprintf(buf, "sub%d_%d.in", sub, i); string fn(buf);
signed main(){ freopen("config.yml","w",stdout); ios::sync_with_stdio(0); cin.tie(0);cout.tie(0); solve(); return 0; string cmd = "dos2unix.exe " + fn; cout << cmd << endl; system(cmd.c_str());
// 如果需要同时处理 .out 文件,打开下面这段 /* sprintf(buf, "sub%d_%d.out", sub, i); string fn_out(buf); string cmd_out = "dos2unix.exe " + fn_out; cout << cmd_out << endl; system(cmd_out.c_str()); */ } } return 0;}
```::::