#include "garden.h"
#include "gardenlib.h"
#include <bits/stdc++.h>
using namespace std;
#define REP(a,b,c) for(int a=b;a<c;a++)
#define F first
#define S second
#define PB push_back
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int,int> pi;
vii a,b,c;
int k=0;
void solve(int x){
REP(i,1,k){
int p=b[x][i-1];
int q=b[x][i];
if(a[q].size()==1){
b[x][i+1]=a[q][0];
continue;
}
if(a[q].front()==p){
b[x][i+1]=a[q][1];
continue;
}
else{
b[x][i+1]=a[q][0];
continue;
}
}
}
void count_routes(int n, int m, int P, int R[][2], int Q, int G[])
{
a.resize(n);
b.resize(n,vi(G[0]+1));
k=G[0];
REP(i,0,n){
b[i][0]=i;
b[i][1]=a[i].front();
}
REP(i,0,n)solve(i);
int ans=0;
REP(i,0,n)if(b[i][G[0]]==P)ans++;
answer(ans);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
1112 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
1112 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
1112 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |