提出 #74269925


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
  ll N;
  string ans = "No";
  cin >> N;
  vector<vector<ll>> C(N,vector<ll>(N));
  for(ll i = 0;i < N - 1;i++){
    for(ll j = i + 1;j < N;j++){
      cin >> C[i][j];
    }
  }
  for(ll a = 0;a < N - 2;a++){
    for(ll b = a + 1;b < N - 1;b++){
      for(ll c = b + 1;c < N;c++){
        if(C[a][b] + C[b][c] < C[a][c]){
          ans = "Yes";
        }
      }
    }
  }
  cout << ans;
}

提出情報

提出日時
問題 B - Split Ticketing
ユーザ MI6174
言語 C++23 (GCC 15.2.0)
得点 200
コード長 494 Byte
結果 AC
実行時間 10 ms
メモリ 6524 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 2
AC × 17
セット名 テストケース
Sample 00_sample_01.txt, 00_sample_02.txt
All 00_sample_01.txt, 00_sample_02.txt, 01_01.txt, 01_02.txt, 01_03.txt, 02_01.txt, 02_02.txt, 02_03.txt, 03_01.txt, 03_02.txt, 03_03.txt, 04_01.txt, 04_02.txt, 04_03.txt, 04_04.txt, 04_05.txt, 04_06.txt
ケース名 結果 実行時間 メモリ
00_sample_01.txt AC 10 ms 6304 KiB
00_sample_02.txt AC 3 ms 6364 KiB
01_01.txt AC 3 ms 6356 KiB
01_02.txt AC 3 ms 6256 KiB
01_03.txt AC 5 ms 6516 KiB
02_01.txt AC 3 ms 6292 KiB
02_02.txt AC 3 ms 6352 KiB
02_03.txt AC 4 ms 6484 KiB
03_01.txt AC 3 ms 6264 KiB
03_02.txt AC 4 ms 6516 KiB
03_03.txt AC 4 ms 6436 KiB
04_01.txt AC 3 ms 6360 KiB
04_02.txt AC 3 ms 6456 KiB
04_03.txt AC 3 ms 6488 KiB
04_04.txt AC 4 ms 6524 KiB
04_05.txt AC 3 ms 6256 KiB
04_06.txt AC 3 ms 6408 KiB