Submission #933624

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9336242024-02-26 01:47:25vjudge1Speedrun (RMI21_speedrun)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "speedrun.h"
using namespace std;
using vi = vector <int>;
void assignHints (int subtask, int n, int u[], int v[]) {
if (subtask==1){setHintLen(n);
for (int i = 1; i <= n-1; i++) {
setHint(u[i], v[i], true);
setHint(v[i], u[i], true);
}
return;
}
if (subtask==2) {
setHintLen(20);
int freq[n+1]{};
for (int i=1; i <= n-1; i++) {
freq[u[i]]++;
freq[v[i]]++;
}
int u = max_element(freq, freq+n+1)-freq;
for (int i=1; i <= n; i++) {
for (int bit=0; bit < 20; bit++) {
setHint(i, bit+1, u>>bit&1);
}
}
return;}
bool vis[n+5]{};
vi adj[n+5];
for (int i = 1; i <= n-1; i++) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

speedrun.cpp: In function 'void assignHints(int, int, int*, int*)':
speedrun.cpp:35:9: error: 'freq' was not declared in this scope; did you mean 'free'?
   35 |         freq[u[i]]++;
      |         ^~~~
      |         free
speedrun.cpp:38:9: error: declaration of 'int u' shadows a parameter
   38 |     int u = min_element(freq, freq+n+1)-freq;
      |         ^
speedrun.cpp:6:43: note: 'int* u' previously declared here
    6 | void assignHints (int subtask, int n, int u[], int v[]) {
      |                                       ~~~~^~~
speedrun.cpp:38:25: error: 'freq' was not declared in this scope; did you mean 'free'?
   38 |     int u = min_element(freq, freq+n+1)-freq;
      |                         ^~~~
      |                         free
speedrun.cpp: In function 'void speedrun(int, int, int)':
speedrun.cpp:103:21: error: 'u' was not declared in this scope
  103 |             if (vis[u]) continue;
      |                     ^