Submission #249220

#TimeUsernameProblemLanguageResultExecution timeMemory
249220blacktulipShell (info1cup18_shell)C++17
10 / 100
1090 ms12160 KiB
#include <bits/stdc++.h> using namespace std; typedef long long lo; typedef pair< lo,lo > PII; #define fi first #define se second #define mp make_pair #define endl "\n" #define pb push_back #define int long long #define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define FOR for(int i=1;i<=n;i++) #define mid ((start+end)/2) #define ort ((bas+son)/2) const lo inf = 1000000000000000000; const lo KOK = 100000; const lo LOG = 30; const lo li = 500005; const lo mod = 1000000007; int n,m,b[li],a[li],k,flag,t,dp[1505]; int cev; string s; vector<int> v[li]; inline int add(int x,int y){ if(x+y>=mod)return x+y-mod; return x+y; } inline void f(int sira,int gel){ //~ int cevv=0; int use=gel; if(a[use]==sira)use++; if(sira==n){ if(use>k)cev=add(cev,1); //~ return 0; } //~ if(~dp[sira])return dp[sira]; for(int i=0;i<(int)v[sira].size();i++){ int go=v[sira][i]; f(go,use); } //~ return dp[sira]=cevv; } inline int mul(int x,int y){ return (x%mod)*(y%mod)%mod; } main(void){ memset(dp,-1,sizeof(dp)); scanf("%lld %lld %lld",&n,&m,&k); for(int i=1;i<=k;i++){ scanf("%lld",&a[i]); } //~ sort(a+1,a+n+1); for(int i=1;i<=m;i++){ int x,y; //~ if(vis[x][y])continue; scanf("%lld %lld",&x,&y); v[x].pb(y); //~ v[y].pb(x); } f(1,1); printf("%lld\n",cev); return 0; }

Compilation message (stderr)

shell.cpp:55:10: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(void){
          ^
shell.cpp: In function 'int main()':
shell.cpp:57:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld %lld %lld",&n,&m,&k);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
shell.cpp:59:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld",&a[i]);
   ~~~~~^~~~~~~~~~~~~~
shell.cpp:65:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld %lld",&x,&y);
   ~~~~~^~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...