QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#190296 | #6677. Puzzle: Sashigane | JWRuixi# | WA | 0ms | 3612kb | C++20 | 2.1kb | 2023-09-28 16:41:50 | 2023-09-28 16:41:51 |
Judging History
answer
#include <bits/stdc++.h>
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2")
// #define ATC
#define LL long long
#define eb emplace_back
#define writesp(x) write(x), putchar(' ')
#define writeln(x) write(x), putchar('\n')
#define FIO(FILENAME) freopen(FILENAME".in", "r", stdin), freopen(FILENAME".out", "w", stdout)
using namespace std;
#ifdef ATC
#include <atcoder/all>
using namespace atcoder;
#endif
namespace IO {
char ibuf[(1 << 20) + 1], *iS, *iT;
#if ONLINE_JUDGE
#define gh() (iS == iT ? iT = (iS = ibuf) + fread(ibuf, 1, (1 << 20) + 1, stdin), (iS == iT ? EOF : *iS++) : *iS++)
#else
#define gh() getchar()
#endif
inline long long read() {
char ch = gh();
long long x = 0;
bool t = 0;
while (ch < '0' || ch > '9') t |= ch == '-', ch = gh();
while (ch >= '0' && ch <= '9') x = (x << 1) + (x << 3) + (ch ^ 48), ch = gh();
return t ? ~(x - 1) : x;
}
template<typename _Tp>
inline void write(_Tp x) {
static char stk[64], *top = stk;
if (x < 0) {
x = ~(x - 1);
putchar('-');
}
do *top++ = x % 10, x /= 10;
while (x);
while (top != stk) putchar((*--top) | 48);
}
}
using IO::read;
using IO::write;
inline void slv () {
int n = read(), x = read(), y = read();
vector<tuple<int, int, int, int>> as;
for (int i = 1; i < min(x, y); i++)
as.eb(i, i, n - i, n - i);
int b = min(x, y);
if (x < y) {
int sx = x + 1, sy = y - 1, d = 1;
while (sx <= y) {
as.eb(sx, sy, d, -d);
++d, ++sx, --sy;
}
x = y;
} else {
int sx = x - 1, sy = y + 1, d = 1;
while (sy <= x) {
as.eb(sx, sy, -d, d);
++d, --sx, ++sy;
}
y = x;
}
for (int i = x + 1; i <= n; i++) as.eb(i, i, b - i, b - i);
writeln(as.size());
for (auto [x, y, z, w] : as) writesp(x), writesp(y), writesp(z), writeln(w);
}
int main() {
int T = 1;
while (T--) slv();
return 0;
}
// I love WHQ!
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3612kb
input:
5 3 4
output:
4 1 1 4 4 2 2 3 3 4 3 1 -1 5 5 -2 -2
result:
wrong answer YES or NO expected in answer, but 4 found. (test case 1)