結果
問題 |
No.112 ややこしい鶴亀算
|
ユーザー |
![]() |
提出日時 | 2015-04-07 10:14:20 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,030 bytes |
コンパイル時間 | 3,569 ms |
コンパイル使用メモリ | 80,288 KB |
実行使用メモリ | 57,124 KB |
最終ジャッジ日時 | 2024-07-04 03:40:29 |
合計ジャッジ時間 | 8,514 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | AC * 2 WA * 21 |
ソースコード
//No.112 ややこしい鶴亀算 import java.util.*; import java.io.*; import static java.util.Arrays.*; import static java.lang.Math.*; public class No112 { static final Scanner sc = new Scanner(System.in); static final PrintWriter out = new PrintWriter(System.out,false); static void solve() { int n = sc.nextInt(); int[] a = new int[n]; int sum = 0; for (int i=0; i<n; i++) { a[i] = sc.nextInt(); sum += a[i]; } sum /= n-1; int x = 1, y = 0; for (int i=0; i<n; i++) { if (i*2+(n-i)*4 == sum) { x = n-i; y = i; } } out.println(x+" "+y); } public static void main(String[] args) { long start = System.currentTimeMillis(); solve(); out.flush(); long end = System.currentTimeMillis(); //trace(end-start + "ms"); sc.close(); } static void trace(Object... o) { System.out.println(deepToString(o));} }