제출 #140374

#제출 시각아이디문제언어결과실행 시간메모리
140374SirCeness팀들 (IOI15_teams)C++14
34 / 100
4089 ms46324 KiB
#include "teams.h"
#include <bits/stdc++.h>

#define pb push_back
#define mp make_pair
#define inside sl<=l&&r<=sr
#define outside r<sl||sr<l
#define orta ((l+r)>>1)
#define INF 1000000009
#define mod 1000000007
#define ppair(x); cerr << "(" << x.first << ", " << x.second << ")\n";
#define bas(x) #x << ": " << x << " "
#define prarr(x, n); cerr << #x << ": "; for(int qsd = 0; qsd < n; qsd++) cerr << x[qsd] << " "; cerr << "\n";
#define prarrv(x); cerr << #x << ": "; for(int qsd = 0; qsd < (int)x.size(); qsd++) cerr << x[qsd] << " "; cerr << "\n";
using namespace std;
typedef long long ll;

int n;
vector<list<int> > arr;

void init(int N, int A[], int B[]){
	n = N;
	arr.resize(n+1);
	for (int i = 0; i < n; i++){
		arr[A[i]].pb(B[i]);
	}
}

void prset(multiset<int> cur){
	for (int a: cur) cout << a << " "; cout << endl;
}

int can(int M, int K[]){
	multiset<int> cur;
	int ki = 0;
	sort(K, K+M);
	for (int i = 1; i <= n; i++){
		for (int a: arr[i]){
			cur.insert(a);
		}
		//prset(cur);
		while (ki != M && K[ki] == i){
			for (int q = 0; q < i; q++){
				if (cur.size() == 0) return 0;
				cur.erase(cur.begin());
			}
			ki++;
		}
		while (cur.size() > 0 && *cur.begin() <= i) cur.erase(cur.begin());
	}
	return 1;
}

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

teams.cpp: In function 'void prset(std::multiset<int>)':
teams.cpp:30:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
  for (int a: cur) cout << a << " "; cout << endl;
  ^~~
teams.cpp:30:37: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
  for (int a: cur) cout << a << " "; cout << endl;
                                     ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...