使用方法:洛谷题单左下角多选,右下角导出 $\texttt{T}$纯题号,输入进去会输出 vjudge 题单格式。
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
int main() {
using namespace std;
string src;
cin >> src;
src.push_back(',');
string tmp;
vector<string> set;
for(auto ch : src)
if(ch == ',')
{
set.push_back(tmp);
tmp.clear();
}
else
tmp.push_back(ch);
sort(set.begin(), set.end());
for(const auto& i : set)
{
cout << "[problem:";
if(i.size() > 2 && i.substr(0, 2) == "AT")
cout << "AtCoder-" << i.substr(3);
else if(i.size() > 1 && i.substr(0, 2) == "CF")
cout << "CodeForces-" << i.substr(2);
else if(i.size() > 2 && i.substr(0, 3) == "UVA")
cout << "UVA-" << i.substr(3);
else
cout << "洛谷-" << i;
cout << "]\n";
}
return 0;
}

鲁ICP备2025150228号