結果

問題 No.178 美しいWhitespace (1)
ユーザー ki_ki33ki_ki33
提出日時 2015-04-05 23:29:40
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,209 bytes
コンパイル時間 3,061 ms
コンパイル使用メモリ 83,124 KB
実行使用メモリ 60,840 KB
最終ジャッジ日時 2023-09-17 04:41:42
合計ジャッジ時間 8,861 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,504 KB
testcase_01 AC 125 ms
55,748 KB
testcase_02 AC 126 ms
55,808 KB
testcase_03 AC 126 ms
55,528 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 197 ms
59,012 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 199 ms
58,324 KB
testcase_12 AC 196 ms
58,668 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 196 ms
56,372 KB
testcase_19 WA -
testcase_20 AC 199 ms
58,580 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 200 ms
58,928 KB
testcase_24 AC 200 ms
58,312 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();
		int[] a = new int[N];
		int min = Integer.MAX_VALUE;
		for (int i =0; i < N; i++) {
			a[i] = sc.nextInt()*1 + sc.nextInt()*4;
			min = Math.min(min, a[i]);
		}
		
		
		long ans = 0;
		
		
		for (int i=0; i < N; i++) {
			int num = a[i] - min;
			if (num %2 != 0) {
				ans = -1;
				break;
			}
			ans += num/2;
		}
		
		System.out.println(ans);
		
		
	}
}
0