Yes. http://abc003.contest.atcoder.jp/
A problem At first, I didn't read the problem statement at all, and I struggled with the assumption that the dice were up to 6 pages. .. .. What I wrote is a pattern that turns an expression like the explanation about the sample case with for. However, it seems that the method of 10000 * (1 + N) / 2 was suitable other than turning with this for. It seems that the same value was obtained by multiplying the average of the sums from 1 to N by (1 + N) / 2 and multiplying by 10,000 yen.
A problem
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import time
import sys
import io
import re
import math
#start = time.time()
start = time.clock()
a = 0
y=10000.0
n = float(raw_input())
for i in range(1,(int(n)+1)):
a+=(y*i*(1/n))
print a
↑ is what I submitted during the time, ↓ is what I rewrote before going to bed
A Problem rewriting
n=input()
print sum([10000*(x+1)*(1.0/(n)) for x in range(n)])
B problem List the strings, receive them, look at both from the beginning, If it is the same character, go to see the next character If one matches with @, check if the other can be replaced with atcoder If it can be replaced, the next character, otherwise'You will lose' If you finish watching from the beginning to the end,'You can win' Cannot be submitted in time.
python
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import time
import sys
import io
import re
import math
#start = time.time()
start = time.clock()
i = 0
chk=['a','t','c','o','d','e','r']
S = list(raw_input())
T = list(raw_input())
while i<= len(S):
if i == len(S):
print 'You can win'
i+=20
elif S[i]==T[i]:
i+=1
elif S[i]=='@' and T[i] in chk:
i+=1
pass
elif T[i]=='@' and S[i] in chk:
i+=1
pass
else:
print 'You will lose'
i+=20
I read a lot of other people's answers because there are various desperate differences in how to handle arrays. .. ..
C problem It seems that it was the easiest question for me because the policy was decided immediately after looking at the problem statement and the sample. I saw A and B earlier, so submission is late. .. I didn't doubt that the number that could be seen from behind by sorting the list in ascending order would be the maximum rate that could achieve.
C problem
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import time
import sys
import io
import re
import math
#start = time.time()
start = time.clock()
a = 0
sw=0
(N, K) = map(float, raw_input().split())
R = map(float, raw_input().split())
x=N-K
R.sort()
for i in range(int(x), int(N)):
# print a
a=((R[i])+a)/2
print a
Yes.
Recommended Posts