Submission #1250282

#TimeUsernameProblemLanguageResultExecution timeMemory
1250282alex0152Triple Peaks (IOI25_triples)C++20
Compilation error
0 ms0 KiB
long long count_triples(std::vector<int> H)
{
    long long ans=0;
    long long a[3],b[3];
    for(int i=0; i<n-2; ++i)
        for(int j=i+1; j<n-1; ++j)
            for(int p=j+1; j<n; ++p)
            {
                a[0]=H[i],a[1]=H[j],a[2]=H[p];
                b[0]=j-i,b[1]=p-i,b[2]=p-j;
                sort(a,a+3);
                sort(b,b+3);
                if(a[0]==b[0] && a[1]==b[1] && a[2]==b[2])
                    ans++;
            }
            return ans;
}

Compilation message (stderr)

triples.cpp:1:30: error: 'vector' is not a member of 'std'
    1 | long long count_triples(std::vector<int> H)
      |                              ^~~~~~
triples.cpp:1:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
  +++ |+#include <vector>
    1 | long long count_triples(std::vector<int> H)
triples.cpp:1:37: error: expected primary-expression before 'int'
    1 | long long count_triples(std::vector<int> H)
      |                                     ^~~