Codeforces Round #183 (Div.2)
はい。
http://codeforces.com/contest/304
A. Pythagorean Theorem II
ざっくりと大意
・なんかピタゴラスの定理が成立する時??
方針のようなもの
・いまいちよくわからん
#TLEになったのであとで考える n=int(raw_input()) ans=chk=0 l=[] for i in range(1,n+1): for j in range(i,n+1): c2=i*i+j*j c=int(c2**0.5) if c<=n and c**2==c2: ans+=1 print ans
B. Calendar
ざっくりと大意
・2つの年月日の日数差を出す 閏年に気をつけてね!!
方針のようなもの
・datetime使うほうが楽だけど自力で全部書いてみよう
l=[] ans=chk=0 l.append(map(int,raw_input().split(':'))) l.append(map(int,raw_input().split(':'))) l.sort() bc=l[0] ad=l[1] while 1: if bc[0]!=ad[0] or bc[1]!=ad[1]: if bc[1] in [1,3,5,7,8,10]: ans+=31-bc[2] bc[2]=0 bc[1]+=1 elif bc[1] in [4,6,9,11]: ans+=30-bc[2] bc[2]=0 bc[1]+=1 elif bc[1] == 2: ans+=28-bc[2] if bc[0]%400==0 or (bc[0]%4==0 and bc[0]%100!=0): ans+=1 bc[2]=0 bc[1]+=1 else: ans+=31-bc[2] bc[2]=0 bc[1]=1 bc[0]+=1 else: ans+=ad[2]-bc[2] break print ans