Submission #288968

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2889682020-09-02 08:42:35BertedTeams (IOI15_teams)C++14
21 / 100
35 ms8320 KiB
#include "teams.h"
#include <iostream>
#include <utility>
#include <algorithm>
#include <vector>
#include <bitset>
#include <queue>
#define pii pair<int, int>
#define fst first
#define snd second
const int SZ = (1 << 20) + 5, SZ2 = 500005;
using namespace std;
struct p_node
{
int v = 0, l = -1, r = -1;
p_node() {}
};
int n; pii a[105];
priority_queue<pii, vector<int>, greater<int>> pq;
void init(int N, int A[], int B[])
{
n = N;
for (int i = 0; i < N; i++) {a[i] = {A[i], B[i]};}
sort(a, a + N);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

teams.cpp: In function 'int can(int, int*)':
teams.cpp:41:17: warning: comparison of integer expressions of different signedness: 'std::priority_queue<std::pair<int, int>, std::vector<int>, std::greater<int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   41 |   if (pq.size() < K[i]) {return 0;}
      |       ~~~~~~~~~~^~~~~~
teams.cpp:42:18: warning: declaration of 'j' shadows a previous local [-Wshadow]
   42 |   else {for (int j = 0; j < K[i]; j++) {pq.pop();}}
      |                  ^
teams.cpp:36:6: note: shadowed declaration is here
   36 |  int j = 0;
      |      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...