結果

問題 No.112 ややこしい鶴亀算
ユーザー fmhrfmhr
提出日時 2015-05-14 01:16:55
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 452 bytes
コンパイル時間 9,539 ms
コンパイル使用メモリ 233,528 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-18 11:10:08
合計ジャッジ時間 10,495 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 WA -
testcase_02 AC 1 ms
6,812 KB
testcase_03 AC 1 ms
6,816 KB
testcase_04 WA -
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 1 ms
6,940 KB
testcase_09 WA -
testcase_10 AC 1 ms
6,940 KB
testcase_11 AC 1 ms
6,944 KB
testcase_12 AC 1 ms
6,944 KB
testcase_13 AC 1 ms
6,940 KB
testcase_14 WA -
testcase_15 AC 2 ms
6,940 KB
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 1 ms
6,940 KB
testcase_18 AC 2 ms
6,944 KB
testcase_19 AC 1 ms
6,944 KB
testcase_20 WA -
testcase_21 AC 2 ms
6,944 KB
testcase_22 AC 1 ms
6,944 KB
testcase_23 AC 1 ms
6,944 KB
testcase_24 AC 1 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
)

func main() {
	var N int
	fmt.Scan(&N)
	a := make([]int, N)
	var b int
	var f int
	var turu, turu_c int
	for i := range a {
		fmt.Scan(&a[i])
		if i > 0 {
			if a[i] > b {
				turu_c = a[i]
			} else if a[i] < b{
				turu_c = b
			}
			f = 1
		}
		b = a[i]
	}
	if f == 0 {
		if b / (N-1) == 2 {
			turu = N
		}
	} else {
		for i := range a {
			if a[i] == turu_c {
				turu += 1
			}
		}
	}
	fmt.Println(turu, N-turu)
}
0