Submission #59625

#TimeUsernameProblemLanguageResultExecution timeMemory
59625reality저울 (IOI15_scales)C++17
15.15 / 100
3 ms640 KiB
#include "scales.h"
#include "bits/stdc++.h"
using namespace std;
#define fi first
#define se second
#define ll long long
#define dbg(v) cerr<<#v<<" = "<<v<<'\n'
#define vi vector<int>
#define vl vector <ll>
#define pii pair<int,int>
#define mp make_pair
#define db long double
#define pb push_back
#define all(s) s.begin(),s.end()
template < class T > T smin(T &a,T b) {if (a > b) a = b;return a;}
template < class T > T smax(T &a,T b) {if (a < b) a = b;return a;}

//getHeaviest
//getLightest
//getMedian
//getNextLightest
void init(int T) {
	return;
}
/*int dp[1 << 24];
int fr[1 << 24];
const int N = 14348907;
const int p3[] = {1, 3, 9, 27, 81, 243, 729, 2187, 6561, 19683, 59049, 177147, 531441, 1594323, 4782969};
*/

int h[8][8];

void orderCoins() {
	memset(h,0,sizeof(h));
    for (int i = 2;i <= 6;++i)
    	for (int j = i + 1;j <= 6;++j) {
    		int k = 1;
    		int a = getLightest(i,j,k);
    		int b = getMedian(i,j,k);
    		int c = i + j + k - a - b;
    		if (i == a || (i == b && j == c))
    			h[i][j] = 1;
    		else
    			h[j][i] = 1;
    		if (a == 1)
    			h[1][i] = h[1][j] = 1;
    		else
    		if (b == 1)
    			h[1][c] = h[a][1] = 1;
    		else
    			h[a][1] = h[b][1] = 1;
    	}
    vi p(6);
    for (int i = 0;i < 6;++i)
    	p[i] = i + 1;
    sort(all(p),[&](int x,int y) {
    		return h[x][y];
    	});
    answer(p.data());
}

Compilation message (stderr)

In file included from grader.c:2:0:
graderlib.c: In function 'void answer(int*)':
graderlib.c:53:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (_ghksjhdfkae19ga_ > 1) 
     ^~
graderlib.c:56:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  for (i = 0; i < 6; i++) {
  ^~~
scales.cpp: In function 'void init(int)':
scales.cpp:22:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
#Verdict Execution timeMemoryGrader output
Fetching results...