Xmas Contest 2016 昼の部

Submission #1038388

Source codeソースコード

for t in xrange(200):
    p_cnts = [0]*30
    A = []
    for i in xrange(30):
        A.append(map(int, raw_input().split()))

    res = [[0]*4 for i in xrange(50)]
    for a in A:
        for j in xrange(50):
            res[j][a[j]] += 1
    for i in xrange(30):
        a = A[i]
        for j in xrange(50):
            if max(res[j]) == res[j][a[j]] and max(res[j])*100 >= sum(res[j])*18:
                p_cnts[i] += 1
    b = range(30)
    b.sort(key=lambda x: p_cnts[x])

    g1 = b[20:]   # 2/3
    g2 = b[10:20] # 1/3
    g3 = b[:10]   # 1/4

    res_prob = [[0]*4 for i in xrange(50)]
    for i in xrange(10):
        a = A[g1[i]]
        for j in xrange(50):
            res_prob[j][a[j]] += 4

    for i in xrange(10):
        a = A[g2[i]]
        for j in xrange(50):
            res_prob[j][a[j]] += 1

    ans = []
    for j in xrange(50):
        ans.append(str(res_prob[j].index(max(res_prob[j]))))
    print " ".join(ans)

Submission

Task問題 E - Examination, Estimation
User nameユーザ名 すごぷろ/ちゃっく
Created time投稿日時
Language言語 Python2 (2.7.6)
Status状態 AC
Score得点 100
Source lengthソースコード長 975 Byte
File nameファイル名
Exec time実行時間 366 ms
Memory usageメモリ使用量 2820 KB

Test case

Set

Set name Score得点 / Max score Cases
All 100 / 100 1.txt,10.txt,2.txt,3.txt,4.txt,5.txt,6.txt,7.txt,8.txt,9.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
1.txt AC 364 ms 2696 KB
10.txt AC 360 ms 2696 KB
2.txt AC 364 ms 2696 KB
3.txt AC 360 ms 2696 KB
4.txt AC 361 ms 2696 KB
5.txt AC 365 ms 2696 KB
6.txt AC 366 ms 2696 KB
7.txt AC 359 ms 2696 KB
8.txt AC 365 ms 2696 KB
9.txt AC 359 ms 2820 KB