Submission #854391

#TimeUsernameProblemLanguageResultExecution timeMemory
854391Tenis0206Fishing Game (RMI19_fishing)C++11
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; const int nmax = 100; const int Mod = 1e9 + 7; void solve_test() { for(int i=1;i<=2*n;i++) { int x; cin>>x; if(!p[x].first) { p[x].first = 1; } else { p[x].second = 1; } } for(int i=1;i<=2*n;i++) { int x; cin>>x; if(!p[x].first) { p[x].first = 2; } else { p[x].second = 2; } } for(int i=1;i<=2*n;i++) { int x; cin>>x; if(!p[x].first) { p[x].first = 3; } else { p[x].second = 3; } } int nr_tot = 3 * n; for(int i=1;i<=3*n;i++) { if(p[i].first==p[i].second) { --nr_tot; continue; } if(p[i].first==1 && p[i].second==2) { ++nrab; } else if(p[i].first==1 && p[i].second==3) { ++nrac; } } dp[nr_tot][nrab][nrac] = 1; for(int nr=nr_tot;nr>=1;nr--) { for(int ab=0;ab<=nr;ab++) { for(int ac=0;ab+ac<=nr;ac++) { int bc = nr - ab - ac; for(int a=1;a<=3;a++) { for(int b=1;b<=3;b++) { for(int c=1;c<=3;c++) { update(nr,ab,ac,a,b,c); } } } } } } } int main() { ios::sync_with_stdio(false); cin.tie(0); #ifdef home freopen("nr.in","r",stdin); freopen("nr.out","w",stdout); #endif // home cin>>n>>t; for(int i=1;i<=t;i++) { solve_test(); } return 0; }

Compilation message (stderr)

fishing.cpp: In function 'void solve_test()':
fishing.cpp:10:22: error: 'n' was not declared in this scope
   10 |     for(int i=1;i<=2*n;i++)
      |                      ^
fishing.cpp:14:13: error: 'p' was not declared in this scope
   14 |         if(!p[x].first)
      |             ^
fishing.cpp:23:22: error: 'n' was not declared in this scope
   23 |     for(int i=1;i<=2*n;i++)
      |                      ^
fishing.cpp:27:13: error: 'p' was not declared in this scope
   27 |         if(!p[x].first)
      |             ^
fishing.cpp:36:22: error: 'n' was not declared in this scope
   36 |     for(int i=1;i<=2*n;i++)
      |                      ^
fishing.cpp:40:13: error: 'p' was not declared in this scope
   40 |         if(!p[x].first)
      |             ^
fishing.cpp:49:22: error: 'n' was not declared in this scope; did you mean 'yn'?
   49 |     int nr_tot = 3 * n;
      |                      ^
      |                      yn
fishing.cpp:52:12: error: 'p' was not declared in this scope
   52 |         if(p[i].first==p[i].second)
      |            ^
fishing.cpp:57:12: error: 'p' was not declared in this scope
   57 |         if(p[i].first==1 && p[i].second==2)
      |            ^
fishing.cpp:59:15: error: 'nrab' was not declared in this scope
   59 |             ++nrab;
      |               ^~~~
fishing.cpp:63:15: error: 'nrac' was not declared in this scope
   63 |             ++nrac;
      |               ^~~~
fishing.cpp:66:5: error: 'dp' was not declared in this scope
   66 |     dp[nr_tot][nrab][nrac] = 1;
      |     ^~
fishing.cpp:66:16: error: 'nrab' was not declared in this scope
   66 |     dp[nr_tot][nrab][nrac] = 1;
      |                ^~~~
fishing.cpp:66:22: error: 'nrac' was not declared in this scope
   66 |     dp[nr_tot][nrab][nrac] = 1;
      |                      ^~~~
fishing.cpp:80:29: error: 'update' was not declared in this scope
   80 |                             update(nr,ab,ac,a,b,c);
      |                             ^~~~~~
fishing.cpp:73:21: warning: unused variable 'bc' [-Wunused-variable]
   73 |                 int bc = nr - ab - ac;
      |                     ^~
fishing.cpp: In function 'int main()':
fishing.cpp:97:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   97 |     cin>>n>>t;
      |          ^
      |          yn
fishing.cpp:97:13: error: 't' was not declared in this scope; did you mean 'tm'?
   97 |     cin>>n>>t;
      |             ^
      |             tm