제출 #668603

#제출 시각아이디문제언어결과실행 시간메모리
668603alvingogo저울 (IOI15_scales)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #pragma GCC optimize("Ofast") #define AquA cin.tie(0);ios_base::sync_with_stdio(0); #define fs first #define sc second #define p_q priority_queue using namespace std; void init(int T){ } int fg(int a,int b,int c){ return getHeaviest(a,b,c); } int fm(int a,int b,int c){ return getMedian(a,b,c); } int fl(int a,int b,int c){ return getLightest(a,b,c); } int nx(int a,int b,int c,int d){ return getNextLightest(a,b,c,d); } vector<int> set(int a,int b,int c,int d){ vector<int> g(4); g[0]=a; g[1]=b; g[2]=c; g[3]=d; return g; } vector<int> sort4(int d,int e,int f,int a){ int x=fm(d,e,f); if(x!=d){ if(x==e){ swap(d,e); } else{ swap(d,f); } } int y=fs(a,d,e); if(y==e){ int z=nx(e,d,f,a); if(z==e){ return set(e,d,f,a); } else if(z==f){ return set(e,d,a,f); } else{ return set(e,a,d,f); } } else if(y==d){ int z=fb(d,e,a); if(z==e){ return set(f,d,a,e); } else{ return set(f,d,e,a); } } else{ int z=fm(a,f,d); if(z==a){ return set(f,a,d,e); } else if(z==f){ return set(a,f,d,e); } else{ return set(a,e,d,f); } } } void orderCoins(){ int a=fs(1,2,3); int b=fs(4,5,6); vector<int> x; for(int i=1;i<=6;i++){ if(i!=a && i!=b){ x.push_back(i); } } auto h=query(x[0],x[1],x[2],x[3]); auto y=query(a,b,x[0],x[1]); int ans[6]={0}; ans[0]=y[0]; ans[1]=y[1]; ans[2]=y[2]; ans[3]=y[3]; ans[4]=h[2]; ans[5]=h[3]; return ans; }

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

