Submission #32165

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
321652017-09-29 09:47:39imeimi2000Last supper (IOI12_supper)C++14
100 / 100
116 ms17104 KiB
#include "advisor.h"
#include <vector>
#include <queue>
using namespace std;
typedef long long llong;
static vector<bool> used(100000, false);
static int nxt[100000];
static int pos[100000];
struct col {
int color;
int next;
bool operator<(const col &x) const {
return next < x.next;
}
};
static priority_queue<col> pq;
static vector<int> work[100000];
static int top[100000];
void ComputeAdvice(int *c, int n, int k, int m) {
for (int i = 0; i < n; ++i) pos[i] = -1, nxt[i] = n;
for (int i = 0; i < n; ++i) {
if (pos[c[i]] == -1) {
pos[c[i]] = i;
if (c[i] < k)
pq.push({ c[i], i });
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

advisor.cpp: In function 'void ComputeAdvice(int*, int, int, int)':
advisor.cpp:61:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (top[j] == work[j].size()) WriteAdvice(1);
       ~~~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...