제출 #1184894

#제출 시각아이디문제언어결과실행 시간메모리
1184894sano저울 (IOI15_scales)C++20
컴파일 에러
0 ms0 KiB
//#pragma GCC optimize("O3") //#pragma GCC target("tune=native") //#pragma GCC optimize("O3,unroll-loops") //#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #include "scales.h" #include<iostream> #include<vector> #include<queue> #include<deque> #include<string> #include<fstream> #include<algorithm> #include <iomanip> #include<map> #include <set> #include <unordered_map> #include <stack> #include <unordered_set> #include <cmath> #include <cstdint> #include <cassert> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> #define shit short int #define ll long long //#define int ll #define For(i, n) for(int i = 0; i < (int)n; i++) #define ffor(i, a, n) for(int i = (int)a; i < (int)n; i++) #define rfor(i, n) for(int i = (int)n; i >= (int)0; i--) #define rffor(i, a, n) for(int i = (int)n; i >= (int)a; i--) #define vec vector #define ff first #define ss second #define pb push_back #define pii pair<int, int> #define NEK 2000000000 #define mod 1000000007 #define mod2 1000000009 #define rsz resize #define prv1 47 #define prv2 43 #define D 8 #define trav(a,x) for (auto& a: x) #define pb push_back #define ub upper_bound #define lb lower_bound #define all(x) (x).begin(), (x).end() #define sig 0.0000001 using namespace std; //using namespace __gnu_pbds; //template <typename T1, typename T2> //using indexed_set = tree<pair<T1, T2>, null_type, less<pair<T1, T2>>, rb_tree_tag, tree_order_statistics_node_update>; void init(int t) { return; } void orderCoins() { int n = 6; vec<int> p = { 0, 1, 2, 3, 4, 5 }; For(i, n - 2) { int som = i; for (int j = i + 1; j < n; j += 2) { int j2 = j + 1; if (j2 >= n) j2 = j - 1; int novy = getHeaviest(p[i], p[j], p[j2]); if (novy == p[i]) continue; if (novy == p[j]) { swap(p[i], p[j]); } if (novy == p[j2]) { swap(p[i], p[j2]); } } } int novy = getLightest(p[n - 1], p[n - 2], p[n - 3]); if (novy == p[n - 2]) swap(p[n - 1], p[n - 2]); answer(p); return; } /* signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; t = 1; For(i, t) { int n, d, start; cin >> n >> d >> start; int a[100]; For(i, n) cin >> a[i]; cout << findMaxAttraction(n, start, d, a); } return 0; }*/

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

scales.cpp: In function 'void orderCoins()':
scales.cpp:82:16: error: cannot convert 'std::vector<int>' to 'int*'
   82 |         answer(p);
      |                ^
      |                |
      |                std::vector<int>
In file included from scales.cpp:6:
scales.h:10:17: note:   initializing argument 1 of 'void answer(int*)'
   10 | void answer(int W[]);
      |             ~~~~^~~