2016-09-14から1日間の記事一覧

AOJ0024

Physical Experiments | Aizu Online Judge , より,. 階での高さは だから,. これを解いて,. ガラス球が割れるような速度 に達するためには, 階から落下させればよい. from math import ceil while True: try: print(ceil(float(input()) ** 2 / 98)…

AOJ0023

Circles Intersection | Aizu Online Judge from math import hypot n = int(input()) for i in range(n): x1, y1, r1, x2, y2, r2 = map(float, input().split()) d = hypot(x1 - x2, y1 - y2) if d > r1 + r2: print(0) elif abs(r1 - r2) <= d: print(1) …

AOJ0022

Maximum Sum Sequence | Aizu Online Judge while True: n = int(input()) if n == 0: break s = [int(input())] for i in range(1, n): a = int(input()) s.append(max(a, a + s[i - 1])) print(max(s))

AOJ0021

Parallelism | Aizu Online Judge n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) c1 = (y1 - y2) * (x3 - x4) c2 = (y3 - y4) * (x1 - x2) if abs(c1 - c2) < 1e-10: print('YES') else: print('NO')

AOJ0020

Capitalize | Aizu Online Judge s = input() print(s.upper())

AOJ0019

Factorial | Aizu Online Judge from math import factorial n = int(input()) print(factorial(n))

AOJ0018

Sorting Five Numbers | Aizu Online Judge s = sorted(list(map(int, input().split())), reverse=True) print(s[0], s[1], s[2], s[3], s[4])

AOJ0017

Caesar Cipher | Aizu Online Judge #include <iostream> using namespace std; int main() { string s; while (getline(cin, s)) { while (true) { for (int i = 0; i < s.length(); ++i) { if (s[i] == ' ' || s[i] == '.') { continue; } if (s[i] == 'z') { s[i] -</iostream>…