Submission #1093869

# Submission time Handle Problem Language Result Execution time Memory
1093869 2024-09-27T21:05:41 Z Almonther Vještica (COCI16_vjestica) C++
0 / 160
13 ms 1372 KB
#include <bits/stdc++.h>
 
#define suiii ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define co cout<<
//#pragma GCC optimize("O3,Ofast,unroll-loops")
//#pragma GCC target("avx2,sse3,sse4,avx")
using namespace std;
//stuff

void solve(){
    ll n;
    cin>>n;
    ll ans=1;
    string s[n+5];
    for(int i=0;i<n;i++){
        cin>>s[i];
        sort(s[i].begin(),s[i].end());
    }
    sort(s,s+n);
    for(int i=0;i<n;i++){
        ll mx=-1;
        for(int j=0;j<i;j++){
            for(int k=0;k<min(s[j].size(),s[i].size());k++){
                if(s[j][k]!=s[i][k]) break;
                mx=max(mx,(ll)k);
            }
        }
        ans+=s[i].size()-(mx+1);
    }
    co ans;
}
int main()
{
    suiii
    int _=1;
    // cin>>_;
    while(_--) solve();
    return 0;
}

Compilation message

vjestica.cpp: In function 'void solve()':
vjestica.cpp:24:26: warning: comparison of integer expressions of different signedness: 'int' and 'const long unsigned int' [-Wsign-compare]
   24 |             for(int k=0;k<min(s[j].size(),s[i].size());k++){
      |                         ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Incorrect 1 ms 348 KB Output isn't correct
5 Incorrect 2 ms 604 KB Output isn't correct
6 Incorrect 7 ms 944 KB Output isn't correct
7 Incorrect 11 ms 1116 KB Output isn't correct
8 Incorrect 13 ms 1372 KB Output isn't correct
9 Incorrect 12 ms 1128 KB Output isn't correct
10 Incorrect 12 ms 1372 KB Output isn't correct