답안 #893765

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
893765 2023-12-27T11:14:36 Z danikoynov Navigation 2 (JOI21_navigation2) C++17
0 / 100
0 ms 332 KB
#include "Anna.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
namespace
{

int FunctionExample(int r, int c, int K)
{
    return (r + c) % K + 1;
}

} // namespace

const int maxn = 310;

int value[maxn][maxn];
void Anna(int N, int K, std::vector<int> R, std::vector<int> C)
{
    for (int i = 0; i < K; i ++)
    {
        for (int x = 0; x < R[i]; x ++)
            for (int y = 0; y < N; y ++)
        {
            value[x][y] |= (1 << i);
        }

        for (int y = C[i] - 1; y >= 0; y -= 2)
        {
            value[R[i]][y] |= (1 << i);
        }
        value[R[i]][C[i]] |= (1 << i);
    }

    for (int i = 0; i < N; i ++)
        for (int j = 0; j < N; j ++)
        SetFlag(i, j, value[i][j] + 1);

    /**for (int i = 0; i < N; i ++, cout << endl)
        for (int j = 0; j < N; j ++)
        cout << value[i][j] << " ";
    cout << endl;*/
}
#include "Bruno.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;

namespace
{

int variable_example = 1;

} // namespace


std::vector<int> Bruno(int K, std::vector<int> value)
{
    ///cout << "BRUNO" << endl;
    for (int i = 0; i < 9; i ++)
        value[i] --;
    vector < int > res;
    for (int i = 0; i < K; i ++)
    {
        ///cout << "step " << i << endl;
        int var[9];
        for (int j = 0; j < 9; j ++)
            var[j] = (value[j] & (1 << i));
        /**for (int j = 0; j < 9; j ++)
            cout << var[j] << " ";
        cout << endl;*/
        if (var[3] && var[4] && var[5])
        {
            res.push_back(2);
            continue;
        }

        if (!var[3] && !var[4] && !var[5] && (var[0] == 0 || var[1] == 0 || var[2] == 0))
        {
            res.push_back(3);
            continue;
        }

        if (var[4])
        {
            if (var[3])
            {
                res.push_back(4);
                continue;
            }

            res.push_back(0);
        }
        else
        {
            if (var[5])
                res.push_back(0);
            else
                res.push_back(1);
        }
    }

    return res;
}

Compilation message

Anna.cpp:8:5: warning: 'int {anonymous}::FunctionExample(int, int, int)' defined but not used [-Wunused-function]
    8 | int FunctionExample(int r, int c, int K)
      |     ^~~~~~~~~~~~~~~

Bruno.cpp:9:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    9 | int variable_example = 1;
      |     ^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 332 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -