[此题](https://www.luogu.org/problemnew/show/T46884)是初赛题目Special Judge的试验题。
以下是SPJ的源码:
```cpp
#include"testlib.h"
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<string>
#include<iostream>
#include<vector>
using namespace std;
const int maxn=100;
const double mrk[maxn]=
{
1.5,1.5,1.5,1.5,1.5,
1.5,1.5,1.5,1.5,1.5,
1.5,1.5,1.5,1.5,1.5,
1.5,1.5,1.5,1.5,1.5,
5,2,3,8,8,8,2,3,3,
2,3,3,3,3,3,3,3,3,2
};
const char prob_name[maxn][maxn]=
{
"1.1","1.2","1.3","1.4","1.5",
"1.6","1.7","1.8","1.9","1.10",
"1.11","1.12","1.13","1.14","1.15",
"2.1","2.2","2.3","2.4","2.5",
"3.1","3.2(1)","3.2(2)","4.1","4.2","4.3",
"4.4(1)","4.4(2)","4.4(3)",
"5.1(1)","5.1(2)","5.1(3)","5.1(4)","5.1(5)",
"5.2(1)","5.2(2)","5.2(3)","5.2(4)","5.2(5)"
};
const string ans_[maxn]=
{
"C","B","A","C","A",
"C","B","C","D","B",
"D","D","A","D","C",
"CD","C","D","BD","BD",
"3","4","9","15","17 24 1 8 15",
"8","1 3","2017 1","1 321",
"p[0]","rest<q","rest/q","rest%q*10+p[i]","rest%q",
"degree[b]++","degree[i]==0","degree[i]--","head++","ans<len[a]"
};
vector<string>other[maxn];
int main(int argc, char* argv[])
{
other[30].push_back("q>rest");
other[31].push_back("rest div q");
other[32].push_back("rest mod q*10+p[i]");
other[33].push_back("rest mod q");
other[34].push_back("++degree[b]");
other[34].push_back("degree[b]=degree[b]+1");
other[34].push_back("inc(degree[b])");
other[34].push_back("degree[b]:=degree[b]+1");
other[35].push_back("degree[i]=0");
other[35].push_back("!degree[i]");
other[36].push_back("--degree[i]");
other[36].push_back("degree[i]=degree[i]-1");
other[36].push_back("dec(degree[i])");
other[36].push_back("degree[i]:=degree[i]-1");
other[37].push_back("++head");
other[37].push_back("head=head+1");
other[37].push_back("inc(head)");
other[37].push_back("head:=head+1");
other[38].push_back("ans<len[a]");
registerTestlibCmd(argc, argv);
double point=0;
int firwa=-1;
//for(int i=0;i<=38;i++)cout<<i<<" "<<prob_name[i]<<endl;
for(int i=0;i<=38;i++)
{
string outpu=ouf.readLine();
//ouf.readEoln();
bool tf=false;
if(outpu==ans_[i])tf=true;
else for(int j=0;j<other[i].size();j++)if(outpu==other[i][j])tf=true;
if(tf)point+=mrk[i];
else if(firwa==-1)firwa=i;
}
if(point==100.0)quitf(_ok, "100 pts");
//else quitp(0.5,"%.1lf pts,wa on %s",prob_name[firwa]);
quitp(point/100.0,"%.1lf pts,wa on %s",point,prob_name[firwa]);
return 0;
}
```
by The_Chaos @ 2018-09-22 18:42:58
由于历次NOIP初赛试题题型类似,这个SPJ具有易于移植的特点。望采纳。
@[chen_zhe](/space/show?uid=8457)
by The_Chaos @ 2018-09-22 18:44:25
旧初赛系统已死,所以等着新的初赛系统上线吧
by StudyingFather @ 2018-09-22 21:27:52
但似乎咕咕咕了?
by StudyingFather @ 2018-09-22 21:28:09