Submission #363371

# Submission time Handle Problem Language Result Execution time Memory
363371 2021-02-05T18:17:30 Z cig32 Languages (IOI10_languages) C++17
0 / 100
201 ms 5740 KB
#include "bits/stdc++.h"
#include "lang.h"
#include "grader.h"
using namespace std;
int word[65536][56];
void excerpt(int *a){
    int s[56];
    int m=0;
    for(int j=0;j<56;j++)s[j]=0;
    for(int j=0;j<100;j++){
        for(int k=0;k<56;k++){
            s[k]+=word[a[j]][k];
            m=max(m,s[k]);
        }
    }
    int ans;
    for(int j=0;j<56;j++){
        if(s[j]==m){
            ans=language(j);
            break;
        }
    }
    for(int j=0;j<100;j++){
        word[a[j]][ans]++;
    }
}

Compilation message

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:24:23: warning: 'ans' may be used uninitialized in this function [-Wmaybe-uninitialized]
   24 |         word[a[j]][ans]++;
      |         ~~~~~~~~~~~~~~^
# Verdict Execution time Memory Grader output
1 Incorrect 199 ms 5740 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 201 ms 5740 KB Output isn't correct - 26.38%