提出 #66931338


ソースコード 拡げる

#include<bits/stdc++.h>
#define cmin(a,b) a=std::min(a,b)
#define cmax(a,b) a=std::max(a,b)
#define maxn 1000005
#define mod
#define inf
#define int long long
int n,d[maxn];
signed main(){
	scanf("%lld",&n);
	for(int i=2;i<=n;i++){
		scanf("%lld",&d[i]);
		d[i]+=d[i-1];
	}
	for(int i=1;i<=n;i++){
		for(int j=i+1;j<=n;j++){
			printf("%lld ",std::abs(d[j]-d[i]));
		}
		puts("");
	}
	return 0;
}
/*

*/

提出情報

提出日時
問題 B - Distance Table
ユーザ huanghongjun
言語 C++ 20 (gcc 12.2)
得点 200
コード長 429 Byte
結果 AC
実行時間 1 ms
メモリ 3872 KiB

コンパイルエラー

Main.cpp: In function ‘int main()’:
Main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         scanf("%lld",&n);
      |         ~~~~~^~~~~~~~~~~
Main.cpp:12:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |                 scanf("%lld",&d[i]);
      |                 ~~~~~^~~~~~~~~~~~~~

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 2
AC × 17
セット名 テストケース
Sample example_00.txt, example_01.txt
All example_00.txt, example_01.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt
ケース名 結果 実行時間 メモリ
example_00.txt AC 1 ms 3680 KiB
example_01.txt AC 1 ms 3756 KiB
hand_00.txt AC 1 ms 3528 KiB
hand_01.txt AC 1 ms 3676 KiB
hand_02.txt AC 1 ms 3584 KiB
hand_03.txt AC 1 ms 3628 KiB
hand_04.txt AC 1 ms 3620 KiB
random_00.txt AC 1 ms 3584 KiB
random_01.txt AC 1 ms 3656 KiB
random_02.txt AC 1 ms 3748 KiB
random_03.txt AC 1 ms 3624 KiB
random_04.txt AC 1 ms 3628 KiB
random_05.txt AC 1 ms 3864 KiB
random_06.txt AC 1 ms 3872 KiB
random_07.txt AC 1 ms 3768 KiB
random_08.txt AC 1 ms 3752 KiB
random_09.txt AC 1 ms 3872 KiB