結果

問題 No.178 美しいWhitespace (1)
ユーザー ki_ki33ki_ki33
提出日時 2015-04-05 23:35:26
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,212 bytes
コンパイル時間 2,114 ms
コンパイル使用メモリ 78,616 KB
実行使用メモリ 59,680 KB
最終ジャッジ日時 2023-09-17 04:43:12
合計ジャッジ時間 8,045 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
55,804 KB
testcase_01 AC 103 ms
55,816 KB
testcase_02 AC 104 ms
55,840 KB
testcase_03 AC 109 ms
55,932 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 172 ms
58,444 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 173 ms
56,748 KB
testcase_12 AC 169 ms
58,160 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 171 ms
58,532 KB
testcase_19 WA -
testcase_20 AC 172 ms
58,252 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 172 ms
59,092 KB
testcase_24 AC 159 ms
58,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.awt.Point;
import java.awt.Rectangle;
import java.awt.geom.Rectangle2D;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentSkipListSet;

public class Main {
	public static final int C =  1000000007;
	static final int CY = 1000000000;
	//static boolean MAP[][];
	static int N;
	static int B;
	static int[][] POS;
	static String S;
	static int X[][];
	static int HA[];
	static long DP[];
	static int ST[][];
	static ConcurrentSkipListSet<Integer> TS;
	static ArrayList<Integer> AL;
	public static void main(String[] args) {
		StringBuilder sb = new StringBuilder();
		BufferedInputStream bs = new BufferedInputStream(System.in);
		Scanner sc = new Scanner(bs);

		N = sc.nextInt();
		long[] a = new long[N];
		long min = Long.MAX_VALUE;
		for (int i =0; i < N; i++) {
			a[i] = sc.nextLong()*1 + sc.nextLong()*4;
			min = Math.min(min, a[i]);
		}
		
		
		long ans = 0;
		
		
		for (int i=0; i < N; i++) {
			long num = a[i] - min;
			if (num %2 != 0) {
				ans = -1;
				break;
			}
			ans += num/2;
		}
		
		System.out.println(ans);
		
		
	}
}
0