結果
問題 | No.29 パワーアップ |
ユーザー |
|
提出日時 | 2024-02-25 13:32:38 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 448 bytes |
コンパイル時間 | 4,841 ms |
コンパイル使用メモリ | 204,896 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-09-29 10:53:33 |
合計ジャッジ時間 | 5,786 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
module main;import std;void main(){auto N = readln.chomp.to!int;auto items = new int[](11);int ans = 0;foreach (_; 0 .. N) {int a, b, c;readln.chomp.formattedRead("%d %d %d", a, b, c);items[a]++, items[b]++, items[c]++;if (items[a] >= 2) {items[a] -= 2;ans++;}if (items[b] >= 2) {items[b] -= 2;ans++;}if (items[c] >= 2) {items[c] -= 2;ans++;}}writeln(ans + items.count(1) / 4);}