제출 #608701

#제출 시각아이디문제언어결과실행 시간메모리
608701loctildore저울 (IOI15_scales)C++14
55.56 / 100
1 ms292 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; // trans rights #define ll long long #define f first #define s second #define endl '\n' #define all(x) begin(x), end(x) void init(int T) {} int a,b,c,tmp; vector<int> v1,v2,v3,v4; vector<int> v; void srt(int &x, int &y, int &z) { tmp=getLightest(x,y,z); if (y==tmp) { swap(x,y); } if (z==tmp) { swap(x,z); } tmp=getMedian(x,y,z); if (z==tmp) { swap(y,z); } } void orderCoins() { a=2,b=3,c=5; vector<int> v1,v2,v3,v4; vector<int> v={1,4,6}; srt(a,b,c); srt(v[0],v[1],v[2]); bool flag=false; for (auto i : v) { if (!flag) { tmp=getMedian(a,b,i); if (tmp==a) { v1.push_back(i); } if (tmp==i) { v2.push_back(i); } if (tmp==b) { flag=true; } } if (flag) { tmp=getMedian(b,c,i); if (tmp==i) { v3.push_back(i); } else { v4.push_back(i); } } } vector<int> ans; for (auto i:v1) ans.push_back(i); ans.push_back(a); for (auto i:v2) ans.push_back(i); ans.push_back(b); for (auto i:v3) ans.push_back(i); ans.push_back(c); for (auto i:v4) ans.push_back(i); answer(&ans[0]); }

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

scales.cpp: In function 'void init(int)':
scales.cpp:10:15: warning: unused parameter 'T' [-Wunused-parameter]
   10 | void init(int T) {}
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:29:17: warning: declaration of 'v1' shadows a global declaration [-Wshadow]
   29 |     vector<int> v1,v2,v3,v4;
      |                 ^~
scales.cpp:12:13: note: shadowed declaration is here
   12 | vector<int> v1,v2,v3,v4;
      |             ^~
scales.cpp:29:20: warning: declaration of 'v2' shadows a global declaration [-Wshadow]
   29 |     vector<int> v1,v2,v3,v4;
      |                    ^~
scales.cpp:12:16: note: shadowed declaration is here
   12 | vector<int> v1,v2,v3,v4;
      |                ^~
scales.cpp:29:23: warning: declaration of 'v3' shadows a global declaration [-Wshadow]
   29 |     vector<int> v1,v2,v3,v4;
      |                       ^~
scales.cpp:12:19: note: shadowed declaration is here
   12 | vector<int> v1,v2,v3,v4;
      |                   ^~
scales.cpp:29:26: warning: declaration of 'v4' shadows a global declaration [-Wshadow]
   29 |     vector<int> v1,v2,v3,v4;
      |                          ^~
scales.cpp:12:22: note: shadowed declaration is here
   12 | vector<int> v1,v2,v3,v4;
      |                      ^~
scales.cpp:30:17: warning: declaration of 'v' shadows a global declaration [-Wshadow]
   30 |     vector<int> v={1,4,6};
      |                 ^
scales.cpp:13:13: note: shadowed declaration is here
   13 | vector<int> v;
      |             ^
#Verdict Execution timeMemoryGrader output
Fetching results...