Submission #1154121

#TimeUsernameProblemLanguageResultExecution timeMemory
1154121sodbayrGenetics (BOI18_genetics)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #define int long long #define ss second #define ff first #define pb push_back using namespace std; ll n,m,k,s[5005],sum,p[70][5005],h[5005]; string a[5005]; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin>>n>>m>>k; sum=0; for(ll i=1;i<=n;i++){ cin>>a[i]; a[i]=" "+a[i]; h[0]=0; for(ll j=1;j<=m;j++){ h[j]=(h[j-1]*b%mod+a[i][j]-'A')%mod; } s[i]=h[m]; sum+=s[i]; for(ll j=1;j<=m;j++){ p[a[i][j]-'A'][j]+=s[i]; } } for(ll i=1;i<=n;i++){ ll t=0; for(ll j=1;j<=m;j++){ t+=p[a[i][j]-'A'][j]-s[i]; } if(t==(sum-s[i])*(m-k)){ cout<<i; exit(0); } } }

Compilation message (stderr)

genetics.cpp:7:9: error: 'll' does not name a type
    7 |         ll n,m,k,s[5005],sum,p[70][5005],h[5005];
      |         ^~
cc1plus: error: '::main' must return 'int'
genetics.cpp: In function 'int main()':
genetics.cpp:13:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   13 |     cin>>n>>m>>k;
      |          ^
      |          yn
genetics.cpp:13:13: error: 'm' was not declared in this scope; did you mean 'tm'?
   13 |     cin>>n>>m>>k;
      |             ^
      |             tm
genetics.cpp:13:16: error: 'k' was not declared in this scope
   13 |     cin>>n>>m>>k;
      |                ^
genetics.cpp:14:5: error: 'sum' was not declared in this scope
   14 |     sum=0;
      |     ^~~
genetics.cpp:15:9: error: 'll' was not declared in this scope
   15 |     for(ll i=1;i<=n;i++){
      |         ^~
genetics.cpp:15:16: error: 'i' was not declared in this scope
   15 |     for(ll i=1;i<=n;i++){
      |                ^
genetics.cpp:18:9: error: 'h' was not declared in this scope
   18 |         h[0]=0;
      |         ^
genetics.cpp:19:15: error: expected ';' before 'j'
   19 |         for(ll j=1;j<=m;j++){
      |               ^~
      |               ;
genetics.cpp:19:20: error: 'j' was not declared in this scope; did you mean 'jn'?
   19 |         for(ll j=1;j<=m;j++){
      |                    ^
      |                    jn
genetics.cpp:20:30: error: 'b' was not declared in this scope
   20 |                 h[j]=(h[j-1]*b%mod+a[i][j]-'A')%mod;
      |                              ^
genetics.cpp:20:32: error: 'mod' was not declared in this scope; did you mean 'modf'?
   20 |                 h[j]=(h[j-1]*b%mod+a[i][j]-'A')%mod;
      |                                ^~~
      |                                modf
genetics.cpp:22:9: error: 's' was not declared in this scope
   22 |         s[i]=h[m];
      |         ^
genetics.cpp:24:15: error: expected ';' before 'j'
   24 |         for(ll j=1;j<=m;j++){
      |               ^~
      |               ;
genetics.cpp:24:20: error: 'j' was not declared in this scope; did you mean 'jn'?
   24 |         for(ll j=1;j<=m;j++){
      |                    ^
      |                    jn
genetics.cpp:25:25: error: 'p' was not declared in this scope
   25 |                         p[a[i][j]-'A'][j]+=s[i];
      |                         ^
genetics.cpp:28:13: error: 'll' was not declared in this scope
   28 |         for(ll i=1;i<=n;i++){
      |             ^~
genetics.cpp:28:20: error: 'i' was not declared in this scope
   28 |         for(ll i=1;i<=n;i++){
      |                    ^
genetics.cpp:29:19: error: expected ';' before 't'
   29 |                 ll t=0;
      |                   ^~
      |                   ;
genetics.cpp:30:23: error: expected ';' before 'j'
   30 |                 for(ll j=1;j<=m;j++){
      |                       ^~
      |                       ;
genetics.cpp:30:28: error: 'j' was not declared in this scope; did you mean 'jn'?
   30 |                 for(ll j=1;j<=m;j++){
      |                            ^
      |                            jn
genetics.cpp:31:25: error: 't' was not declared in this scope; did you mean 'tm'?
   31 |                         t+=p[a[i][j]-'A'][j]-s[i];
      |                         ^
      |                         tm
genetics.cpp:31:28: error: 'p' was not declared in this scope
   31 |                         t+=p[a[i][j]-'A'][j]-s[i];
      |                            ^
genetics.cpp:31:46: error: 's' was not declared in this scope
   31 |                         t+=p[a[i][j]-'A'][j]-s[i];
      |                                              ^
genetics.cpp:33:20: error: 't' was not declared in this scope; did you mean 'tm'?
   33 |                 if(t==(sum-s[i])*(m-k)){
      |                    ^
      |                    tm
genetics.cpp:33:28: error: 's' was not declared in this scope
   33 |                 if(t==(sum-s[i])*(m-k)){
      |                            ^