제출 #744557

#제출 시각아이디문제언어결과실행 시간메모리
744557Abrar_Al_Samit저울 (IOI15_scales)C++17
컴파일 에러
0 ms0 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; mt19937 rng(chrono::system_clock::now().time_since_epoch().count()); void init(int T) { } void orderCoins() { int a[6] = {1, 2, 3, 4, 5, 6}; //random_shuffle(a, a+6); solve3(&a[0]); solve3(&a[3]); if(getLightest(a[0], a[1], a[3])==a[3]) { swap(a[0], a[3]); swap(a[1], a[4]); swap(a[2], a[5]); } int before = getNextLightest(a[0], a[1], a[2], a[3]); if(before==a[1]) { swap(a[2], a[3]); swap(a[1], a[2]); } else if(before==a[2]) { swap(a[2], a[3]); } else { return a; } before = getNextLightest(a[1], a[2], a[3], a[4]); if(before==a[2]) { swap(a[3], a[4]); swap(a[2], a[3]); } else if(before==a[3]) { swap(a[3], a[4]); } else { return a; } return a; }

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

scales.cpp: In function 'void init(int)':
scales.cpp:6:15: warning: unused parameter 'T' [-Wunused-parameter]
    6 | void init(int T) {
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:15:5: error: 'solve3' was not declared in this scope
   15 |     solve3(&a[0]);
      |     ^~~~~~
scales.cpp:31:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
   31 |         return a;
      |                ^
scales.cpp:41:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
   41 |         return a;
      |                ^
scales.cpp:43:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
   43 |     return a;
      |            ^