Submission #38913

# Submission time Handle Problem Language Result Execution time Memory
38913 2018-01-08T03:41:24 Z funcsr None (JOI16_memory2) C++14
10 / 100
0 ms 2020 KB
#include "Memory2_lib.h"
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <cassert>
using namespace std;
typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(x) x.begin(), x.end()
#define uniq(x) x.erase(unique(all(x)), x.end())
#define index(x, y) (int)(lower_bound(all(x), y) - x.begin())
#define pb push_back
#define _1 first
#define _2 second
#define INF 1145141919
#define MOD 1000000007

int get_min_pos(int N) {
  rep(i, 2*N) rep(j, i) {
    if (Flip(i, j) == N-1) return i;
  }
  return -1;
}

vector<int> G[50];
void Solve(int T, int N) {
  if (T != 1) abort();
  int min_pos = get_min_pos(N);
  assert(min_pos != -1);
  rep(i, 2*N) {
    int a = N-1;
    if (i != min_pos) a = Flip(i, min_pos);
    G[a].pb(i);
  }
  rep(i, N) assert(G[i].size() == 2);
  rep(i, N) Answer(G[i][0], G[i][1], i);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 2020 KB Output is correct
2 Correct 0 ms 2020 KB Output is correct
3 Correct 0 ms 2020 KB Output is correct
4 Correct 0 ms 2020 KB Output is correct
5 Correct 0 ms 2020 KB Output is correct
6 Correct 0 ms 2020 KB Output is correct
7 Correct 0 ms 2020 KB Output is correct
8 Correct 0 ms 2020 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 2020 KB Execution killed because of forbidden syscall gettid (186)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 2020 KB Execution killed because of forbidden syscall gettid (186)
2 Halted 0 ms 0 KB -