buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
import math x1,y1,x2,y2 = tuple(int(n) for n in input().split()) D = math.sqrt((x2-x1)**2 + (y2-y1)**2) print("{:.8f}".format(D))
import math x1,y1,x2,y2 = tuple(float(n) for n in input().split()) D = math.sqrt((x2-x1)**2 + (y2-y1)**2) print("{:.8f}".format(D))
[["-", 0, 662, 12, 652, 3, 668, 8, 652, 63, 22], ["+", 0, 662, 12, 652, 3, 668, 8, 652, 63, 22]]
5
60
import math x1, y1, x2, y2 = map(int, input().split()) X = x1 - x2 Y = y1 - y2 print('{:.5f}'.format(math.sqrt(X * X + Y * Y)))
import math x1, y1, x2, y2 = map(float, input().split()) X = x1 - x2 Y = y1 - y2 print('{:.5f}'.format(math.sqrt(X * X + Y * Y)))
[["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22]]
5
54
# -*- coding: utf-8 -*- import math x1, y1, x2, y2 = map(float, input().split()) dis = math.sqrt((x1 + x2) * (x1 + x2) + (y1 + y2) * (y1 + y2)) print(dis)
# -*- coding: utf-8 -*- import math x1, y1, x2, y2 = map(float, input().split()) dis = math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)) print(dis)
[["-", 0, 657, 31, 657, 31, 23, 0, 657, 17, 72], ["+", 0, 657, 31, 657, 31, 23, 0, 657, 17, 33], ["-", 0, 657, 31, 657, 12, 23, 0, 657, 17, 72], ["+", 0, 657, 31, 657, 12, 23, 0, 657, 17, 33], ["-", 0, 657, 12, 657, 31, 23, 0, 657, 17, 72], ["+", 0, 657, 12, 657, 31, 23, 0, 657, 17, 33], ["-", 0, 657, 12, 657, 12, 23, ...
5
57
#! python3 # distance.py import math x1, y1, x2, y2 = [int(x) for x in input().split(' ')] print('%.5f'%math.sqrt(pow(x2-x1, 2) + pow(y2-y1, 2)))
#! python3 # distance.py import math x1, y1, x2, y2 = [float(x) for x in input().split(' ')] print('%.5f'%math.sqrt(pow(x2-x1, 2) + pow(y2-y1, 2)))
[["-", 0, 1, 0, 662, 12, 658, 8, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 658, 8, 652, 63, 22]]
5
60
import math a,b,c,d = map(int,input().split()) print(math.sqrt(((c-a)**2) + ((d-b)**2)))
import math a,b,c,d = map(float,input().split()) print(math.sqrt(((c-a)**2) + ((d-b)**2)))
[["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22]]
5
49
import math l=input().split() x1=int(l[0]) y1=int(l[1]) x2=int(l[2]) y2=int(l[3]) A=math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)) print(A)
import math l=input().split() x1=float(l[0]) y1=float(l[1]) x2=float(l[2]) y2=float(l[3]) A=math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)) print(A)
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22]]
5
81
import math def floatinput(): a = input().split() for i in range(len(a)): a[i] = float(a[i]) return a def main(): a = numinput() x1 = a[0]; y1 = a[1]; x2 = a[2]; y2 = a[3] print(math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)) if __name__ == "__main__": main()
import math def floatinput(): a = input().split() for i in range(len(a)): a[i] = float(a[i]) return a def main(): a = floatinput() x1 = a[0]; y1 = a[1]; x2 = a[2]; y2 = a[3] print(math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)) if __name__ == "__main__": main()
[["-", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22]]
5
111
from math import sqrt x1,x2,y1,y2=map(float,input().split()) a=abs(x1-y1) b=abs(x2-y2) s=sqrt(a+b) print(s)
from math import sqrt x1,x2,y1,y2=map(float,input().split()) a=abs(x1-y1)**2 b=abs(x2-y2)**2 s=sqrt(a+b) print(s)
[["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 578], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]]
5
52
import math x1, y1, x2, y2 = map(int, input().split()) print(math.sqrt(abs(x2-x1)**2 + abs(y2-y1)**2))
import math x1, y1, x2, y2 = map(float, input().split()) print(math.sqrt(abs(x2-x1)**2 + abs(y2-y1)**2))
[["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22]]
5
47
import math a, b, c, d = map(int, input().split()) s1 = (a - c) * (a - c) s2 = (b - d) * (b - d) print("%.6f"%math.sqrt(s1+s2))
import math a, b, c, d = map(float, input().split()) s1 = (a - c) * (a - c) s2 = (b - d) * (b - d) print("%.6f"%math.sqrt(s1+s2))
[["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22]]
5
63
x1, y1, x2, y2 = map(int, input().split()) print(((y2-y1)**2 + (x2-x1)**2)**(1/2))
x1, y1, x2, y2 = map(float, input().split()) print(((y2-y1)**2 + (x2-x1)**2)**(1/2))
[["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22]]
5
46
# Distance points = [int(i) for i in input().rstrip().split()] a = [points[0], points[1]] b = [points[2], points[3]] distanceSquare = (a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2 distance = distanceSquare ** 0.5 print(distance)
# Distance points = [float(i) for i in input().rstrip().split()] a = [points[0], points[1]] b = [points[2], points[3]] distanceSquare = (a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2 distance = distanceSquare ** 0.5 print(distance)
[["-", 0, 1, 0, 662, 12, 658, 8, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 658, 8, 652, 63, 22]]
5
87
import math x1, y1, x2, y2 = list(map(float, input().split())) print(sqrt((x2-x1)**2 + (y2-y1)**2))
import math x1, y1, x2, y2 = list(map(float, input().split())) print(math.sqrt((x2-x1)**2 + (y2-y1)**2))
[["+", 0, 652, 3, 4, 0, 652, 63, 319, 500, 22], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 0, 131]]
5
46
package main import ( "fmt" "math" ) func main(){ var a, b, c, s, l, h, theta float64 fmt.Scan(&a, &b, &c) theta = math.Pi / 180.0 * c s = a * b * math.Sin(theta) / 2.0 l = a + b + math.Sqrt(a*a+b*b-2.0*a*b*math.Cos(theta)) h = a * math.Sin(theta) fmt.Println(s) fmt.Println(l) fmt.Println(h) }
package main import ( "fmt" "math" ) func main(){ var a, b, c, s, l, h, theta float64 fmt.Scan(&a, &b, &c) theta = math.Pi / 180.0 * c s = a * b * math.Sin(theta) / 2.0 l = a + b + math.Sqrt(a*a+b*b-2.0*a*b*math.Cos(theta)) h = b * math.Sin(theta) fmt.Println(s) fmt.Println(l) fmt.Println(h) }
[["-", 8, 196, 0, 436, 12, 432, 0, 16, 31, 22], ["+", 8, 196, 0, 436, 12, 432, 0, 16, 31, 22]]
7
141
<?php while (true) { $n = trim(fgets(STDIN)); if (!$n) break; $points = explode(" ", trim(fgets(STDIN))); $avg = array_sum($points) / $n; $dispersion = 0; foreach ($points as $point) $dispersion += pow($avg - $point, 2); $dispersion /= $n; echo sprintf("$.10f\n", abs(sqrt($dispersion))); }
<?php while (true) { $n = trim(fgets(STDIN)); if (!$n) break; $points = explode(" ", trim(fgets(STDIN))); $avg = array_sum($points) / $n; $dispersion = 0; foreach ($points as $point) $dispersion += pow($avg - $point, 2); $dispersion /= $n; echo sprintf("%.10f\n", abs(sqrt($dispersion))); }
[["-", 0, 613, 3, 3, 0, 28, 0, 609, 0, 610], ["+", 0, 613, 3, 3, 0, 28, 0, 609, 0, 610]]
6
107
import java.lang.*; import java.util.*; /** * StandardDeviation */ public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) break; int list[] = new int[n]; int sum = 0; for (i...
import java.lang.*; import java.util.*; /** * StandardDeviation */ public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) break; int list[] = new int[n]; double sum = 0; for...
[["-", 0, 52, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 52, 8, 196, 0, 503, 39, 511, 0, 512]]
3
183
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); for (;;) { int a = scan.nextInt(); if (a == 0) { break; } double ans = 0; int b[] = new int[a]; int sum = 0; for (int i = 0; i < a; i+...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); for (;;) { int a = scan.nextInt(); if (a == 0) { break; } double ans = 0; int b[] = new int[a]; double sum = 0; for (int i = 0; i < a;...
[["-", 0, 7, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 7, 8, 196, 0, 503, 39, 511, 0, 512]]
3
175
import java.util.*; class Main { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); while (true) { int n = stdIn.nextInt(); if (n == 0) break; int[] s = new int[n]; int sum = 0; for (int i = 0; i < n; i++) { sum += s[i] = stdIn.nextI...
import java.util.*; class Main { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); while (true) { int n = stdIn.nextInt(); if (n == 0) break; int[] s = new int[n]; double sum = 0; for (int i = 0; i < n; i++) { sum += s[i] = stdI...
[["-", 0, 52, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 52, 8, 196, 0, 503, 39, 511, 0, 512], ["-", 0, 503, 49, 200, 51, 16, 31, 74, 0, 24], ["-", 49, 200, 51, 16, 31, 74, 39, 511, 0, 512], ["-", 0, 503, 49, 200, 51, 16, 31, 74, 0, 25]]
3
174
import java.util.*; public class Main { public static void main(String args[]) { Scanner scan = new Scanner(System.in); while (true) { int studentNum = scan.nextInt(); if (studentNum == 0) { break; } int[] point = new int[studentNum]; // input, calculate sum in...
import java.util.*; public class Main { public static void main(String args[]) { Scanner scan = new Scanner(System.in); while (true) { int studentNum = scan.nextInt(); if (studentNum == 0) { break; } int[] point = new int[studentNum]; // input, calculate sum in...
[["+", 0, 503, 49, 200, 51, 16, 31, 74, 0, 24], ["+", 49, 200, 51, 16, 31, 74, 39, 511, 0, 512], ["+", 0, 503, 49, 200, 51, 16, 31, 74, 0, 25], ["+", 0, 503, 49, 200, 51, 16, 12, 74, 0, 24], ["+", 49, 200, 51, 16, 12, 74, 39, 511, 0, 512], ["+", 0, 503, 49, 200, 51, 16, 12, 74, 0, 25]]
3
183
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); while (scan.hasNext()) { int n = Integer.parseInt(scan.nextLine()); if (n == 0) { break; } String[] input = scan.nextLine().split(" "); int[] s = ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); while (scan.hasNext()) { int n = Integer.parseInt(scan.nextLine()); if (n == 0) { break; } String[] input = scan.nextLine().split(" "); int[] s = ...
[["+", 0, 503, 49, 200, 51, 16, 31, 74, 0, 24], ["+", 49, 200, 51, 16, 31, 74, 39, 511, 0, 512], ["+", 0, 503, 49, 200, 51, 16, 31, 74, 0, 25]]
3
210
public class Main { public static void main(String[] args) { java.util.Scanner sc = new java.util.Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) { break; } int[] s = new int[n]; int m = 0; for (int i = 0; i < n; i++) { s[i] = sc.next...
public class Main { public static void main(String[] args) { java.util.Scanner sc = new java.util.Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) { break; } int[] s = new int[n]; double m = 0; for (int i = 0; i < n; i++) { s[i] = sc.n...
[["-", 0, 52, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 52, 8, 196, 0, 503, 39, 511, 0, 512]]
3
185
import static java.lang.Math.pow; import static java.lang.Math.sqrt; import java.util.Scanner; class Main { public static void main(String[] arg) { Scanner in = new Scanner(System.in); String input = in.nextLine(); int cnt = Integer.parseInt(input); while (cnt != 0) { int sum = 0; i...
import static java.lang.Math.pow; import static java.lang.Math.sqrt; import java.util.Scanner; class Main { public static void main(String[] arg) { Scanner in = new Scanner(System.in); String input = in.nextLine(); int cnt = Integer.parseInt(input); while (cnt != 0) { double sum = 0.0; ...
[["-", 0, 52, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 52, 8, 196, 0, 503, 39, 511, 0, 512], ["-", 0, 52, 8, 196, 0, 503, 49, 200, 51, 499], ["+", 0, 52, 8, 196, 0, 503, 49, 200, 51, 515]]
3
255
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) { break; } int[] scores = new int[n]; double average = 0, variance = 0; for (int i = 0; i < ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) { break; } int[] scores = new int[n]; double average = 0, variance = 0; for (int i = 0; i < ...
[["+", 0, 52, 8, 196, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 11, 17, 90], ["+", 0, 52, 8, 196, 0, 1, 0, 11, 12, 22], ["+", 8, 196, 0, 52, 8, 196, 0, 1, 0, 35]]
3
172
import java.io.*; import java.util.Scanner; class aizu { public static void main(String[] args) { Scanner scan = new Scanner(System.in); while (true) { int n = scan.nextInt(); if (n == 0) break; int[] s; s = new int[n]; int sum = 0; for (int i = 0; i < n; i++) { ...
import java.io.*; import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); while (true) { int n = scan.nextInt(); if (n == 0) break; int[] s; s = new int[n]; int sum = 0; for (int i = 0; i < n; i++) { ...
[["-", 36, 36, 36, 36, 0, 493, 0, 235, 141, 22], ["+", 36, 36, 36, 36, 0, 493, 0, 235, 141, 22], ["-", 49, 200, 51, 16, 31, 492, 3, 4, 0, 25], ["+", 0, 503, 49, 200, 51, 492, 3, 4, 0, 25]]
3
191
import java.util.Scanner; public class Main { void run() { Scanner s = new Scanner(System.in); while (true) { int n = s.nextInt(); if (n == 0) break; int[] stu = new int[n]; int sum = 0; for (int i = 0; i < n; i++) { stu[i] = s.nextInt(); sum += stu[i]; ...
import java.util.Scanner; public class Main { void run() { Scanner s = new Scanner(System.in); while (true) { int n = s.nextInt(); if (n == 0) break; int[] stu = new int[n]; int sum = 0; for (int i = 0; i < n; i++) { stu[i] = s.nextInt(); sum += stu[i]; ...
[["+", 0, 503, 49, 200, 51, 16, 31, 23, 0, 24], ["+", 49, 200, 51, 16, 31, 23, 0, 74, 0, 24], ["+", 51, 16, 31, 23, 0, 74, 39, 511, 0, 512], ["+", 49, 200, 51, 16, 31, 23, 0, 74, 0, 25], ["+", 0, 503, 49, 200, 51, 16, 31, 23, 0, 25]]
3
193
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); while (0 == 0) { int ninzu = scanner.nextInt(); if (ninzu == 0) { break; } int[] tensu = new int[ninzu]; for (int i = 0; ninzu > i; i++) {...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); while (0 == 0) { int ninzu = scanner.nextInt(); if (ninzu == 0) { break; } double[] tensu = new double[ninzu]; for (int i = 0; ninzu > i;...
[["-", 8, 196, 0, 503, 39, 224, 468, 506, 0, 507], ["+", 8, 196, 0, 503, 39, 224, 468, 511, 0, 512], ["-", 0, 503, 49, 200, 51, 227, 39, 506, 0, 507], ["+", 0, 503, 49, 200, 51, 227, 39, 511, 0, 512], ["-", 0, 52, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 52, 8, 196, 0, 503, 39, 511, 0, 512]]
3
199
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) { break; } else { int sum = 0; int[] s = new int[n]; for (int i = 0; i < n; i++) { ...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) { break; } else { int sum = 0; int[] s = new int[n]; for (int i = 0; i < n; i++) { ...
[["+", 0, 503, 49, 200, 51, 16, 31, 74, 0, 24], ["+", 49, 200, 51, 16, 31, 74, 39, 511, 0, 512], ["+", 0, 503, 49, 200, 51, 16, 31, 74, 0, 25], ["+", 0, 503, 49, 200, 51, 16, 12, 74, 0, 24], ["+", 49, 200, 51, 16, 12, 74, 39, 511, 0, 512], ["+", 0, 503, 49, 200, 51, 16, 12, 74, 0, 25]]
3
186
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); for (;;) { int n = scanner.nextInt(); if (n == 0) { break; } int[] s = new int[1000]; int sum = 0; for (int i = 0; i < n; i++) { ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); for (;;) { int n = scanner.nextInt(); if (n == 0) { break; } double[] s = new double[1000]; double sum = 0; for (int i = 0; i < n; i++...
[["-", 8, 196, 0, 503, 39, 224, 468, 506, 0, 507], ["+", 8, 196, 0, 503, 39, 224, 468, 511, 0, 512], ["-", 0, 503, 49, 200, 51, 227, 39, 506, 0, 507], ["+", 0, 503, 49, 200, 51, 227, 39, 511, 0, 512], ["-", 0, 7, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 7, 8, 196, 0, 503, 39, 511, 0, 512], ["-", 8, 196, 0, 1, 0, 11, ...
3
180
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { try { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String str; while (!(str = reader.readLine())...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { try { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String str; while (!(str = reader.readLine())...
[["-", 0, 52, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 52, 8, 196, 0, 503, 39, 511, 0, 512], ["-", 0, 503, 49, 200, 51, 227, 39, 506, 0, 507], ["+", 0, 503, 49, 200, 51, 227, 39, 511, 0, 512], ["-", 8, 196, 0, 1, 0, 11, 12, 492, 500, 22], ["+", 8, 196, 0, 1, 0, 11, 12, 492, 500, 22], ["-", 8, 196, 0, 1, 0, 11, 12, 49...
3
244
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); for (;;) { ...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); for (;;) { ...
[["-", 0, 7, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 7, 8, 196, 0, 503, 39, 511, 0, 512]]
3
255
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line; while (!((line = br.readLine()).equals("0")...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line; while (!((line = br.readLine()).equals("0")...
[["-", 0, 52, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 52, 8, 196, 0, 503, 39, 511, 0, 512], ["-", 0, 1, 0, 11, 12, 492, 3, 4, 0, 24], ["-", 0, 11, 12, 492, 3, 4, 0, 23, 0, 25]]
3
233
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); List<Integer> score = new ArrayList<>(); int total = 0; int a2n = 0; while (true) { int n = sc.nextInt(); if ...
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); List<Integer> score = new ArrayList<>(); double total = 0; double a2n = 0.0; while (true) { int n = sc.nextInt(); ...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512], ["-", 0, 195, 8, 196, 0, 503, 49, 200, 51, 499], ["+", 0, 195, 8, 196, 0, 503, 49, 200, 51, 515]]
3
189
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) { break; } int[] s = new int[n]; int sum = 0; for (int i = 0; i < n; i++) { s[i] =...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) { break; } int[] s = new int[n]; int sum = 0; for (int i = 0; i < n; i++) { s[i] =...
[["+", 0, 503, 49, 200, 51, 16, 12, 74, 0, 24], ["+", 49, 200, 51, 16, 12, 74, 39, 511, 0, 512], ["+", 0, 503, 49, 200, 51, 16, 12, 74, 0, 25], ["-", 0, 52, 8, 196, 0, 503, 49, 200, 51, 499], ["+", 0, 52, 8, 196, 0, 503, 49, 200, 51, 515]]
3
181
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = 0; int m = 0; double temp = 0; int count = 0; double ans[] = new double[1000]; while (true) { n = sc.nextInt(); if (n == 0) break; ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = 0; double m = 0; double temp = 0; int count = 0; double ans[] = new double[1000]; while (true) { n = sc.nextInt(); if (n == 0) break; ...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512]]
3
228
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); while (true) { int num = scanner.nextInt(); if (num == 0) { break; } int[] score = new int[num]; for (int i = 0; i < num; i++) { sc...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); while (true) { int num = scanner.nextInt(); if (num == 0) { break; } int[] score = new int[num]; for (int i = 0; i < num; i++) { sc...
[["-", 0, 52, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 52, 8, 196, 0, 503, 39, 511, 0, 512]]
3
173
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int n = 0, i, j; double sum = 0, a = 0, b = 0; n = sc.nextInt(); if (n == 0) { break; } int[] d = new int[n]; for (i = 0; i < n...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int n = 0, i, j; double sum = 0, a = 0, b = 0; n = sc.nextInt(); if (n == 0) { break; } int[] d = new int[n]; for (i = 0; i < n...
[["+", 0, 52, 8, 196, 0, 7, 8, 196, 0, 46], ["-", 0, 52, 8, 196, 0, 7, 8, 196, 0, 46]]
3
190
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) break; int i; int[] ten; ten = new int[n]; int sum = 0; for (i = 0; i < n; i++) { ...
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) break; int i; int[] ten; ten = new int[n]; int sum = 0; for (i = 0; i < n; i++) { ...
[["-", 0, 52, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 52, 8, 196, 0, 503, 39, 511, 0, 512], ["+", 0, 503, 49, 200, 51, 16, 31, 74, 0, 24], ["+", 49, 200, 51, 16, 31, 74, 39, 511, 0, 512], ["+", 0, 503, 49, 200, 51, 16, 31, 74, 0, 25]]
3
193
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); while (n != 0) { int[] score = new int[n]; double ave = 0.0; double val = 0.0; for (int i = 0; i < n; i++) { score[i] = sc...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); while (n != 0) { int[] score = new int[n]; double ave = 0.0; double val = 0.0; for (int i = 0; i < n; i++) { score[i] = sc...
[["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 44], ["-", 8, 196, 0, 1, 0, 492, 3, 4, 0, 21], ["-", 8, 196, 0, 1, 0, 492, 3, 4, 0, 22]]
3
195
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int i, n, j, S = 0; double avr, O = 0, s; for (i = 0;; i++) { n = sc.nextInt(); int array[] = new int[n]; if (n == 0) { break; } else { fo...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int i, n, j, S = 0; double avr, O = 0, s; for (i = 0;; i++) { n = sc.nextInt(); int array[] = new int[n]; if (n == 0) { break; } else { fo...
[["+", 0, 1, 0, 11, 12, 16, 12, 74, 0, 24], ["+", 0, 11, 12, 16, 12, 74, 39, 511, 0, 512], ["+", 0, 1, 0, 11, 12, 16, 12, 74, 0, 25]]
3
209
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) break; double[] score = new double[n]; double sum = 0.0; for (int i = 0; i < n; i++) { sc...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) break; double[] score = new double[n]; double sum = 0.0; for (int i = 0; i < n; i++) { sc...
[["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
174
import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { while (true) { int sum = 0, sqsum = 0; int n = sc.nextInt(); if (n == 0) break; int[] score = new int[n]; for (int i = 0; i < ...
import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { while (true) { int sum = 0; double sqsum = 0; int n = sc.nextInt(); if (n == 0) break; int[] score = new int[n]; for (...
[["-", 8, 196, 0, 52, 8, 196, 0, 503, 0, 21], ["+", 8, 196, 0, 52, 8, 196, 0, 503, 0, 35], ["+", 0, 52, 8, 196, 0, 503, 39, 511, 0, 512]]
3
197
import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { while (true) { int n = sc.nextInt(); int sum = 0; if (n == 0) { break; } int[] scores = new int[n]; for (int i = 0; i ...
import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { while (true) { int n = sc.nextInt(); int sum = 0; if (n == 0) { break; } int[] scores = new int[n]; for (int i = 0; i...
[["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 24], ["+", 0, 11, 12, 16, 31, 74, 39, 511, 0, 512], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 25]]
3
218
import java.util.Scanner; public class Main { public static void main(String[] arg) { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) break; int[] s = new int[n]; int sum = 0; for (int i = 0; i < n; i++) { s[i] = sc.nextI...
import java.util.Scanner; public class Main { public static void main(String[] arg) { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) break; int[] s = new int[n]; int sum = 0; for (int i = 0; i < n; i++) { s[i] = sc.nextI...
[["+", 0, 1, 0, 11, 12, 16, 12, 74, 0, 24], ["+", 0, 11, 12, 16, 12, 74, 39, 511, 0, 512], ["+", 0, 1, 0, 11, 12, 16, 12, 74, 0, 25]]
3
193
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int i, j, k, sum = 0; double ave, s = 0, sg = 0; j = sc.nextInt(); int[] intarray = new int[j]; if (j == 0) { break; } ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int i, j, k; double sum = 0, ave, s = 0, sg = 0; j = sc.nextInt(); int[] intarray = new int[j]; if (j == 0) { break; } ...
[["-", 8, 196, 0, 52, 8, 196, 0, 503, 0, 21], ["+", 8, 196, 0, 52, 8, 196, 0, 503, 0, 35], ["+", 0, 52, 8, 196, 0, 503, 39, 511, 0, 512], ["-", 8, 196, 0, 52, 8, 196, 0, 503, 0, 35], ["-", 0, 52, 8, 196, 0, 503, 39, 511, 0, 512], ["+", 8, 196, 0, 52, 8, 196, 0, 503, 0, 21]]
3
190
import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); while (true) { int n = scan.nextInt(); int[] score; int sum = 0, avg; double bunsan = 0; if (n == 0) break; score = new int[n]; for (int i...
import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); while (true) { int n = scan.nextInt(); int[] score; double sum = 0, avg; double bunsan = 0; if (n == 0) break; score = new int[n]; for (in...
[["-", 0, 52, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 52, 8, 196, 0, 503, 39, 511, 0, 512], ["+", 8, 196, 0, 1, 0, 11, 12, 74, 0, 24], ["+", 0, 1, 0, 11, 12, 74, 39, 511, 0, 512], ["+", 8, 196, 0, 1, 0, 11, 12, 74, 0, 25]]
3
181
import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { while (true) { int n = sc.nextInt(); if (n == 0) { break; } int[] scores = new int[n]; for (int i = 0; i < scores.length; i++)...
import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { while (true) { int n = sc.nextInt(); if (n == 0) { break; } int[] scores = new int[n]; for (int i = 0; i < scores.length; i++)...
[["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 24], ["+", 0, 11, 12, 16, 31, 74, 39, 511, 0, 512], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 25]]
3
219
import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { while (true) { int num = sc.nextInt(); int score[] = new int[num]; double ave = 0; double var = 0; if (num == 0) break; ...
import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { while (true) { int num = sc.nextInt(); double score[] = new double[num]; double ave = 0; double var = 0; if (num == 0) break; ...
[["-", 0, 52, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 52, 8, 196, 0, 503, 39, 511, 0, 512], ["-", 0, 503, 49, 200, 51, 227, 39, 506, 0, 507], ["+", 0, 503, 49, 200, 51, 227, 39, 511, 0, 512]]
3
184
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n, sum = 0, sum2 = 0; ; double ave = 0; int[] data = new int[1001]; double[] data2 = new double[1001]; while (true) { n = sc.nextInt(); if (n == 0) ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n; double sum = 0, sum2 = 0; ; double ave = 0; double[] data = new double[1001]; double[] data2 = new double[1001]; while (true) { n = sc.nextInt(); ...
[["-", 8, 498, 0, 195, 8, 196, 0, 503, 0, 21], ["+", 8, 498, 0, 195, 8, 196, 0, 503, 0, 35], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512], ["-", 8, 196, 0, 503, 39, 224, 468, 506, 0, 507], ["+", 8, 196, 0, 503, 39, 224, 468, 511, 0, 512], ["-", 0, 503, 49, 200, 51, 227, 39, 506, 0, 507], ["+", 0, 503, 49, 200, 51, 22...
3
218
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNextInt()) { int n = sc.nextInt(); if (n == 0) break; int[] s = new int[n]; int m = 0; for (int i = 0; i < n; ++i) { m += s[i]...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNextInt()) { int n = sc.nextInt(); if (n == 0) break; int[] s = new int[n]; double m = 0; for (int i = 0; i < n; ++i) { m += s...
[["-", 0, 52, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 52, 8, 196, 0, 503, 39, 511, 0, 512]]
3
164
import java.io.*; class Main { public static void main(String args[]) throws IOException { BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); String a; while (true) { a = input.readLine(); if (a.equals("0")) break; int n = Integer.parseInt(a); Str...
import java.io.*; class Main { public static void main(String args[]) throws IOException { BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); String a; while (true) { a = input.readLine(); if (a.equals("0")) break; int n = Integer.parseInt(a); Str...
[["-", 0, 52, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 52, 8, 196, 0, 503, 39, 511, 0, 512]]
3
220
#include <math.h> #include <stdio.h> int main(void) { int i, n, s[1000]; double h, sum; while (1) { scanf("%d", &n); if (!n) break; sum = 0; h = 0; for (i = 0; i < n; i++) { scanf("%d", &s[i]); sum += s[i]; } sum /= n; // printf("%lf ",sum); for (i...
#include <math.h> #include <stdio.h> int main(void) { int i, n, s[1000]; double h, sum; while (1) { scanf("%d", &n); if (!n) break; sum = 0; h = 0; for (i = 0; i < n; i++) { scanf("%d", &s[i]); sum += s[i]; } sum /= n; // printf("%lf ",sum); for (i...
[["-", 3, 4, 0, 2, 3, 4, 0, 16, 31, 13], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 31, 13], ["-", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13]]
0
151
#include <math.h> #include <stdio.h> int main(void) { while (1) { int N, n, S[1000], t = 0; double m, a2 = 0; scanf("%d\n", &N); if (N == 0) break; for (n = 0; n < N; n++) { scanf("%d", &S[n]); t = t + S[n]; } m = t / n; for (n = 0; n < N; n++) { a2 = a2 + (m -...
#include <math.h> #include <stdio.h> int main(void) { while (1) { int N, n, S[1000], t = 0; double m, a2 = 0; scanf("%d\n", &N); if (N == 0) break; for (n = 0; n < N; n++) { scanf("%d", &S[n]); t = t + S[n]; } m = (double)t / n; for (n = 0; n < N; n++) { a2 = a...
[["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 24], ["+", 0, 11, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 25], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 3, 4, 0, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 2, 3, 4, 0, 16, 31, 74, 0, 25]]
0
155
#define _USE_MATH_DEFINES #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int na[1000] = {0}; double sig; while (1) { int n, sum, i; sum = 0; memset(na, 0, sizeof(int) * 1000); scanf("%d", &n); if (n == 0) break; for (i = 0; i < n; i++) { ...
#define _USE_MATH_DEFINES #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int na[1000] = {0}; double sig; while (1) { int n, i; double sum = 0; memset(na, 0, sizeof(int) * 1000); scanf("%d", &n); if (n == 0) break; for (i = 0; i < n; i++) ...
[["-", 8, 9, 0, 52, 8, 9, 0, 43, 49, 22], ["-", 8, 9, 0, 52, 8, 9, 0, 43, 0, 21], ["+", 8, 9, 0, 52, 8, 9, 0, 43, 39, 40]]
0
182
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> double ave(int *data, int dx) { int i; int sum = 0; for (i = 0; i < dx; i++) { sum += data[i]; } return 1.0 * sum / dx; } double st_div(int *data, int dx) { int i; double m = ave(data, dx); double sum = 0; for (i = 0...
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> double ave(int *data, int dx) { int i; int sum = 0; for (i = 0; i < dx; i++) { sum += data[i]; } return 1.0 * sum / dx; } double st_div(int *data, int dx) { int i; double m = ave(data, dx); double sum = 0; for (i = 0...
[["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["+", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
0
273
#include <math.h> #include <stdio.h> #include <stdlib.h> double average(int *points, int n) { int i, ave; ave = 0; for (i = 0; i < n; i++) ave += *points++; ave /= (double)n; return (ave); } double std_diviation(int *points, int n) { int i; double ave, ret; ret = 0; ave = average(points, n); f...
#include <math.h> #include <stdio.h> #include <stdlib.h> double average(int *points, int n) { int i; double ave; ave = 0; for (i = 0; i < n; i++) ave += *points++; ave /= (double)n; return (ave); } double std_diviation(int *points, int n) { int i; double ave, ret; ret = 0; ave = average(points...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
0
246
#include <math.h> #include <stdio.h> int main(void) { int n, s[1000], i; double ex1, ex2, b; while (scanf("%d", &n), n) { ex1 = ex2 = 0; for (i = 0; i < n; i++) { scanf("%d", &s[i]); ex1 += s[i] * s[i]; ex2 += s[i]; } b = (ex1 / n) - pow(ex2 / n, 2); printf("%.8f\n", b); } ...
#include <math.h> #include <stdio.h> int main(void) { int n, s[1000], i; double ex1, ex2, b; while (scanf("%d", &n), n) { ex1 = ex2 = 0; for (i = 0; i < n; i++) { scanf("%d", &s[i]); ex1 += s[i] * s[i]; ex2 += s[i]; } b = sqrt((ex1 / n) - pow(ex2 / n, 2)); printf("%.8f\n", b)...
[["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 12, 2, 3, 4, 0, 16, 31, 23, 0, 24], ["+", 3, 4, 0, 16, 12, 2, 3, 4, 0, 25]]
0
127
#include <math.h> #include <stdio.h> int main(void) { int s[1001], i, n; long int sum = 0; double sd, bs, mean; while (1) { scanf("%d", &n); if (!n) break; sum = 0; for (i = 0; i < n; i++) { scanf("%d", &s[i]); sum += s[i]; } mean = sum / n; bs = 0; for (i = 0; ...
#include <math.h> #include <stdio.h> int main(void) { int s[1001], i, n; long int sum = 0; double sd, bs, mean; while (1) { scanf("%d", &n); if (!n) break; sum = 0; for (i = 0; i < n; i++) { scanf("%d", &s[i]); sum += s[i]; } mean = (double)sum / n; bs = 0; for ...
[["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 24], ["+", 0, 11, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 25], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 24], ["+", 3, 4, 0, 16, 31, 74, 39, 77, 39, 40], ["+", 12, 2, 3, 4, 0, 16, 31, 74, 0, 25]]
0
157
#include <math.h> #include <stdio.h> int main(void) { int n, s[1000], i, sum1, sum2; double SD, avr; while (scanf("%d", &n), n != 0) { sum1 = sum2 = 0; for (i = 0; i < n; i++) { scanf("%d", &s[i]); sum1 += s[i]; } avr = sum1 / n; for (i = 0; i < n; i++) { sum2 += (s[i] - avr)...
#include <math.h> #include <stdio.h> int main(void) { int n, s[1000], i; double SD, sum1, sum2, avr; while (scanf("%d", &n), n != 0) { sum1 = sum2 = 0; for (i = 0; i < n; i++) { scanf("%d", &s[i]); sum1 += s[i]; } avr = sum1 / n; for (i = 0; i < n; i++) { sum2 += (s[i] - avr)...
[["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22]]
0
152
main(i, n) { int a[101]; double m; for (;;) { for (i = 0; i < 101; a[i++] = 0) ; scanf("%d", &n); if (!n) break; for (i = 1; i <= n; scanf("%d", &a[i]), a[0] += a[i++]) ; m = a[0] / n; a[0] = 0; for (i = 1; i <= n; a[0] += pow(a[i++] - m, 2)) ; printf("%lf\n...
main(i, n) { double a[101]; double m; for (;;) { for (i = 0; i < 101; a[i++] = 0) ; scanf("%d", &n); if (!n) break; for (i = 1; i <= n; scanf("%lf", &a[i]), a[0] += a[i++]) ; m = a[0] / n; a[0] = 0; for (i = 1; i <= n; a[0] += pow(a[i++] - m, 2)) ; printf("%...
[["-", 36, 36, 0, 30, 0, 9, 0, 43, 39, 40], ["+", 36, 36, 0, 30, 0, 9, 0, 43, 39, 40], ["-", 26, 34, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 26, 34, 31, 2, 3, 4, 0, 5, 0, 6]]
0
163
#include <math.h> #include <stdio.h> int main() { int n, i, ten[10000], sum; double s, m, l; while (1) { scanf("%d", &n); if (n == 0) break; for (i = 0; i < n; i++) { scanf("%d", &ten[i]); } sum = 0; for (i = 0; i < n; i++) { sum += ten[i]; } m = sum / n; s...
#include <math.h> #include <stdio.h> int main() { int n, i, ten[1001], sum; double s, m, l; while (1) { scanf("%d", &n); if (n == 0) break; for (i = 0; i < n; i++) { scanf("%d", &ten[i]); } sum = 0; for (i = 0; i < n; i++) { sum += ten[i]; } m = 1.0 * sum / n; ...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 31, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 48]]
0
174
#include <math.h> //"Compiler options:"???"-lm"??¨??\??? #include <stdio.h> int main(void) { while (1) { int n; double m = 0.0, a = 0.0; scanf("%d", &n); if (n == 0) break; else { int s[n]; int i; for (i = 0; i < n; i++) { scanf("%d", &s[i]); } for (i =...
#include <math.h> //"Compiler options:"???"-lm"??¨??\??? #include <stdio.h> int main(void) { while (1) { int n; double m = 0.0, a = 0.0; scanf("%d", &n); if (n == 0) break; else { int s[n]; int i; for (i = 0; i < n; i++) { scanf("%d", &s[i]); } for (i =...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["-", 0, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
0
172
#include <math.h> #include <stdio.h> double aven(int n, double *data) { int i; double sum = 0; for (i = 0; i < n; ++i) { sum += data[i]; } return (sum / n); } double hyouzyunhensa(int n, double *data, double ave) { int i; double sum = 0; for (i = 0; i < n; ++i) { sum += (data[i] - ave) * (da...
#include <math.h> #include <stdio.h> double aven(int n, int *data) { int i; double sum = 0; for (i = 0; i < n; ++i) { sum += data[i]; } return (sum / n); } double hyouzyunhensa(int n, int *data, double ave) { int i; double sum = 0; for (i = 0; i < n; ++i) { sum += (data[i] - ave) * (data[i] ...
[["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
0
253
#include <math.h> #include <stdio.h> int main() { int n, s[100], sum; double aa, ave; int i; while (1) { aa = 0; ave = 0; sum = 0; scanf("%d", &n); if (n == 0) break; for (i = 0; i < n; i++) { scanf("%d", &s[i]); sum += s[i]; } ave = sum / n; for (i = 0...
#include <math.h> #include <stdio.h> int main() { int n, s[1010], sum; double aa, ave; int i; while (1) { aa = 0; ave = 0; sum = 0; scanf("%d", &n); if (n == 0) break; for (i = 0; i < n; i++) { scanf("%d", &s[i]); sum += s[i]; } ave = (double)sum / n; f...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 24], ["+", 0, 11, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 25]]
0
158
#include <math.h> #include <stdio.h> int main() { while (1) { int n; scanf("%d", &n); if (n == 0) break; int points[n]; for (int i = 0; i < n; i++) { scanf("%d", &points[i]); } int sum = 0; for (int i = 0; i < n; i++) { sum += points[i]; } double avg; avg...
#include <math.h> #include <stdio.h> int main() { while (1) { int n; scanf("%d", &n); if (n == 0) break; int points[n]; for (int i = 0; i < n; i++) { scanf("%d", &points[i]); } int sum = 0; for (int i = 0; i < n; i++) { sum += points[i]; } double avg; avg...
[["+", 0, 1, 0, 11, 12, 16, 31, 16, 31, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 48], ["-", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13]]
0
207
#include <math.h> #include <stdio.h> double SD(int n) { int i, y; int average = 0, sum = 0; int point[1000] = {0}; double squared, sigma = 0, sd; for (i = 0; i < n; i++) { scanf("%d", &y); point[i] = y; sum += y; } average = sum / n; for (i = 0; i < n; i++) { squared = (point[i] - ave...
#include <math.h> #include <stdio.h> double SD(int n) { int i, y; double average = 0, sum = 0; int point[1000] = {0}; double squared, sigma = 0, sd; for (i = 0; i < n; i++) { scanf("%d", &y); point[i] = y; sum += y; } average = sum / n; for (i = 0; i < n; i++) { squared = (point[i] -...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22]]
0
197
#include <math.h> #include <stdio.h> int main(int argc, const char *argv[]) { int i, j = 0; int n; int s[1000]; double ans[1000]; int sum = 0; double m = 0, a = 0, b = 0; while (1) { scanf("%d", &n); if (n == 0) { break; } for (i = 0; i < n; i++) { scanf("%d", &s[i]); ...
#include <math.h> #include <stdio.h> int main(int argc, const char *argv[]) { int i, j = 0; double n; double s[1000]; double ans[1000]; int sum = 0; double m = 0, a = 0, b = 0; while (1) { scanf("%lf", &n); if (n == 0) { break; } for (i = 0; i < n; i++) { scanf("%lf", &s[i...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
230
#include <math.h> #include <stdio.h> int main(void) { int n = 1, score[1000], i, sum = 0; double ave, dev = 0; // devは「deviation:偏差」aveは「average」の省略 while (n != 0) { scanf(" %d", &n); if (n != 0) { for (i = 0; i < n; i++) { scanf("%d", &score[i]); sum += score[i]; } ave =...
#include <math.h> #include <stdio.h> int main(void) { int n = 1, i, score[1000]; double sum = 0; double ave, dev = 0; // devは「deviation:偏差」aveは「average」の省略 while (n != 0) { scanf(" %d", &n); if (n != 0) { for (i = 0; i < n; i++) { scanf("%d", &score[i]); sum += score[i]; } ...
[["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
0
163
#include <math.h> #include <stdio.h> #include <string.h> int main() { int i, n, sum; double m; int s[1000]; while (1) { memset(s, 0, sizeof(s)); scanf("%d", &n); if (n == 0) break; sum = 0; for (i = 0; i < n; i++) scanf("%d", &s[i]), sum += s[i]; m = sum / n; sum = 0; ...
#include <math.h> #include <stdio.h> #include <string.h> int main() { int i, n; double m, sum; int s[1000]; while (1) { memset(s, 0, sizeof(s)); scanf("%d", &n); if (n == 0) break; sum = 0; for (i = 0; i < n; i++) scanf("%d", &s[i]), sum += s[i]; m = sum / n; sum = 0; ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22]]
0
158
#include <math.h> #include <stdio.h> int main(void) { int num, score[1000], sum, i; double average, sigma; while (1) { scanf("%d", &num); if (num == 0) break; sum = 0; for (i = 0; i < num; i++) { scanf("%d", &score[i]); sum += score[i]; } average = 1.0 * sum / num; su...
#include <math.h> #include <stdio.h> int main(void) { int num, score[1000], i; double average, sigma, sum; while (1) { scanf("%d", &num); if (num == 0) break; sum = 0; for (i = 0; i < num; i++) { scanf("%d", &score[i]); sum += score[i]; } average = 1.0 * sum / num; su...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22]]
0
158
while (n=gets.to_i)!=0 s=gets.split.map &:to_i p (s.inject(0){|a,i|a+(i-(eval s*?+)/n)**2}/n)**0.5 end
while (n=gets.to_i)!=0 s=gets.split.map &:to_f p (s.inject(0){|a,i|a+(i-(eval s*?+)/n)**2}/n)**0.5 end
[["-", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753]]
4
56
loop do sigma = 0 n = gets.to_i exit 0 if n == 0 s = gets.split(" ").map{|x| x.to_i} for i in 0..(s.length - 1) sigma += (s[i] - (s.inject(:+) / s.length)) ** 2 end puts Math::sqrt(sigma / n) end
loop do sigma = 0 n = gets.to_i exit 0 if n == 0 s = gets.split(" ").map{|x| x.to_i} for i in 0..(s.length - 1) sigma += (s[i] - (s.inject(:+).to_f / s.length)) ** 2 end puts Math::sqrt(sigma / n) end
[["+", 0, 738, 12, 739, 0, 738, 31, 652, 17, 131], ["+", 0, 738, 12, 739, 0, 738, 31, 652, 735, 22]]
4
82
def getAverage(points) sum = 0 points.each {|x| sum += x } return (sum / points.length).to_f end while true n = STDIN.gets.to_i if n == 0 then break end str = STDIN.gets.split(" ") point = Array.new(n) { |i| i = str[i].to_i} average = getAverage(point) s = 0.0 for i in 0..point.length - 1 d...
def getAverage(points) sum = 0 points.each {|x| sum += x } return (sum / points.length).to_f end while true n = STDIN.gets.to_i if n == 0 then break end str = STDIN.gets.split(" ") point = Array.new(n) { |i| i = str[i].to_f} average = getAverage(point) s = 0.0 for i in 0..point.length - 1 d...
[["-", 196, 196, 8, 734, 0, 662, 12, 652, 735, 22], ["+", 196, 196, 8, 734, 0, 662, 12, 652, 735, 22]]
4
139
ARGF.each do |line| a = line.to_i break if a == 0 b = line.split.map(&:to_i) z = 0 ave = b.inject(0.0){|r,i| r+=i } / a b.each do |p| z += (p - ave) ** 2 end puts Math.sqrt(z / a) end
ARGF.each do |line| a = line.to_i break if a == 0 b = gets.split.map(&:to_i) z = 0 ave = b.inject(0.0){|r,i| r+=i } / a b.each do |p| z += (p - ave) ** 2 end puts Math.sqrt(z / a) end
[["-", 8, 736, 0, 662, 12, 652, 486, 652, 486, 22], ["+", 8, 736, 0, 662, 12, 652, 486, 652, 486, 22]]
4
78
loop do n = gets.chomp.to_i if n == 0 break end s = gets.split i = 0 s.each do |j| i += j.to_i end m = i / n k = 0 s.each do |l| k += (l.to_i - m) ** 2 end a = k / n puts "#{sprintf("%.9f", Math.sqrt(a))}" end
loop do n = gets.chomp.to_i if n == 0 break end s = gets.split i = 0 s.each do |j| i += j.to_f end m = i / n k = 0 s.each do |l| k += (l.to_i - m) ** 2 end a = k / n puts "#{sprintf("%.9f", Math.sqrt(a))}" end
[["-", 196, 737, 8, 736, 0, 755, 12, 652, 735, 22], ["+", 196, 737, 8, 736, 0, 755, 12, 652, 735, 22]]
4
87
while (n = gets.to_i) != 0 s = gets.split.map(&:to_i) m = s.reduce(:+) / n puts Math.sqrt(s.map{|x| (x - m) ** 2}.reduce(:+) / n) end
while (n = gets.to_i) != 0 s = gets.split.map(&:to_f) m = s.reduce(:+) / n puts Math.sqrt(s.map{|x| (x - m) ** 2}.reduce(:+) / n) end
[["-", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753]]
4
60
until (n = gets.chomp.to_i) == 0 arr = gets.split.map(&:to_i) sum = 0 n.times do |i| sum = sum + arr[i] end ave = sum / n alpha = 0 n.times do |i| alpha = alpha + ((arr[i] - ave)**2) end puts (alpha / n) ** 0.5 end
until (n = gets.chomp.to_i) == 0 arr = gets.split.map(&:to_i) sum = 0 n.times do |i| sum = sum + arr[i] end ave = sum.to_f / n alpha = 0 n.times do |i| alpha = alpha + ((arr[i] - ave)**2) end puts (alpha / n) ** 0.5 end
[["+", 8, 170, 0, 662, 12, 738, 31, 652, 17, 131], ["+", 8, 170, 0, 662, 12, 738, 31, 652, 735, 22]]
4
83
while n = gets.to_i break if n.zero? students = gets.split.map(&:to_i) average = students.inject(&:+) / n dispersion = students.inject(0) { |sum, num| sum + (num - average)**2 } / n puts Math.sqrt(dispersion) end
while n = gets.to_i break if n.zero? students = gets.split.map(&:to_i) average = students.inject(&:+) / n.to_f dispersion = students.inject(0) { |sum, num| sum + (num - average)**2 } / n puts Math.sqrt(dispersion) end
[["+", 8, 170, 0, 662, 12, 738, 12, 652, 17, 131], ["+", 8, 170, 0, 662, 12, 738, 12, 652, 735, 22]]
4
67
while gets != "0\n" ss = gets.split.map(&:to_i) ave = ss.inject(:+) / ss.size puts Math.sqrt(ss.map{|s|(s-ave)**2}.inject(:+)/ss.size) end
while gets != "0\n" ss = gets.split.map(&:to_f) ave = ss.inject(:+) / ss.size puts Math.sqrt(ss.map{|s|(s-ave)**2}.inject(:+)/ss.size) end
[["-", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753]]
4
61
until ((n = gets.chomp.to_i) == 0) numbers = gets.chomp.split.map(&:to_f) squares = numbers.map{|n| n ** 2} sum = numbers.inject(:+) / n ss = squares.inject(:+) sd = Math.sqrt(ss / n - mean ** 2) printf("%.5f\n", sd) end
until ((n = gets.chomp.to_i) == 0) numbers = gets.chomp.split.map(&:to_f) squares = numbers.map{|n| n ** 2} mean = numbers.inject(:+) / n ss = squares.inject(:+) sd = Math.sqrt(ss / n - mean ** 2) printf("%.5f\n", sd) end
[["-", 0, 493, 0, 750, 8, 170, 0, 662, 31, 22], ["+", 0, 493, 0, 750, 8, 170, 0, 662, 31, 22]]
4
82
until ((n = gets.chomp.to_i) == 0) numbers = gets.chomp.split.map(&:to_i) mean = numbers.inject(:+) / n.to_f squares = numbers.map{|n| n ** 2} ss = squares.inject(:+) sd = Math.sqrt(ss / n - mean ** 2) printf("%.5f\n", sd) end
until ((n = gets.chomp.to_i) == 0) numbers = gets.chomp.split.map(&:to_i) mean = numbers.inject(:+) / n.to_f squares = numbers.map{|n| n ** 2} ss = squares.inject(:+) sd = Math.sqrt(ss / n.to_f - mean ** 2) printf("%.5f\n", sd) end
[["+", 3, 4, 0, 738, 31, 738, 12, 652, 17, 131], ["+", 3, 4, 0, 738, 31, 738, 12, 652, 735, 22]]
4
84
while n = gets.chomp.to_i if n==0 break end s = gets.chomp.split(" ").map{|item| item.to_i} ave=0 n.times{ |idx| ave += s[idx] } ave/=n a=0 n.times{ |idx| a+=(s[idx]-ave)**2 } a/=n a=Math::sqrt(a) puts a end
while n = gets.chomp.to_i if n==0 break end s = gets.chomp.split(" ").map{|item| item.to_i} ave=0.0 n.times{ |idx| ave += s[idx] } ave/=n a=0.0 n.times{ |idx| a+=(s[idx]-ave)**2 } a/=n a=Math::sqrt(a) puts a end
[["-", 0, 493, 0, 89, 8, 170, 0, 662, 12, 612], ["+", 0, 493, 0, 89, 8, 170, 0, 662, 12, 531]]
4
93
while true do count = gets.to_i; if count == 0 then break; end sum = 0.to_f; average = 0.to_f; aryStudentPoint = gets.split(' ').map(&:to_f); for sumIndex in 0..aryStudentPoint.length - 1 do sum = sum + aryStudentPoint[sumIndex]; end average = sum / average; sum = 0.to_f; for index...
while true do count = gets.to_i; if count == 0 then break; end sum = 0.to_f; average = 0.to_f; aryStudentPoint = gets.split(' ').map(&:to_f); for sumIndex in 0..aryStudentPoint.length - 1 do sum = sum + aryStudentPoint[sumIndex]; end average = sum / count; sum = 0.to_f; for index in 0....
[["-", 0, 89, 8, 170, 0, 662, 12, 738, 12, 22], ["+", 0, 89, 8, 170, 0, 662, 12, 738, 12, 22]]
4
126
while (times = gets.to_i) != 0 date = gets.split(" ").map(&:to_i) ave = date.inject(:+) / times sum = 0 for i in 0...times sum += (date[i]-ave)**2 end s = Math.sqrt(sum/times) puts s end
while (times = gets.to_f) != 0 date = gets.split(" ").map(&:to_f) ave = date.inject(:+) / times sum = 0 for i in 0...times sum += (date[i]-ave)**2 end s = Math.sqrt(sum/times) puts s end
[["-", 15, 738, 31, 739, 0, 662, 12, 652, 735, 22], ["+", 15, 738, 31, 739, 0, 662, 12, 652, 735, 22], ["-", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753]]
4
71
while n = gets.to_i do break if n == 0 s = gets.split(" ").map(&:to_i) m = s.inject(:+)/n s2 = 0 s.each{|si| s2 += (si - m)**2 } printf "%f\n", Math.sqrt(s2 / n) end
while n = gets.to_i do break if n == 0 s = gets.split(" ").map(&:to_i) m = s.inject(:+)/n.to_f s2 = 0 s.each{|si| s2 += (si - m)**2 } printf "%f\n", Math.sqrt(s2 / n) end
[["+", 8, 170, 0, 662, 12, 738, 12, 652, 17, 131], ["+", 8, 170, 0, 662, 12, 738, 12, 652, 735, 22]]
4
73
#!/usr/bin/env ruby until (n = gets.to_i).zero? s = gets.chomp.split.map(&:to_i) ave = s.inject(:+) / n puts Math.sqrt(s.map { |i| (i - ave)**2 }.inject(:+) / n) end
#!/usr/bin/env ruby until (n = gets.to_i).zero? s = gets.chomp.split.map(&:to_f) ave = s.inject(:+) / n puts Math.sqrt(s.map { |i| (i - ave)**2 }.inject(:+) / n) end
[["-", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753]]
4
63
include Math def f(a, b, c) return (0.5 * a * b * sin(g(c))), (a ** 2 + b ** 2 - 2 * a * b * cos(g(c))) ** 0.5 * a + b, b * sin(g(c)) end def g(c) return c * PI / 180 end puts f(*gets.split(" ").map(&:to_i))
include Math def f(a, b, c) return (0.5 * a * b * sin(g(c))), (a ** 2 + b ** 2 - 2 * a * b * cos(g(c))) ** 0.5 + a + b, b * sin(g(c)) end def g(c) return c * PI / 180 end puts f(*gets.split(" ").map(&:to_i)) #f(*gets.split(" ").map(&:to_i)).each{|i|puts sprintf("%.4f", i)}
[["-", 0, 38, 0, 4, 0, 738, 31, 738, 17, 48], ["+", 0, 38, 0, 4, 0, 738, 31, 738, 17, 72]]
4
99
a, b, c = gets.split.map(&:to_f) s = 0.5 * (a * b) * (Math.sin(c * (Math::PI / 180))) l = a + b + Math.sqrt(a**2 + b**2 + (2 * a * b * Math.cos(c * (Math::PI / 180)))) h = b * Math.sin(c * (Math::PI / 180.0)) puts s puts l puts h
a, b, c = gets.split.map(&:to_f) s = 0.5 * (a * b) * (Math.sin(c * (Math::PI / 180))) l = a + b + Math.sqrt(a**2 + b**2 - (2 * a * b * Math.cos(c * (Math::PI / 180)))) h = b * Math.sin(c * (Math::PI / 180)) puts s puts l puts h
[["-", 12, 738, 12, 652, 3, 4, 0, 738, 17, 72], ["+", 12, 738, 12, 652, 3, 4, 0, 738, 17, 33], ["-", 3, 4, 0, 738, 12, 739, 0, 738, 12, 531], ["+", 3, 4, 0, 738, 12, 739, 0, 738, 12, 612]]
4
106
a,b,c=gets.split.map(&:to_f) h=b*Math.sin(Math::PI*c/180) puts a*h*1/2 puts a+b+(h**2+(a-b*Math.cos(Math::PI*c/180))**2)**(1/2.0)
a,b,c=gets.split.map(&:to_f) h=b*Math.sin(Math::PI*c/180) puts a*h*1/2 puts a+b+(h**2+(a-b*Math.cos(Math::PI*c/180))**2)**(1/2.0) puts h
[["+", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["+", 36, 36, 0, 493, 0, 652, 3, 4, 0, 22]]
4
76
a, b, c = gets.split.map(&:to_f) h = sin(c *= PI / 180) * b puts a / 2 * h puts a + b + sqrt(a * a + b * b - 2 * a * b * cos(c)) puts h
include Math a, b, c = gets.split.map(&:to_f) h = sin(c *= PI / 180) * b puts a / 2 * h puts a + b + sqrt(a * a + b * b - 2 * a * b * cos(c)) puts h
[["+", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["+", 36, 36, 0, 493, 0, 652, 3, 4, 0, 743]]
4
61
a, b, theta = gets.chomp.split.map(&:to_f) rad = theta / 180 * Math::PI h = b * Math.sin(rad) S = a * h / 2 c = Math.sqrt(a ** 2 + b **2 - a * b * Math.cos(rad)) L = a + b + c printf("%.5f\n", S) printf("%.5f\n", L) printf("%.5f\n", h)
a, b, theta = gets.chomp.split.map(&:to_f) rad = theta / 180 * Math::PI h = b * Math.sin(rad) S = a * h / 2 c = Math.sqrt(a ** 2 + b **2 - 2 * a * b * Math.cos(rad)) L = a + b + c printf("%.5f\n", S) printf("%.5f\n", L) printf("%.5f\n", h)
[["+", 0, 738, 12, 738, 31, 738, 31, 738, 31, 612], ["+", 0, 738, 12, 738, 31, 738, 31, 738, 17, 48]]
4
102
a,b,c = gets.split.map(&:to_f) puts 1.0/2.0 * a * b*Math::sin(c/80*Math::PI) puts a + b +Math::sqrt(a**2+b**2 - 2.0*a*b*Math::cos(c*180*Math::PI)) puts b * Math::sin(c/180*Math::PI)
a,b,c = gets.split.map(&:to_f) puts 1.0/2.0 * a * b*Math::sin(c/180*Math::PI) puts a + b +Math::sqrt(a**2+b**2 - 2.0*a*b*Math::cos(c/180*Math::PI)) puts b * Math::sin(c/180*Math::PI)
[["-", 12, 652, 3, 4, 0, 738, 31, 738, 12, 612], ["+", 12, 652, 3, 4, 0, 738, 31, 738, 12, 612], ["-", 12, 652, 3, 4, 0, 738, 31, 738, 17, 48], ["+", 12, 652, 3, 4, 0, 738, 31, 738, 17, 85]]
4
87
#!/usr/bin/env ruby a, b, c = gets.chomp.split.map(&:to_f) c_rad = c * Math::PI / 180 l = Math.sqrt(a**2 + b**2 - a * b * Math.cos(c_rad)) + a + b h = b * Math.sin(c_rad) s = a * h / 2 puts s, l, h
#!/usr/bin/env ruby a, b, c = gets.chomp.split.map(&:to_f) c_rad = c * Math::PI / 180 l = Math.sqrt(a**2 + b**2 - 2 * a * b * Math.cos(c_rad)) + a + b h = b * Math.sin(c_rad) s = a * h / 2 puts s, l, h
[["+", 0, 738, 12, 738, 31, 738, 31, 738, 31, 612], ["+", 0, 738, 12, 738, 31, 738, 31, 738, 17, 48]]
4
79
a, b, c_theta = gets.split.map(&:to_i) # surface s = a * b * Math.sin(c_theta / 180.0 * Math::PI) / 2.0 puts s # length in the circle c = (a ** 2 + b ** 2 - 2 * a * b * Math.cos(c_theta / 180.0 * Math::PI)) ** (1/2.0) puts a + b + c # height h h = b / Math.sin(c_theta / 180.0 * Math::PI) puts h
a, b, c_theta = gets.split.map(&:to_i) # surface s = a * b * Math.sin(c_theta / 180.0 * Math::PI) / 2.0 puts s # length in the circle c = (a ** 2 + b ** 2 - 2 * a * b * Math.cos(c_theta / 180.0 * Math::PI)) ** (1/2.0) puts a + b + c # height h h = b * Math.sin(c_theta / 180.0 * Math::PI) puts h
[["-", 36, 36, 0, 493, 0, 662, 12, 738, 17, 85], ["+", 36, 36, 0, 493, 0, 662, 12, 738, 17, 48]]
4
100
import math lst=input().split() lst=list(map(lambda i:int(i),lst)) a,b,C=lst[0],lst[1],lst[2] S=(1/2)*a*b*math.sin(math.radians(C)) h=(2/a)*S c=(a**2+b**2-2*a*b*math.cos(math.radians(C)))**(1/2) L=a+b+c print(S) print(h) print(L)
import math lst=input().split() lst=list(map(lambda i:int(i),lst)) a,b,C=lst[0],lst[1],lst[2] S=(1/2)*a*b*math.sin(math.radians(C)) h=(2/a)*S c=(a**2+b**2-2*a*b*math.cos(math.radians(C)))**(1/2) L=a+b+c print(S) print(L) print(h)
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
134
from math import sin, cos, pi, sqrt a, b, c = map(int, input().split()) s = a*b*sin(pi*c/180)/2 c = sqrt(a**2 + b**2 -a*b*2*cos(pi*c/180)) h = 2*S/a print(s) print(a+b+c) print(h)
from math import sin, cos, pi, sqrt a, b, c = map(int, input().split()) s = a*b*sin(pi*c/180)/2 c = sqrt(a**2 + b**2 -a*b*2*cos(pi*c/180)) h = 2*s/a print(s) print(a+b+c) print(h)
[["-", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22]]
5
94
import math a,b,deg = map(float,input().split(" ")) sindeg = math.sin(math.radians(deg)) S = (a*b*sindeg)//2 cosdeg = math.cos(math.radians(deg)) z = a*a + b*b - 2*a*b*cosdeg L = a + b + math.sqrt(z) h = b*sindeg print("{:.5f}".format(S)) print("{:.5f}".format(L)) print("{:.5f}".format(h))
import math a,b,deg = map(float,input().split(" ")) sindeg = math.sin(math.radians(deg)) S = (a*b*sindeg)/2 cosdeg = math.cos(math.radians(deg)) z = a*a + b*b - 2*a*b*cosdeg L = a + b + math.sqrt(z) h = b*sindeg print("{:.5f}".format(S)) print("{:.5f}".format(L)) print("{:.5f}".format(h))
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85]]
5
127
import math class Triangle(object): def __init__(self, a, b, C): self.a = a self.b = b self.C = math.radians(C) def getArea(self): return((self.a * self.getHeight()) / 2) def getPerimeter(self): return(self.a + self.b + math.sqrt(self.a ** 2 + self.b ** 2 + 2 * ...
import math class Triangle(object): def __init__(self, a, b, C): self.a = a self.b = b self.C = math.radians(C) def getArea(self): return((self.a * self.getHeight()) / 2) def getPerimeter(self): return(self.a + self.b + math.sqrt(self.a ** 2 + self.b ** 2 - 2 * ...
[["-", 0, 657, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 657, 12, 652, 3, 4, 0, 657, 17, 33]]
5
181
a,b,C=list(map(float,input().split())) rad=math.radians(C) c=(a**2+b**2-2*a*b*math.cos(rad))**0.5 h=b*math.sin(rad) print(h*a/2) print(a+b+c) print(h)
import math a,b,C=list(map(float,input().split())) rad=math.radians(C) c=(a**2+b**2-2*a*b*math.cos(rad))**0.5 h=b*math.sin(rad) print(h*a/2) print(a+b+c) print(h)
[["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]]
5
85
import math (a, b, C) = [float(i) for i in input().split()] cs = math.radians(C) c = math.sqrt(a ** 2 + b ** 2 - 2 * a * b * math.cos(cs)) h = b * math.sin(c) S = a * h / 2 L = a + b + c [print(format(i, '6f')) for i in [-S, L, -h]]
import math (a, b, C) = [int(i) for i in input().split()] cs = math.radians(C) c = math.sqrt(a ** 2 + b ** 2 - 2 * a * b * math.cos(cs)) h = b * math.sin(cs) S = a * h / 2 L = a + b + c [print(format(i, '6f')) for i in [S, L, h]]
[["-", 0, 1, 0, 662, 12, 658, 8, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 658, 8, 652, 63, 22], ["-", 0, 662, 12, 657, 12, 652, 3, 4, 0, 22], ["+", 0, 662, 12, 657, 12, 652, 3, 4, 0, 22], ["-", 0, 658, 0, 659, 12, 634, 0, 664, 17, 33]]
5
110
#coding:utf-8 #1_10_B 2015.4.14 import math a,b,C = map(int,input().split()) C = math.radian(C) h = b * math.sin(C) S = a * h / 2 L = a + b + math.sqrt(a ** 2 + b ** 2 - 2 * a * b * math.cos(C)) print('{:.10f}\n{:.10f}\n{:.10f}'.format(S,L,h))
#coding:utf-8 #1_10_B 2015.4.14 import math a,b,C = map(int,input().split()) C = math.radians(C) h = b * math.sin(C) S = a * h / 2 L = a + b + math.sqrt(a ** 2 + b ** 2 - 2 * a * b * math.cos(C)) print('{:.10f}\n{:.10f}\n{:.10f}'.format(S,L,h))
[["-", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22]]
5
97