Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
108807 | 何松羽 | 铺地毯 | C++ | Compile Error | 0 MS | 0 KB | 431 | 2025-01-22 12:11:48 |
#include<bits/stdc++.h> using namespace std; const maxn = 10010; int a[maxn], b[maxn], w[maxn], h[maxn]; int n; int main() { cin >> n; for (int i = 1; i <= n ; i++) { cin >> a[i] >> b[i] >> w[i] >> h[i]; } cin >> px >> py; for (int i = 1; i <= n; i++) { if (px >= a[i] && px <= a[i] + w[i] && py >= b[i] && py <= b[i] + h[i]) { cout << i << endl; return 0; } } cout << -1 << endl; return 0; }
Main.cc:3:7: error: 'maxn' does not name a type const maxn = 10010; ^ Main.cc:4:7: error: 'maxn' was not declared in this scope int a[maxn], b[maxn], w[maxn], h[maxn]; ^ Main.cc:4:16: error: 'maxn' was not declared in this scope int a[maxn], b[maxn], w[maxn], h[maxn]; ^ Main.cc:4:25: error: 'maxn' was not declared in this scope int a[maxn], b[maxn], w[maxn], h[maxn]; ^ Main.cc:4:34: error: 'maxn' was not declared in this scope int a[maxn], b[maxn], w[maxn], h[maxn]; ^ Main.cc: In function 'int main()': Main.cc:9:10: error: 'a' was not declared in this scope cin >> a[i] >> b[i] >> w[i] >> h[i]; ^ Main.cc:9:18: error: 'b' was not declared in this scope cin >> a[i] >> b[i] >> w[i] >> h[i]; ^ Main.cc:9:26: error: 'w' was not declared in this scope cin >> a[i] >> b[i] >> w[i] >> h[i]; ^ Main.cc:9:34: error: 'h' was not declared in this scope cin >> a[i] >> b[i] >> w[i] >> h[i]; ^ Main.cc:11:9: error: 'px' was not declared in this scope cin >> px >> py; ^ Main.cc:11:15: error: 'py' was not declared in this scope cin >> px >> py; ^ Main.cc:13:13: error: 'a' was not declared in this scope if (px >= a[i] && px <= a[i] + w[i] && py >= b[i] && py <= b[i] + h[i]) { ^ Main.cc:13:34: error: 'w' was not declared in this scope if (px >= a[i] && px <= a[i] + w[i] && py >= b[i] && py <= b[i] + h[i]) { ^ Main.cc:13:48: error: 'b' was not declared in this scope if (px >= a[i] && px <= a[i] + w[i] && py >= b[i] && py <= b[i] + h[i]) { ^ Main.cc:13:69: error: 'h' was not declared in this scope if (px >= a[i] && px <= a[i] + w[i] && py >= b[i] && py <= b[i] + h[i]) { ^