結果

問題 No.2938 Sigma Sigma Distance Distance Problem
コンテスト
ユーザー Maeda
提出日時 2025-03-27 11:38:05
言語 C
(gcc 15.2.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 580 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 191 ms
コンパイル使用メモリ 39,524 KB
実行使用メモリ 16,208 KB
最終ジャッジ日時 2026-01-07 10:50:38
合計ジャッジ時間 4,227 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 19 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>
void main(void){
    int n = 0 ;
    scanf("%d",&n);
    int numList[n] = {};
    for(int i = 0 ; i < n ; i++ ){
        scanf("%d",&numList[i]);
    }
    long int result = 0 ;  
    for(int i = 0 ; i < n ; i++ ){
        for(int j= 0 ; j < n ; j++ ){
             double ansA = i - j;
            if(ansA > 0 ){
               ansA *= -1;
            }
        
            double ansB = numList[i] - numList[j];
            if(ansB> 0 ){
               ansB *= -1;
            } 
            result += ansA*ansB;
        }
    }
    printf("%d",result);
}   
0