제출 #1330159

#제출 시각아이디문제언어결과실행 시간메모리
1330159nicolo_010Navigation 2 (JOI21_navigation2)C++20
7 / 100
497 ms900 KiB
#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;

int direction(int i, int j, int r, int c) {
    int ans=4;
    //0 = east, 1=west, 2 = south, 3=north
    if (r<i) ans = 3;
    if (i<r) ans = 2;
    if (j>c) ans = 1;
    if (j<c) ans = 0;
    return ans;
}

bool flag = false;

int f(vector<int> &num) {
    int pw = 1;
    int ans=0;
    for (auto x : num) {
        //if (flag)cout << x << " " << pw << endl;
        ans += x*pw;
        pw *= 10;
    }
    return ans;
}

void Anna(int n, int K, std::vector<int> R, std::vector<int> C) {
    flag = false;
    for (int i=0; i<n; i++) {
        for (int j=0; j<n; j++) {
            flag = false;
            vector<int> vals;
            for (int c=0; c<K; c++) {
                vals.push_back(direction(i, j, R[c], C[c]));
            }
            vals.push_back(1);
            SetFlag(i, j, f(vals));
        }
    }
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

std::vector<int> Bruno(int K, std::vector<int> value) {
    vector<int> ans;
    int num = value[4];
    //cout << num << " " << endl;
    for (int i=0; i<K; i++) {
        ans.push_back(num%10);
        num /= 10;
    }
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...