結果

問題 No.118 門松列(2)
ユーザー いともたやすく行われるえげつない行為いともたやすく行われるえげつない行為
提出日時 2017-02-23 09:08:38
言語 Go
(1.22.1)
結果
AC  
実行時間 320 ms / 5,000 ms
コード長 614 bytes
コンパイル時間 16,933 ms
コンパイル使用メモリ 212,448 KB
実行使用メモリ 7,944 KB
最終ジャッジ日時 2023-08-30 21:15:07
合計ジャッジ時間 19,777 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
4,356 KB
testcase_01 AC 319 ms
7,944 KB
testcase_02 AC 311 ms
7,940 KB
testcase_03 AC 318 ms
7,944 KB
testcase_04 AC 320 ms
7,940 KB
testcase_05 AC 318 ms
7,940 KB
testcase_06 AC 1 ms
4,384 KB
testcase_07 AC 2 ms
4,388 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 301 ms
7,940 KB
testcase_10 AC 64 ms
4,380 KB
testcase_11 AC 84 ms
4,384 KB
testcase_12 AC 47 ms
4,384 KB
testcase_13 AC 27 ms
4,384 KB
testcase_14 AC 292 ms
7,940 KB
testcase_15 AC 8 ms
4,384 KB
testcase_16 AC 167 ms
5,668 KB
testcase_17 AC 24 ms
4,380 KB
testcase_18 AC 84 ms
4,388 KB
testcase_19 AC 143 ms
5,656 KB
testcase_20 AC 154 ms
5,660 KB
testcase_21 AC 240 ms
5,712 KB
testcase_22 AC 67 ms
4,384 KB
testcase_23 AC 217 ms
5,696 KB
testcase_24 AC 93 ms
4,384 KB
testcase_25 AC 132 ms
5,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
	"io"
	"os"
)

var modVar = int(1e9) + 7

func solve(in io.Reader, out, err io.Writer) {
	num, total, size := 0, int64(0), 100
	fmt.Fscan(in, &num)
	bamboo := make([]int, size)

	for temp, i := 0, 0; i < num; i++ {
		fmt.Fscan(in, &temp)
		bamboo[temp-1]++
	}

	for i := 0; i < size-2; i++ {
		for jj := i + 1; jj < size-1; jj++ {
			for kkk := jj + 1; kkk < size; kkk++ {
				total += int64(bamboo[i]) *
					int64(bamboo[jj]) * int64(bamboo[kkk])
			}
		}
	}
	result := int(total % int64(modVar))
	fmt.Fprintln(out, result)
}

func main() {
	solve(os.Stdin, os.Stdout, os.Stderr)
}
0