Login
Register
Problem list
Online status
sptnk1
:
2023-12-12 17:33:02
跟下面那个字符串比较一摸一样的题,那个过了,这个为什么不过 #include
#include
using namespace std; int a, b, az[1000], bz[1000]; int cam(int a, int b, int* az, int* bz) { for(int i = 0; i < min(a, b); i++) { if (az[i] > bz[i]) return 1; if (az[i] < bz[i]) return 0; } if (a > b) return 1; if (a < b) return -1; return 0; } int main() { int n; cin >> n; vector
tem; for (int i = 0; i < n; i++) { cin >> a >> b; for (int j = 0; j < a; j++) cin >> az[j]; for (int j = 0; j < b; j++) cin >> bz[j]; tem.push_back(cam(a, b, az, bz)); } for (int i = 0; i < tem.size(); i++) { cout << tem[i] << endl; } }
Amanises
:
2023-10-15 18:20:20
同bug已解决,可以尝试调整数组大小
09020332-柯豪宇
:
2021-12-14 19:44:01
自己的编译器上运行正常,但是网站runtime error
Post Your Comment