TOJ
跳至導覽
跳至搜尋
Special Judge
將conf.json中的check從diff改成ioredir,及設定metadata如下。
- /conf.json
{
"check": "ioredir",
"metadata": {
"redir_test": {
"pipeout": 1,
"testin": 0,
"testout": -1,
"pipein": -1
},
"redir_check": {
"ansin": 2,
"testin": -1,
"pipeout": 0,
"pipein": -1
}
}
}
- /res/check/check.cpp
分別從答案及輸出分別讀入long double。
long double Answer, Output;
FILE *ansf = fdopen(2, "r");
scanf("%Lf", &Output);
fscanf(ansf, "%Lf", &Answer);
- /res/check/build
#!/bin/sh
g++ -o check check.cpp
參考 https://hackmd.io/s/BkHdt57I