Intel Code Challenge Elimination Round (Div.1 + Div.2, combined)
はい。
http://codeforces.com/contest/722
A. Broken Clock
ざっくりと大意
・時計の表示が壊れているものがあるので12時間、24時間フォーマットに合わせて最小手で表記を変更する。
・12時間は1時から12時、24時間は0時から23時が表記範囲内の時間になる。
Python2
n=int(raw_input()) h,m=map(int,raw_input().split(':')) if (n==12 and h==0) or (n==12 and h>12 and h%10==0): h=10 elif (n==12 and h>12)or(n==24 and h>23): h%=10 if m>59: m%=10 print "{0:02}:{1:02}".format(h,m)
mmは59より大きければ%10で下1桁だけ使えば大丈夫だけど、hhはやや注意が必要。
B. Verse Pattern
ざっくりと大意
・各行の文字列がa,e,i,o,u,yの母音をp個含んでいるか?
Python2
n=int(raw_input()) p=map(int,raw_input().split()) t='aeiouy' for i in range(n): s=raw_input() tmp=0 for j in t: tmp+=s.count(j) if tmp!=p[i]: print 'NO' exit() print 'YES'
なんの引掛けもなく空白区切りや、先頭末尾など何も気にせずにaeiouyを数えて個数が全てあってればYESになると思う。