QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#61582 | #1807. Distribute the Bars | Pitiless0514 | WA | 6ms | 9652kb | C++14 | 2.8kb | 2022-11-14 10:15:01 | 2022-11-14 10:15:02 |
Judging History
answer
// 德丽莎你好可爱德丽莎你好可爱德丽莎你好可爱德丽莎你好可爱德丽莎你好可爱
// 德丽莎的可爱在于德丽莎很可爱,德丽莎为什么很可爱呢,这是因为德丽莎很可爱!
// 没有力量的理想是戏言,没有理想的力量是空虚
#include <bits/stdc++.h>
#define LL long long
using namespace std;
namespace IO {
const int SZ = (1 << 21) + 1;
char ib[SZ], *iS, *iT, ob[SZ], *oS = ob, *oT = oS + SZ - 1, cc, qu[55]; int ff, qr;
#define gc() (iS == iT ? (iT = (iS = ib) + fread(ib, 1, SZ, stdin), (iS == iT ? EOF : *iS++)) : *iS++)
void flush() { fwrite(ob, 1, oS - ob, stdout), oS = ob; }
void putc(char x) { *oS++ = x; if (oS == oT) flush(); }
template <class I>
void read(I &x) {
for (ff = 1, cc = gc(); cc < '0' || cc > '9'; cc = gc()) if (cc == '-') ff = -1;
for (x = 0; cc <= '9' && cc >= '0'; cc = gc()) x = x * 10 + (cc & 15);
x *= ff;
}
template <class I, class... Y>
void read(I &t, Y &... a) { read(t), read(a...); }
template <class I>
void write(I x) {
if (!x) putc('0');
if (x < 0) putc('-'), x = -x;
while (x) qu[++qr] = x % 10 + '0', x /= 10;
while (qr) putc(qu[qr --]);
}
} using namespace IO;
template<class T> bool chkmin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool chkmax(T &a, T b) { return a < b ? (a = b, true) : false; }
#define rep(i, l, r) for (int i = (l); i <= (r); i++)
#define repd(i, l, r) for (int i = (l); i >= (r); i--)
#define REP(i, l, r) for (int i = (l); i < (r); i++)
bool o1;
const int N = 2e5;
int n;
vector <int> ver[N];
void GG() { printf("-1\n"); exit(0); }
void solve() {
scanf("%d", &n);
if (n % 4 == 0) {
rep (i, 1, n) {
if (i % 4 == 0) {
ver[1].push_back(i);
} else if (i % 4 == 1) {
ver[1].push_back(i);
} else if (i % 4 == 2) {
ver[2].push_back(i);
} else if (i % 4 == 3) {
ver[2].push_back(i);
}
}
printf("2\n");
rep (i, 1, 2) {
printf("%d ", (int)ver[i].size());
for (auto x : ver[i]) printf("%d ", 2 * x - 1);
printf("\n");
}
return ;
} else if (n % 4 == 1) {
GG();
} else if (n % 4 == 3) {
GG();
} else if (n % 4 == 2) {
if (n == 2) GG();
if (n == 6) {
printf("2\n");
printf("1 3 5 9\n");
printf("7 11\n");
return ;
}
GG();
}
}
bool o2;
signed main () {
#ifdef LOCAL_DEFINE
cerr << "Memory elapsed: " << 1.0 * (&o1 - &o2) / 1024 / 1024 << ".Mib\n";
freopen("1.in", "r", stdin);
freopen("1.ans", "w", stdout);
#endif
int T = 1; while (T--) solve();
flush();
#ifdef LOCAL_DEFINE
cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 9652kb
input:
4
output:
2 2 1 7 2 3 5
result:
ok OK (2 groups)
Test #2:
score: 0
Accepted
time: 2ms
memory: 8768kb
input:
2
output:
-1
result:
ok OK (impossible)
Test #3:
score: 0
Accepted
time: 6ms
memory: 8200kb
input:
3
output:
-1
result:
ok OK (impossible)
Test #4:
score: -100
Wrong Answer
time: 2ms
memory: 8200kb
input:
1659
output:
-1
result:
wrong answer Jury found the solution, contestant isn't