Submission #486649

# Submission time Handle Problem Language Result Execution time Memory
486649 2021-11-12T08:47:43 Z alextodoran Navigation 2 (JOI21_navigation2) C++17
0 / 100
0 ms 196 KB
/**
 ____ ____ ____ ____ ____
||a |||t |||o |||d |||o ||
||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|

**/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int East = 0;
const int West = 1;
const int South = 2;
const int North = 3;
const int Finish = 4;

#include "Anna.h"

void SetFlag (int r, int c, int value);

void Anna (int N, int K, vector <int> R, vector <int> C)
{
    for(int r = 0; r < N; r++)
        for(int c = 0; c < N; c++)
        {
            int value = 0;
            for(int t = 0; t < K; t++)
            {
                value *= 5;
                if(r == R[t] && c == C[t])
                    value += Finish;
                else if(r < R[t])
                    value += South;
                else if(r > R[t])
                    value += North;
                else if(c < C[t])
                    value += East;
                else if(c > C[t])
                    value += West;
            }
            SetFlag(r, c, value + 1);
        }
}
/**
 ____ ____ ____ ____ ____
||a |||t |||o |||d |||o ||
||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|

**/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int East = 0;
const int West = 1;
const int South = 2;
const int North = 3;
const int Finish = 4;

#include "Bruno.h"

vector <int> Bruno (int K, vector <int> value)
{
    int mat[3][3];
    for(int i = 0; i < 3; i++)
        for(int j = 0; j < 3; j++)
            mat[i][j] = value[i * 3 + j - 1];

    vector <int> sol (K);
    for(int t = K - 1; t >= 0; t--)
    {
        sol[t] = mat[1][1] % 5;
        mat[1][1] /= 5;
    }

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