QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#262540 | #7758. Painter | ucup-team059# | Compile Error | / | / | C++20 | 1.5kb | 2023-11-23 20:15:00 | 2023-11-23 20:15:01 |
Judging History
This is the latest submission verdict.
- [2023-11-23 20:15:01]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2023-11-23 20:15:00]
- Submitted
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
using i32 = int32_t;
using vi = vector<int>;
i32 main() {
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int n;
cin >> n;
vector<vi> g;
auto in = [](vi g, int x, int y) {
if (g.size() == 4) {
int dis = (g[0] - x) * (g[0] - x) + (g[1] - y) * (g[1] - y);
if (dis <= g[2] * g[2]) return g[3];
} else {
if (g[0] <= x and x <= g[2] and g[1] <= y and y <= g[3])
return g[4];
}
return -1;
};
for (string s; n; n--) {
cin >> s;
if (s == "Circle") {
vi x(3);
for (auto &i: x) cin >> i;
cin >> s;
x.push_back((int)s[0]);
g.push_back(x);
} else if (s == "Rectangle") {
vi x(4);
for (auto &i: x) cin >> i;
cin >> s;
x.push_back((int)s[0]);
g.push_back(x);
} else {
int xa, xb, ya, yb;
cin >> xa >> ya >> xb >> yb;
for (int j = yb, t; j >= ya; j--) {
for (int i = xa; i <= xb; i++) {
t = -1;
for (int k = g.size() - 1; k >= 0 and t == -1; k--)
t = in(g[k], i, j);
if (t == -1) cout << char(46);
else cout << char(t);
}
cout << "\n";
}
}
}
return 0;
}
Details
answer.code: In lambda function: answer.code:24:16: error: inconsistent types ‘long long int’ and ‘int’ deduced for lambda return type 24 | return -1; | ^~