Submission #414836

# Submission time Handle Problem Language Result Execution time Memory
414836 2021-05-31T08:50:02 Z 조영욱(#7631) Navigation 2 (JOI21_navigation2) C++17
0 / 100
1 ms 320 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;
}
int arr[7]={1,3,9,27,81,243,729};
int val[100][100];
} // namespace

void Anna(int n,int k, vector<int> R, vector<int> C) {
    memset(val,0,sizeof(val));
    for(int ind=0;ind<k;ind++) {
        int x=R[ind];
        int y=C[ind];
        for(int i=0;i<x;i++) {
            val[i][y]+=2*arr[ind];
        }
        for(int i=0;i<n;i++) {
            for(int j=y+1;j<n;j++) {
                val[i][j]+=arr[ind];
            }
        }
    }
    for(int i=0;i<n;i++) {
        for(int j=0;j<n;j++) {
            SetFlag(i,j,val[i][j]+1);
        }
    }
}
#include "Bruno.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;

namespace {

int variable_example = 1;
int arr[7]={1,3,9,27,81,243,729};
} // namespace

vector<int> Bruno(int k,vector<int> value) {
    vector<int> v;
    for(int i=0;i<9;i++) {
        value[i]--;
    }
    for(int i=0;i<k;i++) {
        if (value[3]%3==value[5]%3) {
            if (value[3]%3==0) {
                v.push_back(0);
            }
            else {
                v.push_back(1);
            }
        }
        else if (value[3]%3==2&&value[5]%3==1) {
            v.push_back(1);
        }
        else if (value[3]%3==0&&value[5]%3==2) {
            v.push_back(0);
        }
        else if (value[1]%3==0) {
            v.push_back(3);
        }
        else if (value[4]%3==2) {
            v.push_back(2);
        }
        else {
            v.push_back(4);
        }
        for(int j=0;j<9;j++) {
            value[j]/=3;
        }
    }
    return v;
}

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}::arr' defined but not used [-Wunused-variable]
    9 | int arr[7]={1,3,9,27,81,243,729};
      |     ^~~
Bruno.cpp:8:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    8 | int variable_example = 1;
      |     ^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 320 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -