Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
113859 | 魈凯KBS | 求最长不下降序列 | C++ | 编译错误 | 0 | 0 MS | 0 KB | 887 | 2023-12-03 21:40:02 |
#include "testlib.h" using namespace std; int main(int argc, char* argv[]){ registerTestlibCmd(argc, argv); string nn = ouf.readString(); string ansn = ans.readString(); if (nn != ansn){ quitf(_wa,"Your answer's length is wrong."); } int n = 0; for (int i = nn.size() - 1;i >= 4;i--){ n = n * 10 + nn[i] - '0'; } int a[114514],b[114514]; for (int i = 1;i <= n;i++){ a[i] = inf.readInt(); } for (int i = 1;i <= l;i++){ b[i] = ouf.readInt(); } for (int i = 2;i <= l;i++){ if (!(b[i - 1] <= b[i])){ quitf(_wa,"Your answer is wrong."); } } int o = 1,sum = 0; for (int i = 1;i <= l;i++){ int j = 0; for (j = o;j <= n;j++){ if (a[j] == b[i]){ sum++; break; } } o = j; } if (sum == ansl){ quitf(_ok,"Your answer is correct."); } else{ quitf(_wa,"Your answer is wrong."); } }