#include <bits/stdc++.h>
#include <gardenlib.h>
using namespace std;
#define scd(t) scanf("%d", &t)
#define scld(t) scanf("%ld", &t)
#define sclld(t) scanf("%lld", &t)
#define scc(t) scanf("%c", &t)
#define scs(t) scanf("%s", t)
#define scf(t) scanf("%f", &t)
#define sclf(t) scanf("%lf", &t)
#define forr(i, j, k) for (int i = j; i < k; i++)
#define frange(i, j) forr(i, 0, j)
#define all(cont) cont.begin(), cont.end()
#define mp make_pair
#define pb push_back
#define f first
#define s second
typedef long int li;
typedef unsigned long int uli;
typedef long long int lli;
typedef unsigned long long int ulli;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<lli> vll;
typedef vector<string> vs;
typedef vector<pii> vii;
typedef vector<vi> vvi;
typedef map<int, int> mpii;
typedef set<int> seti;
typedef multiset<int> mseti;
typedef long double ld;
void count_routes(int n, int m, int p, int edges[][2], int q, int stud[])
{
int k = stud[0];
vector<vii> graph(n);
frange(i, m)
{
int a = edges[i][0];
int b = edges[i][1];
int c = m - i;
graph[a].pb({b, c});
graph[b].pb({a, c});
}
int ans = 0;
frange(i, n)
{
int c = i;
int pre = -1;
frange(i, k)
{
int mv = 0;
int mid = -1;
for (auto p : graph[c])
{
if (p.f != pre)
{
if (p.s > mv)
{
mv = p.s;
mid = p.f;
}
}
}
if (mid == -1)
{
mid = graph[c][0].f;
}
int pre = c;
int c = mid;
}
if (c == p)
ans++;
}
answer(ans);
}
Compilation message
garden.cpp: In function 'void count_routes(int, int, int, int (*)[2], int, int*)':
garden.cpp:72:17: warning: unused variable 'pre' [-Wunused-variable]
72 | int pre = c;
| ^~~
garden.cpp:73:17: warning: unused variable 'c' [-Wunused-variable]
73 | int c = mid;
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |