제출 #1130581

#제출 시각아이디문제언어결과실행 시간메모리
1130581lopkusArt Collections (BOI22_art)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "art.h" #define int long long using namespace std; int n; //vector<int> b(4001); vector<int> a(4001); /* int publish(vector<int> R) { int x = 0; for(int i = 0; i < n; i++) { if(a[i] > b[i]) { x += 1; } } return x; } void answer(vector<int> R) { cout << "! "; for(int i = 0; i < n; i++) { cout << R[i] << " "; } } */ signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n; for(int i = 0; i < n; i++) { //cin >> b[i]; } for(int i = 0; i < n; i++) { a[i] = i + 1; } while(1) { int u = publish(a); if(!u) { answer(a); return 0; } for(int i = 0; i < n; i++) { for(int j = i + 1; j < n; j++) { swap(a[i], a[j]); int k = publish(a); if(k < u) { // stay } else { swap(a[i], a[j]); } } } } }

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

art.cpp: In function 'int main()':
art.cpp:43:25: error: could not convert 'a' from 'vector<long long int>' to 'vector<int>'
   43 |         int u = publish(a);
      |                         ^
      |                         |
      |                         vector<long long int>
art.cpp:45:20: error: could not convert 'a' from 'vector<long long int>' to 'vector<int>'
   45 |             answer(a);
      |                    ^
      |                    |
      |                    vector<long long int>
art.cpp:51:33: error: could not convert 'a' from 'vector<long long int>' to 'vector<int>'
   51 |                 int k = publish(a);
      |                                 ^
      |                                 |
      |                                 vector<long long int>