scales.cpp: In function 'void init(int)':
scales.cpp:9:15: warning: unused parameter 'T' [-Wunused-parameter]
    9 | void init(int T){
      |           ~~~~^
scales.cpp: In function 'int fg(int, int, int)':
scales.cpp:13:12: error: 'getHeaviest' was not declared in this scope
   13 |     return getHeaviest(a,b,c);
      |            ^~~~~~~~~~~
scales.cpp: In function 'int fm(int, int, int)':
scales.cpp:16:12: error: 'getMedian' was not declared in this scope
   16 |     return getMedian(a,b,c);
      |            ^~~~~~~~~
scales.cpp: In function 'int fl(int, int, int)':
scales.cpp:19:12: error: 'getLightest' was not declared in this scope
   19 |     return getLightest(a,b,c);
      |            ^~~~~~~~~~~
scales.cpp: In function 'int nx(int, int, int, int)':
scales.cpp:22:12: error: 'getNextLightest' was not declared in this scope
   22 |     return getNextLightest(a,b,c,d);
      |            ^~~~~~~~~~~~~~~
scales.cpp: In function 'std::vector<int> sort4(int, int, int, int)':
scales.cpp:4:12: error: 'first' was not declared in this scope
    4 | #define fs first
      |            ^~~~~
scales.cpp:42:11: note: in expansion of macro 'fs'
   42 |     int y=fs(a,d,e);
      |           ^~
scales.cpp:46:20: error: reference to 'set' is ambiguous
   46 |             return set(e,d,f,a);
      |                    ^~~
In file included from /usr/include/c++/10/set:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
                 from scales.cpp:1:
/usr/include/c++/10/bits/stl_set.h:94:11: note: candidates are: 'template<class _Key, class _Compare, class _Alloc> class std::set'
   94 |     class set
      |           ^~~
scales.cpp:24:13: note:                 'std::vector<int> set(int, int, int, int)'
   24 | vector<int> set(int a,int b,int c,int d){
      |             ^~~
scales.cpp:49:20: error: reference to 'set' is ambiguous
   49 |             return set(e,d,a,f);
      |                    ^~~
In file included from /usr/include/c++/10/set:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
                 from scales.cpp:1:
/usr/include/c++/10/bits/stl_set.h:94:11: note: candidates are: 'template<class _Key, class _Compare, class _Alloc> class std::set'
   94 |     class set
      |           ^~~
scales.cpp:24:13: note:                 'std::vector<int> set(int, int, int, int)'
   24 | vector<int> set(int a,int b,int c,int d){
      |             ^~~
scales.cpp:52:20: error: reference to 'set' is ambiguous
   52 |             return set(e,a,d,f);
      |                    ^~~
In file included from /usr/include/c++/10/set:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
                 from scales.cpp:1:
/usr/include/c++/10/bits/stl_set.h:94:11: note: candidates are: 'template<class _Key, class _Compare, class _Alloc> class std::set'
   94 |     class set
      |           ^~~
scales.cpp:24:13: note:                 'std::vector<int> set(int, int, int, int)'
   24 | vector<int> set(int a,int b,int c,int d){
      |             ^~~
scales.cpp:56:15: error: 'fb' was not declared in this scope; did you mean 'f'?
   56 |         int z=fb(d,e,a);
      |               ^~
      |               f
scales.cpp:58:20: error: reference to 'set' is ambiguous
   58 |             return set(f,d,a,e);
      |                    ^~~
In file included from /usr/include/c++/10/set:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
                 from scales.cpp:1:
/usr/include/c++/10/bits/stl_set.h:94:11: note: candidates are: 'template<class _Key, class _Compare, class _Alloc> class std::set'
   94 |     class set
      |           ^~~
scales.cpp:24:13: note:                 'std::vector<int> set(int, int, int, int)'
   24 | vector<int> set(int a,int b,int c,int d){
      |             ^~~
scales.cpp:61:20: error: reference to 'set' is ambiguous
   61 |             return set(f,d,e,a);
      |                    ^~~
In file included from /usr/include/c++/10/set:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
                 from scales.cpp:1:
/usr/include/c++/10/bits/stl_set.h:94:11: note: candidates are: 'template<class _Key, class _Compare, class _Alloc> class std::set'
   94 |     class set
      |           ^~~
scales.cpp:24:13: note:                 'std::vector<int> set(int, int, int, int)'
   24 | vector<int> set(int a,int b,int c,int d){
      |             ^~~
scales.cpp:67:20: error: reference to 'set' is ambiguous
   67 |             return set(f,a,d,e);
      |                    ^~~
In file included from /usr/include/c++/10/set:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
                 from scales.cpp:1:
/usr/include/c++/10/bits/stl_set.h:94:11: note: candidates are: 'template<class _Key, class _Compare, class _Alloc> class std::set'
   94 |     class set
      |           ^~~
scales.cpp:24:13: note:                 'std::vector<int> set(int, int, int, int)'
   24 | vector<int> set(int a,int b,int c,int d){
      |             ^~~
scales.cpp:70:20: error: reference to 'set' is ambiguous
   70 |             return set(a,f,d,e);
      |                    ^~~
In file included from /usr/include/c++/10/set:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
                 from scales.cpp:1:
/usr/include/c++/10/bits/stl_set.h:94:11: note: candidates are: 'template<class _Key, class _Compare, class _Alloc> class std::set'
   94 |     class set
      |           ^~~
scales.cpp:24:13: note:                 'std::vector<int> set(int, int, int, int)'
   24 | vector<int> set(int a,int b,int c,int d){
      |             ^~~
scales.cpp:73:20: error: reference to 'set' is ambiguous
   73 |             return set(a,e,d,f);
      |                    ^~~
In file included from /usr/include/c++/10/set:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:87,
                 from scales.cpp:1:
/usr/include/c++/10/bits/stl_set.h:94:11: note: candidates are: 'template<class _Key, class _Compare, class _Alloc> class std::set'
   94 |     class set
      |           ^~~
scales.cpp:24:13: note:                 'std::vector<int> set(int, int, int, int)'
   24 | vector<int> set(int a,int b,int c,int d){
      |             ^~~
scales.cpp: In function 'void orderCoins()':
scales.cpp:4:12: error: 'first' was not declared in this scope
    4 | #define fs first
      |            ^~~~~
scales.cpp:78:11: note: in expansion of macro 'fs'
   78 |     int a=fs(1,2,3);
      |           ^~
scales.cpp:86:12: error: 'query' was not declared in this scope
   86 |     auto h=query(x[0],x[1],x[2],x[3]);
      |            ^~~~~
scales.cpp:95:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
   95 |     return ans;
      |            ^~~