Submission #483926

#TimeUsernameProblemLanguageResultExecution timeMemory
483926Lam_lai_cuoc_doiVision Program (IOI19_vision)C++17
0 / 100
9 ms996 KiB
#include <bits/stdc++.h>
#include "vision.h"

using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;

template <class T>
void read(T &x)
{
    x = 0;
    register int c;
    while ((c = getchar()) && (c > '9' || c < '0'))
        ;
    for (; c >= '0' && c <= '9'; c = getchar())
        x = x * 10 + c - '0';
}

constexpr bool typetest = 0;
constexpr int N = 2e2 + 5;

void construct_network(int H, int W, int K)
{
#define pos(x, y) (W * x + y)
    vector<int> r, c;

    for (int i = 0; i < H; ++i)
    {
        vector<int> tmp;
        for (int j = 0; j < W; ++j)
            tmp.emplace_back(pos(i, j));
        if (add_or(tmp))
            r.emplace_back(i);
    }

    for (int i = 0; i < W; ++i)
    {
        vector<int> tmp;
        for (int j = 0; j < H; ++j)
            tmp.emplace_back(pos(j, i));
        if (add_or(tmp))
            c.emplace_back(i);
    }

    if (r.size() == 1)
    {
        if (abs(c[0] - c[1]) == K)
            add_or({pos(r[0], c[0])});
        else
            add_not(pos(r[0], c[0]));
        return;
    }
    if (c.size() == 1)
    {
        if (abs(r[0] - r[1]) == K)
            add_or({pos(r[0], c[0])});
        else
            add_not(pos(r[0], c[0]));
        return;
    }

    if (!add_not(pos(r[0], c[0])))
    {
        if (abs(r[0] - r[1]) + abs(c[0] - c[1]) == K)
            add_or({pos(r[0], c[0])});
        else
            add_not(pos(r[0], c[0]));
    }
    else
    {
        if (abs(r[0] - r[1]) + abs(c[0] - c[1]) == K)
            add_or({pos(r[0], c[1])});
        else
            add_not(pos(r[0], c[1]));
    }
}
/*
void Read()
{
}

void Solve()
{
}

int32_t main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    if (fopen("palesta.INP", "r"))
    {
        freopen("paletsa.inp", "r", stdin);
        freopen("palesta.out", "w", stdout);
    }
    int t(1);
    if (typetest)
        cin >> t;
    for (int _ = 1; _ <= t; ++_)
    {
        // cout << "Case #" << _ << ": ";
        Read();
        Solve();
    }
    // cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
}

/*
11
-1 4
-4 2
-5 0
0 0
-3 -2
1 -2
5 -2
2 -3
-1 -4
1 -4
3 -4
*/

Compilation message (stderr)

vision.cpp:109:1: warning: "/*" within comment [-Wcomment]
  109 | /*
      |  
vision.cpp: In function 'void read(T&)':
vision.cpp:13:18: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   13 |     register int c;
      |                  ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...