제출 #419781

#제출 시각아이디문제언어결과실행 시간메모리
419781PbezzScales (IOI15_scales)C++14
컴파일 에러
0 ms0 KiB
#define ll long long
#define pb push_back
typedef pair<ll,ll> pii;

typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

const ll MAXN = 2e5+5;
const ll INF = 1e15+7;

void init(int T) {
    /* ... */
}

void orderCoins() {
    /* ... */
    int W[] = {1, 2, 3, 4, 5, 6};

	int m1,m2,m,i,j;
	m1 = getLightest(1,2,3);
	m2 = getLightest(4,5,6);


	if(m1==1){
	m = getLightest(m1,m2,2);
	}else{
	m = getLightest(m1,m2,1);
	}
	swap(W[m-1],W[1]);

	for(i=1;i<6;i++){
	for(j=i+1;j<6;j++){

	if(getMedian(m,j-1,j)==j&&j!=2){
	swap(W[j-2],W[j-1]);
	}

	}
}











    answer(W);
}

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

scales.cpp:3:9: error: 'pair' does not name a type
    3 | typedef pair<ll,ll> pii;
      |         ^~~~
scales.cpp:5:9: error: 'tree' does not name a type
    5 | typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
      |         ^~~~
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:19:7: error: 'getLightest' was not declared in this scope
   19 |  m1 = getLightest(1,2,3);
      |       ^~~~~~~~~~~
scales.cpp:28:2: error: 'swap' was not declared in this scope
   28 |  swap(W[m-1],W[1]);
      |  ^~~~
scales.cpp:33:5: error: 'getMedian' was not declared in this scope
   33 |  if(getMedian(m,j-1,j)==j&&j!=2){
      |     ^~~~~~~~~
scales.cpp:50:5: error: 'answer' was not declared in this scope
   50 |     answer(W);
      |     ^~~~~~