제출 #1250238

#제출 시각아이디문제언어결과실행 시간메모리
1250238omar1312Triple Peaks (IOI25_triples)C++20
0 / 100
2093 ms1860 KiB
// #include "souvenirs.h"
#include "triples.h"
#include <utility>
#include <vector>
#include <bits/stdc++.h>

using namespace std;

#define ll long long

const int mod = 1000000007;

int p[200005];

ll d(ll i, ll j){
    return max(i, j) - min(i, j);
}

long long count_triples(std::vector<int> h) {
    const int n = h.size();
    ll ans = 0;
    
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            for(int k = 0; k < n; k++){
                array<int, 3> lhs = {h[i], h[j], h[k]};
                array<int, 3> rhs = {d(i, j), d(i, k), d(j, k)};

                if(lhs == rhs){
                    ans++;
                }
            }
        }
    }

    return ans;
}

std::vector<int> construct_range(int M, int K) {
  return {1, 1, 1};
}



// int main(){
// cin.tie(0)->sync_with_stdio(0);
    
// }

컴파일 시 표준 에러 (stderr) 메시지

triples.cpp: In function 'long long int count_triples(std::vector<int>)':
triples.cpp:27:39: warning: narrowing conversion of 'd(((long long int)i), ((long long int)j))' from 'long long int' to 'int' [-Wnarrowing]
   27 |                 array<int, 3> rhs = {d(i, j), d(i, k), d(j, k)};
      |                                      ~^~~~~~
triples.cpp:27:48: warning: narrowing conversion of 'd(((long long int)i), ((long long int)k))' from 'long long int' to 'int' [-Wnarrowing]
   27 |                 array<int, 3> rhs = {d(i, j), d(i, k), d(j, k)};
      |                                               ~^~~~~~
triples.cpp:27:57: warning: narrowing conversion of 'd(((long long int)j), ((long long int)k))' from 'long long int' to 'int' [-Wnarrowing]
   27 |                 array<int, 3> rhs = {d(i, j), d(i, k), d(j, k)};
      |                                                        ~^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...