Submission #66931338


Source Code Expand

#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;
}
/*

*/

Submission Info

Submission Time
Task B - Distance Table
User huanghongjun
Language C++ 20 (gcc 12.2)
Score 200
Code Size 429 Byte
Status AC
Exec Time 1 ms
Memory 3872 KiB

Compile Error

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]);
      |                 ~~~~~^~~~~~~~~~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 17
Set Name Test Cases
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
Case Name Status Exec Time Memory
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