QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#61581#1807. Distribute the BarsPitiless0514WA 2ms8316kbC++142.7kb2022-11-14 10:14:062022-11-14 10:14:07

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-11-14 10:14:07]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:8316kb
  • [2022-11-14 10:14:06]
  • 提交

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) {
      for (auto x : ver[i])  printf("%d ", x);
      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 2 3 5\n");
      printf("4 6\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;
}

详细

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 8316kb

input:

4

output:

2
1 4 
2 3 

result:

wrong answer Even numbers not allowed