제출 #1334978

#제출 시각아이디문제언어결과실행 시간메모리
1334978SulA질문 (CEOI14_question_grader)C++20
0 / 100
490 ms39712 KiB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename T> using ordered_set = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

vector<int> josip[1000];

int encode(int n, int x, int y) {
    if (josip[1].empty()) {
        vector<int> b = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1};
        for (int i = 1; i <= n; i++) {
            josip[i] = b;
            ranges::next_permutation(b);
        }
    }
    for (int p = 0; p < 12; p++) {
        if (josip[x][p] && !josip[y][p]) {
            return p+1;
        }
    }
}
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename T> using ordered_set = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

vector<int> josip[1000];

int decode(int n, int q, int h) {
    if (josip[1].empty()) {
        vector<int> b = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1};
        for (int i = 1; i <= n; i++) {
            josip[i] = b;
            ranges::next_permutation(b);
        }
    }
    vector<int> b = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1};
    for (int i = 1; i <= n; i++) {
        josip[i] = b;
        ranges::next_permutation(b);
    }
    return josip[q][h];
}

컴파일 시 표준 에러 (stderr) 메시지

# 1번째 컴파일 단계

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:23:1: warning: control reaches end of non-void function [-Wreturn-type]
   23 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...