Submission #469508

# Submission time Handle Problem Language Result Execution time Memory
469508 2021-09-01T08:25:15 Z Karabasan Lozinke (COCI17_lozinke) C++17
0 / 100
1000 ms 948 KB
#include <bits/stdc++.h>

using namespace std;
int n;
string s[20002];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        cin>>s[i];
    }
    long long cevap=0;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if(j==i)
                continue;
            int k=0;
            for(int z=0;z<s[i].length();z++)
            {
                if(k==s[j].length()-1&&s[i][z]==s[j][k])
                    {
                        cevap++;
                        break;
                    }
                else if(s[i][z]!=s[j][k])
                    k=0;
                else k++;
            }
        }
    }
    printf("%lld",cevap);
    return 0;
}

Compilation message

lozinke.cpp: In function 'int main()':
lozinke.cpp:24:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |             for(int z=0;z<s[i].length();z++)
      |                         ~^~~~~~~~~~~~~~
lozinke.cpp:26:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |                 if(k==s[j].length()-1&&s[i][z]==s[j][k])
      |                    ~^~~~~~~~~~~~~~~~~
lozinke.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 844 KB Output isn't correct
2 Incorrect 1 ms 844 KB Output isn't correct
3 Incorrect 1 ms 844 KB Output isn't correct
4 Incorrect 1 ms 844 KB Output isn't correct
5 Incorrect 6 ms 844 KB Output isn't correct
6 Incorrect 19 ms 948 KB Output isn't correct
7 Incorrect 32 ms 844 KB Output isn't correct
8 Incorrect 40 ms 844 KB Output isn't correct
9 Execution timed out 1077 ms 844 KB Time limit exceeded
10 Execution timed out 1099 ms 844 KB Time limit exceeded
11 Execution timed out 1085 ms 844 KB Time limit exceeded
12 Execution timed out 1091 ms 844 KB Time limit exceeded
13 Execution timed out 1088 ms 844 KB Time limit exceeded
14 Execution timed out 1089 ms 844 KB Time limit exceeded
15 Execution timed out 1089 ms 844 KB Time limit exceeded
16 Execution timed out 1090 ms 844 KB Time limit exceeded
17 Execution timed out 1088 ms 844 KB Time limit exceeded
18 Execution timed out 1086 ms 844 KB Time limit exceeded
19 Execution timed out 1090 ms 844 KB Time limit exceeded
20 Execution timed out 1093 ms 844 KB Time limit exceeded