제출 #115516

#제출 시각아이디문제언어결과실행 시간메모리
115516E869120팀들 (IOI15_teams)C++14
34 / 100
4014 ms21240 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; int N; vector<int>G[1 << 17]; void init(int n, int A[], int B[]) { N = n; for (int i = 0; i < N; i++) G[A[i]].push_back(B[i]); } int can(int M, int K[]) { priority_queue<int, vector<int>, greater<int>>Q; sort(K, K + M); int cx = 0; for (int i = 0; i < M; i++) { for (int j = cx + 1; j <= K[i]; j++) { for (int k = 0; k < G[j].size(); k++) Q.push(G[j][k]); } while (!Q.empty()) { int pos = Q.top(); if (pos < K[i]) Q.pop(); else break; } for (int j = 0; j < K[i]; j++) { if (Q.empty()) return 0; Q.pop(); } cx = K[i]; } return 1; }

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

teams.cpp: In function 'int can(int, int*)':
teams.cpp:19:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int k = 0; k < G[j].size(); k++) Q.push(G[j][k]);
                    ~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...