제출 #1250617

#제출 시각아이디문제언어결과실행 시간메모리
1250617haiphong5g03개의 봉우리 (IOI25_triples)C++20
0 / 100
13 ms1856 KiB
//#include "triplepeaks.h"
#include <bits/stdc++.h>
#define task "TEST"
#define task2 "A"
#define pl pair<ll, ll>
#define pf push_front
#define pb push_back
#define pob pop_back
#define pof pop_front
#define mp make_pair
#define fi first
#define se second
#define FOR(i, a, b, c) for (int i=a; i<=b; i+=c)
#define FORE(i, a, b, c) for (int i=a; i>=b; i+=c)
using namespace std;
using ll = long long;
using ull = unsigned long long;
const int Mod = 998244353;
const int maxn = 1e3;
const ll Inf = 1e16;
ll n;
ll Check(ll i, ll j, ll k, vector<int>& H) {
    if (j < i or k < j) return 0;
    if (i < 0 or k >= n) return 0;
    multiset<int> a, b;
    a.insert({k-i, j-i, k-j});
    b.insert({H[i], H[j], H[k]});
    if (a == b) cerr << i << " " << j << " " << k << '\n';
    return (a == b);
}
ll doubles(ll i, ll j, vector<int>& H) {
    ll v = abs(j-i);
    ll ans = 0;
    ans += Check(i, j, H[i] + i, H);
    ans += Check(i, j, H[i] + j, H);
    if (H[j] != H[i] and H[i] + j != H[j] + i) ans += Check(i, j, H[j] + i, H);
    if (H[j] != H[i] and H[i] + i != H[j] + j) ans += Check(i, j, H[j] + j, H);
}
ll count_triples(vector<int> H) {
    n = H.size(); ll cnt = 0;
    FOR(i, 0, n-3, 1) FOR(j, i+1, n-2, 1)
        cnt += doubles(i, j, H);
    return cnt;
}
vector<int> construct_range(int M, int K) {
    vector<int> a; a.clear();
    return a;
}



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

triples.cpp: In function 'll Check(ll, ll, ll, std::vector<int>&)':
triples.cpp:26:16: warning: narrowing conversion of '(k - i)' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   26 |     a.insert({k-i, j-i, k-j});
      |               ~^~
triples.cpp:26:16: warning: narrowing conversion of '(k - i)' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
triples.cpp:26:21: warning: narrowing conversion of '(j - i)' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   26 |     a.insert({k-i, j-i, k-j});
      |                    ~^~
triples.cpp:26:21: warning: narrowing conversion of '(j - i)' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
triples.cpp:26:26: warning: narrowing conversion of '(k - j)' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   26 |     a.insert({k-i, j-i, k-j});
      |                         ~^~
triples.cpp:26:26: warning: narrowing conversion of '(k - j)' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
triples.cpp: In function 'll doubles(ll, ll, std::vector<int>&)':
triples.cpp:38:1: warning: no return statement in function returning non-void [-Wreturn-type]
   38 | }
      | ^
#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...