답안 #721680

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
721680 2023-04-11T06:32:08 Z OttincaM Art Collections (BOI22_art) C++17
0 / 100
1 ms 208 KB
#include <iostream>
#include <chrono>
#include <random>
#include <iomanip>
#include <algorithm>
#include <utility>
#include <fstream>
#include <numeric>
#include <sstream>
#include <functional>
#include <memory.h>

#include <vector>
#include <map>
#include <set>
#include <deque>
#include <string>
#include <queue>
#include <array>
#include <stack>
#include <bitset>
#include <unordered_set>
#include <unordered_map>

#include <ctime>
#include <cmath>
#include <climits>
#include "stdio.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>

#include "art.h"

using namespace std;



void solve(int N){
    int n = N;
    vector <int> fnd;
    fnd.push_back(1);
    int CCC = -1;
    for(int i = 2; i <= n; i ++){
        vector <int> f, s = fnd;

        f.push_back(i);
        for(int &t: fnd) f.push_back(t);
        s.push_back(i);

        for(int j = i + 1; j <= n; j ++){
            f.push_back(j);
            s.push_back(j);
        }
        
        int x = publish(f), y = -1;
        if(CCC == -1){
            y = publish(s);
            CCC = y;
        }
        else {
            y = CCC;
        }

        bool ch = 0;
        vector <int> nwf;
        for(int j = 1; j <= i - 1; j ++){
            int X = j - 1, Y = i - 1 - X;
            if(!ch && X - Y == x - y){
                ch = 1;
                nwf.push_back(i);
                CCC -= x - X;
            }
            nwf.push_back(fnd[j - 1]);
        }
        if(!ch) nwf.push_back(i), CCC = x - (i - 1);
        fnd = nwf;
    }
    answer(fnd);
}


Compilation message

interface.cpp: In function 'int publish(std::vector<int>)':
interface.cpp:20:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~
interface.cpp: In function 'void answer(std::vector<int>)':
interface.cpp:36:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   36 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
3 Incorrect 1 ms 208 KB Not correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
3 Incorrect 1 ms 208 KB Not correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
3 Incorrect 1 ms 208 KB Not correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
3 Incorrect 1 ms 208 KB Not correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
3 Incorrect 1 ms 208 KB Not correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
3 Incorrect 1 ms 208 KB Not correct
4 Halted 0 ms 0 KB -