結果

問題 No.3163 [Cherry 7th Tune N] Draft
ユーザー ruase_
提出日時 2025-08-14 21:14:31
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 484 bytes
コンパイル時間 836 ms
コンパイル使用メモリ 93,224 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2025-08-14 21:14:33
合計ジャッジ時間 1,440 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:17:15: warning: overflow in conversion from ‘long int’ to ‘int’ changes value from ‘9999999999’ to ‘1410065407’ [-Woverflow]
   17 |     int min = 9999999999;
      |               ^~~~~~~~~~

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;

int main() {

  int n;
  cin >> n;
  int a[n][5];
  int ans[n];
  for(int i = 0 ; i < n; i++) cin >> a[i][0] >> a[i][1] >> a[i][2] >> a[i][3] >> a[i][4];



  for(int i = 0; i < n; i++){
    int max = 0;
    int min = 9999999999;
    for(int m = 0; m < 5; m++){
      if(a[i][m] > max){
        max = a[i][m];
      }
      if(a[i][m] < min){
        min = a[i][m];
      }
    }
    cout << max - min << endl;
  }




}
0