Submission #914661

# Submission time Handle Problem Language Result Execution time Memory
914661 2024-01-22T13:39:32 Z abcvuitunggio Languages (IOI10_languages) C++17
0 / 100
173 ms 18288 KB
#include <bits/stdc++.h>

#include "grader.h"
#include "lang.h"

#define SZ 100
#define A 65536
#define ld long double

using namespace std;
int d[56][A],c[56];

void excerpt(int *E){
    pair <ld, int> mx={0.0,0};
    for (int i=0;i<=56;i++){
        if (!c[i])
            continue;
        ld cnt=0;
        for (int j=0;j<SZ;j++)
            cnt+=d[i][E[j]];
        mx=max(mx,{cnt/c[i],i});
    }
    int res=language(mx.second);
    c[res]++;
    for (int i=0;i<100;i++)
        d[res][E[i]]++;
}

Compilation message

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:16:17: warning: iteration 56 invokes undefined behavior [-Waggressive-loop-optimizations]
   16 |         if (!c[i])
      |              ~~~^
lang.cpp:15:19: note: within this loop
   15 |     for (int i=0;i<=56;i++){
      |                  ~^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 173 ms 18288 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 171 ms 18260 KB Output isn't correct - 29.76%
2 Halted 0 ms 0 KB -