AtCoder Beginner Contest 002

Submission #4337369

Source codeソースコード

#!usr/bin/env python3
from collections import defaultdict
import math
import bisect
import random
def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()
def IIR(n): return [II() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
mod = 1000000007

# A
x,y = LI()
print(max(x,y))

# B
'''
s = input()
list = "aiueo"
for i in range(len(list)):
    s = s.replace(list[i],"")
for i in range(len(s)):
    print(s[i], end = "")
'''

# C
"""
x,y,a,b,c,d = LI()
print(abs((a-x)*(d-y)-(b-y)*(c-x))/2)
"""
# D
n,m = LI()
f = [[0 if i != j else 1 for j in range(n)] for i in range(n)]
for i in range(m):
    x,y = LI()
    x -= 1
    y -= 1
    f[x][y] = 1
    f[y][x] = 1
bi = [bin(i)[2:] for i in range(1,2**n)]

li = []
for i in range(2**n-1):
    a = []
    for j in range(len(bi[i])):
        if bi[i][len(bi[i])-1-j] == "1":
            a.append(j)
    li.append(a)

ans = 0
for l in li:
    st = False
    for i in range(1,len(l)):
        for j in range(i):
            if not f[l[i]][l[j]]:
                st = True
                break
        if st:
            break
    if not st:
        ans = max(ans,len(l))
print(ans)

Submission

Task問題 A - 正直者
User nameユーザ名 tsumugi
Created time投稿日時
Language言語 PyPy3 (2.4.0)
Status状態 RE
Score得点 0
Source lengthソースコード長 1325 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
all 0 / 100 00_sample_01.txt,00_sample_02.txt,kensho_diff01,kensho_diff02,kensho_diff03,kensho_diff04,kensho_diff05,kensho_min-max01,kensho_min-max02,kensho_min-max03,kensho_min-max04,kensho_min-max05,kensho_min-max06,kensho_min-max07,kensho_min-max08,kensho_min-max09,kensho_min-max10,kensho_rand01,kensho_rand02,kensho_rand03,kensho_rand04,kensho_rand05,kensho_rand06,kensho_rand07,kensho_rand08,kensho_rand09,kensho_rand10

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
00_sample_01.txt RE
00_sample_02.txt RE
kensho_diff01 RE
kensho_diff02 RE
kensho_diff03 RE
kensho_diff04 RE
kensho_diff05 RE
kensho_min-max01 RE
kensho_min-max02 RE
kensho_min-max03 RE
kensho_min-max04 RE
kensho_min-max05 RE
kensho_min-max06 RE
kensho_min-max07 RE
kensho_min-max08 RE
kensho_min-max09 RE
kensho_min-max10 RE
kensho_rand01 RE
kensho_rand02 RE
kensho_rand03 RE
kensho_rand04 RE
kensho_rand05 RE
kensho_rand06 RE
kensho_rand07 RE
kensho_rand08 RE
kensho_rand09 RE
kensho_rand10 RE