Submission #421937

# Submission time Handle Problem Language Result Execution time Memory
421937 2021-06-09T13:57:54 Z lyc Navigation 2 (JOI21_navigation2) C++17
0 / 100
0 ms 192 KB
#include "Anna.h"
#include <vector>

#include <bits/stdc++.h>
using namespace std;

#define TRACE(x) cerr << #x << " :: " << x << endl
#define _ << " " <<
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for(int i=(a);i>=(b);--i)

namespace {
} // namespace

void Anna(int N, int K, std::vector<int> R, std::vector<int> C) {
    for (int r = 0; r < N; r++) {
        for (int c = 0; c < N; c++) {
            //SetFlag(r, c, FunctionExample(r, c, K));

            int flag = 0;
            FOR(k,0,K-1){
                flag |= ((c <= C[k]) | ((r <= R[k])<<1)) << (k*2);
            }

            SetFlag(r,c,1+flag);

            //FOR(k,0,K-1) if (r==R[k] && c==C[k]) { cout << "["<<k<<"]"; }
            //cout << flag << ' ';
        }
        //cout << endl;
    }
}
#include "Bruno.h"
#include <vector>

#include <bits/stdc++.h>
using namespace std;

#define TRACE(x) cerr << #x << " :: " << x << endl
#define _ << " " <<
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for(int i=(a);i>=(b);--i)

namespace {
} // namespace

std::vector<int> Bruno(int K, std::vector<int> value) {
    std::vector<int> res(K, 0);
    for (int& x : value) --x;
    for (int i = 0; i < K; i++) {
        // a-1, b-1
        // a-1, b
        // a-1, b+1
        int cur = value[4] >> (i*2);

        // EWSN .
        res[i] = 4;
        if ((cur&1) && ((value[5]>>(i*2))&1)) res[i] = 0;
        if (!(cur&1)) res[i] = 1;
        if ((cur&2) && ((value[7]>>(i*2))&2)) res[i] = 2;
        if (!(cur&2)) res[i] = 4;
    }

    //FOR(i,0,2){ FOR(j,0,2){ cout << value[i*3+j] << ' '; } cout << endl; }
    //FOR(i,0,K-1){ cout << res[i] << ' '; } cout << endl;

    return res;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 192 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -