提交时间:2023-12-17 00:01:58

运行 ID: 116510

#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."); } }