# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
45557 | IvanC | Shell (info1cup18_shell) | C++17 | 569 ms | 41260 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 1e6 + 10;
const ll MOD = 1e9 + 7;
vector<int> grafo[MAXN],especiais;
int nivel[MAXN],grau[MAXN],N,M,P,marcado[MAXN],nivelatual,alvo;
ll dp[MAXN];
ll solve(int v){
if(nivel[v] > nivelatual) return 0;
if(nivel[v] == nivelatual && v != alvo) return 0;
if(dp[v] != -1) return dp[v];
ll tot = 0;
for(int u : grafo[v]){
tot += solve(u);
}
return dp[v] = (tot % MOD);
}
int main(){
memset(dp,-1,sizeof(dp));
scanf("%d %d %d",&N,&M,&P);
especiais.push_back(1);
for(int i = 1;i<=P;i++){
int v;
scanf("%d",&v);
if(v != 1) especiais.push_back(v);
}
if(especiais.back() != N) especiais.push_back(N);
for(int i = 1;i<=M;i++){
int u,v;
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |