結果
問題 | No.267 トランプソート |
ユーザー |
![]() |
提出日時 | 2015-10-15 22:41:21 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 17 ms / 1,000 ms |
コード長 | 1,200 bytes |
コンパイル時間 | 168 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 6,400 KB |
最終ジャッジ日時 | 2024-07-21 16:38:09 |
合計ジャッジ時間 | 1,335 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#!/usr/bin/python # -*- coding: utf-8 -*- N = input() hand = raw_input().split() card_list_D = [0] * 13 card_list_C = [0] * 13 card_list_H = [0] * 13 card_list_S = [0] * 13 card_list = [card_list_D, card_list_C, card_list_H, card_list_S] def check_cardnumber(target_card, target_suit): if "A" in target_card: target_suit[0] = 1 elif "T" in target_card: target_suit[9] = 1 elif "J" in target_card: target_suit[10] = 1 elif "Q" in target_card: target_suit[11] = 1 elif "K" in target_card: target_suit[12] = 1 else: target_suit[int(card[1])-1] = 1 for card in hand: if "D" in card: check_cardnumber(card, card_list_D) elif "C" in card: check_cardnumber(card, card_list_C) elif "H" in card: check_cardnumber(card, card_list_H) elif "S" in card: check_cardnumber(card, card_list_S) # カードリストつくった suits = ["D", "C", "H", "S"] numbers = ["A", "2", "3", "4", "5", "6", "7", "8", "9", "T", "J", "Q", "K"] for i in range(4): for n in range(13): if card_list[i][n] == 1: print suits[i]+numbers[n], # それをもとにプリント