제출 #946143

#제출 시각아이디문제언어결과실행 시간메모리
946143Nika533저울 (IOI15_scales)C++14
27.82 / 100
1 ms600 KiB
#pragma GCC diagnostic warning "-std=c++11" #include <bits/stdc++.h> #include "scales.h" #define pb push_back #define f first #define s second #define MOD 1000000007 #define flush fflush(stdout) #define all(x) (x).begin(),(x).end() #define allr(x) (x).rbegin(), (x).rend() #define pii pair<int,int> using namespace std; int n,m,k; void init(int T) { } int check(int a, int arr[]) { int sz=a-1; int x=getNextLightest(arr[sz-3],arr[sz-2],arr[sz-1],a); if (x==arr[sz-1]) { if (getHeaviest(arr[sz-2],arr[sz-1],a)==a) { if (a==4) { x=-1; } else { x=getNextLightest(arr[0],arr[1],arr[2],a); if (x==arr[2]) { if (getHeaviest(arr[0],arr[1],a)==a) { x=-1; } } } } } int indd=x; for (int i=0; i<sz; i++) if (arr[i]==x) indd=i; return indd; } void orderCoins() { int w[6]; int a[3]; int lb; a[2]=getLightest(1,2,3); a[1]=getMedian(1,2,3); a[0]=getHeaviest(1,2,3); int x=check(4,a); int b[4],ind=0; for (int i=0; i<3; i++) { if (x==i-1) { b[ind]=4; ind++; } b[ind]=a[i]; ind++; } if (x==2) b[3]=4; int y=check(5,b); int c[5]; ind=0; for (int i=0; i<4; i++) { if (y==i-1) { c[ind]=5; ind++; } c[ind]=b[i]; ind++; } if (y==3) c[4]=5; int z=check(6,c); ind=0; for (int i=0; i<5; i++) { if (z==i-1) { w[ind]=6; ind++; } w[ind]=c[i]; ind++; } if (z==4) w[5]=6; reverse(w,w+6); answer(w); }

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

scales.cpp:1:32: warning: '-std=c++11' is not an option that controls warnings [-Wpragmas]
    1 | #pragma GCC diagnostic warning "-std=c++11"
      |                                ^~~~~~~~~~~~
scales.cpp: In function 'void init(int)':
scales.cpp:15:15: warning: unused parameter 'T' [-Wunused-parameter]
   15 | void init(int T) {
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:44:6: warning: unused variable 'lb' [-Wunused-variable]
   44 |  int lb;
      |      ^~
#Verdict Execution timeMemoryGrader output
Fetching results...