結果
問題 | No.339 何人が回答したのか |
ユーザー |
|
提出日時 | 2016-02-13 11:22:50 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 13 ms / 1,000 ms |
コード長 | 405 bytes |
コンパイル時間 | 224 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-22 06:13:16 |
合計ジャッジ時間 | 2,426 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 61 |
ソースコード
#coding: utf-8##yuki_339import sysdef gcd(a, b):while b:a,b = b,a % breturn adef gcd_vec(s):l=s[0]for i in xrange(1,len(s)):l=gcd(l,s[i])return ln=int(raw_input())sc=[]for i in xrange(n):a=raw_input()sc.append(a)s=map(int,sc)if sum(s)!=100:print "input error"sys.exit()sres=[0 for i in xrange(n)]for j in xrange(n):sres[j]=s[j]/gcd_vec(s)res=sum(sres)print res