QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#506601 | #7637. Exactly Three Neighbors | pandapythoner# | WA | 0ms | 3592kb | C++23 | 1.5kb | 2024-08-05 20:02:49 | 2024-08-05 20:02:49 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define flt double
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define rep(i, n) for(int i = 0; i < n; i += 1)
#define len(a) ((int)(a).size())
const ll inf = 1e18;
mt19937 rnd(234);
int32_t main() {
if (1) {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
int p, q;
cin >> p >> q;
assert(q != 0);
if (p == q) {
cout << -1 << " " << -1 << "\n";
return 0;
}
if (p == 0) {
cout << 1 << " " << 1 << "\n";
cout << '.' << "\n";
return 0;
}
if (3 * p <= 2 * q) {
int b = 2 * p;
int w = 2 * (q - p);
vector<int> buckets(b / 2);
int i = 0;
rep(cnt, w) {
buckets[i] += 1;
i = (i + 1) % (b / 2);
}
cout << 1 << " " << b + w << "\n";
rep(i, b / 2) {
cout << "##";
assert(buckets[i] > 0);
rep(k, buckets[i]) cout << ".";
}
cout << "\n";
return 0;
}
if (5 * p == 4 * q) {
cout << 5 << " " << 5 << "\n";
rep(i, 5) {
rep(j, 5) {
if ((2 * i + j) % 5 == 0) {
cout << '.';
} else {
cout << '#';
}
}
cout << "\n";
}
return 0;
}
cout << -1 << " " << -1 << "\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3528kb
input:
2 3
output:
1 6 ##.##.
result:
ok good solution
Test #2:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
1 1
output:
-1 -1
result:
ok no solution
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3592kb
input:
3 4
output:
-1 -1
result:
wrong answer you didn't find a solution but jury did