提出 #16732223


ソースコード 拡げる

#include "bits/stdc++.h"
using namespace std;

const int N=2e5+20;

int n,x,y;
vector <int> v1,v2;

int main()
{
	scanf("%d",&n);
	while(n--)
	{
		scanf("%d%d",&x,&y);
		v1.push_back(x+y);
		v2.push_back(x-y);
	}

	sort(v1.begin(),v1.end());
	sort(v2.begin(),v2.end());
	printf("%d",max(v1.back()-v1.front(),v2.back()-v2.front()));
}

提出情報

提出日時
問題 E - Dist Max
ユーザ dush1729
言語 C++ (GCC 9.2.1)
得点 500
コード長 354 Byte
結果 AC
実行時間 72 ms
メモリ 5064 KiB

コンパイルエラー

./Main.cpp: In function ‘int main()’:
./Main.cpp:11:7: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   11 |  scanf("%d",&n);
      |  ~~~~~^~~~~~~~~
./Main.cpp:14:8: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   14 |   scanf("%d%d",&x,&y);
      |   ~~~~~^~~~~~~~~~~~~~

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 500 / 500
結果
AC × 2
AC × 18
セット名 テストケース
Sample sample00, sample01
All handmade02, handmade03, handmade04, handmade05, handmade06, handmade07, handmade08, handmade09, random07, random08, random09, random10, random11, random12, random13, random14, sample00, sample01
ケース名 結果 実行時間 メモリ
handmade02 AC 7 ms 3736 KiB
handmade03 AC 2 ms 3552 KiB
handmade04 AC 2 ms 3692 KiB
handmade05 AC 51 ms 5000 KiB
handmade06 AC 52 ms 4932 KiB
handmade07 AC 63 ms 4988 KiB
handmade08 AC 62 ms 4916 KiB
handmade09 AC 67 ms 4976 KiB
random07 AC 71 ms 4928 KiB
random08 AC 72 ms 5064 KiB
random09 AC 72 ms 4948 KiB
random10 AC 71 ms 4972 KiB
random11 AC 71 ms 4992 KiB
random12 AC 72 ms 4916 KiB
random13 AC 72 ms 4724 KiB
random14 AC 49 ms 4332 KiB
sample00 AC 5 ms 3724 KiB
sample01 AC 2 ms 3576 KiB