結果

問題 No.267 トランプソート
ユーザー steek79steek79
提出日時 2015-10-15 22:41:21
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 1,000 ms
コード長 1,200 bytes
コンパイル時間 490 ms
コンパイル使用メモリ 6,572 KB
実行使用メモリ 6,088 KB
最終ジャッジ日時 2023-09-28 21:51:23
合計ジャッジ時間 1,693 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,960 KB
testcase_01 AC 12 ms
5,992 KB
testcase_02 AC 12 ms
6,028 KB
testcase_03 AC 11 ms
6,084 KB
testcase_04 AC 11 ms
6,004 KB
testcase_05 AC 11 ms
6,076 KB
testcase_06 AC 12 ms
5,944 KB
testcase_07 AC 12 ms
6,048 KB
testcase_08 AC 11 ms
6,036 KB
testcase_09 AC 11 ms
6,000 KB
testcase_10 AC 11 ms
5,956 KB
testcase_11 AC 11 ms
6,084 KB
testcase_12 AC 12 ms
6,024 KB
testcase_13 AC 11 ms
6,036 KB
testcase_14 AC 11 ms
6,028 KB
testcase_15 AC 12 ms
6,000 KB
testcase_16 AC 12 ms
6,088 KB
testcase_17 AC 11 ms
6,036 KB
testcase_18 AC 12 ms
5,960 KB
testcase_19 AC 12 ms
6,000 KB
testcase_20 AC 12 ms
6,044 KB
testcase_21 AC 11 ms
5,956 KB
testcase_22 AC 11 ms
6,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/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],

# それをもとにプリント
0