답안 #580944

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
580944 2022-06-22T06:41:42 Z drdilyor Vision Program (IOI19_vision) C++17
0 / 100
3 ms 1104 KB
#if defined(ONPC) && !defined(_GLIBCXX_ASSERTIONS)
    #define _GLIBCXX_ASSERTIONS
#endif
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
#ifdef ONPC
    #define cerr cout
    #include "t_debug.cpp"
#else
    #define debug(...) 42
#endif
#define allit(a) (a).begin(), (a).end()
#define sz(a) ((int) (a).size())
#include "vision.h"

using namespace std;
using ll = long long;
using vi = vector<int>;
namespace pd = __gnu_pbds;
template<typename K>
using ordered_set = pd::tree<K, pd::null_type, less<int>, pd::rb_tree_tag, pd::tree_order_statistics_node_update>;
template<typename... T>
using gp_hash_table = pd::gp_hash_table<T...>;//simple using statement gives warnings

const int INF = 1e9;
const ll INFL = 1e18;
const int N = 1e5;
const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
mt19937 rng(RANDOM);

#define ENC(i,j) ((i) * m + (j))
void construct_network(int n, int m, int dist) {
    if (dist == 1) {
        vi pos;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (i) pos.push_back(add_and({ENC(i, j), ENC(i-1, j)}));
                if (j) pos.push_back(add_and({ENC(i, j), ENC(i, j-1)}));
            }
        }
        debug(pos);
        for (int i = 1, prev = pos.front(); i < sz(pos); i++) {
            prev = add_or({prev, pos[i]});
        }
    }
    else {
        int prev = -1;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (i + j == dist) {
                    if (prev == -1) prev = i*m + j;
                    else prev = add_or({prev, i*m + j});
                }
            }
        }
        add_and({prev, prev});
    }
}
#undef ENC

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:11:24: warning: statement has no effect [-Wunused-value]
   11 |     #define debug(...) 42
      |                        ^~
vision.cpp:42:9: note: in expansion of macro 'debug'
   42 |         debug(pos);
      |         ^~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB on inputs (0, 1), (0, 2), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB on inputs (0, 1), (0, 2), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB on inputs (0, 1), (0, 2), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB on inputs (0, 1), (0, 2), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB on inputs (0, 1), (0, 99), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 3 ms 1104 KB WA in grader: Too many instructions
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 1104 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB on inputs (0, 1), (0, 2), expected 0, but computed 1
3 Halted 0 ms 0 KB -