結果

問題 No.1594 Three Classes
ユーザー laneguelanegue
提出日時 2021-07-14 14:53:12
言語 D
(dmd 2.106.1)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 399 bytes
コンパイル時間 1,715 ms
コンパイル使用メモリ 141,732 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-04 13:12:49
合計ジャッジ時間 3,370 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 3 ms
4,376 KB
testcase_04 AC 71 ms
4,380 KB
testcase_05 AC 71 ms
4,376 KB
testcase_06 AC 3 ms
4,376 KB
testcase_07 AC 4 ms
4,380 KB
testcase_08 AC 71 ms
4,380 KB
testcase_09 AC 71 ms
4,380 KB
testcase_10 AC 71 ms
4,376 KB
testcase_11 AC 70 ms
4,380 KB
testcase_12 AC 71 ms
4,384 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 16 ms
4,376 KB
testcase_15 AC 10 ms
4,380 KB
testcase_16 AC 6 ms
4,384 KB
testcase_17 AC 4 ms
4,376 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio;
import std.conv;
import std.string;
void main(){
	auto n=readln.chomp.to!int;
	auto e=readln.split.to!(int[]);
	stderr.writeln(e);
	auto ans=false;
	for(auto i=0;i<3^^n;i++){
		auto p=new int[3];
		auto x=i;
		for(auto j=0;j<n;j++){
			p[x%3]+=e[j];
			x/=3;
		}
		if(p[0]==p[1]&&p[1]==p[2]){
			ans=true;
			break;
		}
	}
	if(ans){
		writeln("Yes");
	}else{
		writeln("No");
	}
}
0