Submission #2117046


Source Code Expand

n,i;double r,s,a;main(m){
	for(scanf("%lf%d%d",&r,&n,&m);i++<n+m;)s+=2*sqrt(r*r-(a=fmin(i<n?fabs(r-2*r*i/n):1e9,i>m?fabs(r-2*r*(i-m)/n):1e9))*a);
	printf("%f",s);
}

Submission Info

Submission Time
Task B - ステップカット
User kotatsugame
Language C (GCC 5.4.1)
Score 200
Code Size 167 Byte
Status AC
Exec Time 2 ms
Memory 128 KB

Compile Error

./Main.c:1:1: warning: data definition has no type or storage class
 n,i;double r,s,a;main(m){
 ^
./Main.c:1:1: warning: type defaults to ‘int’ in declaration of ‘n’ [-Wimplicit-int]
./Main.c:1:3: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int]
 n,i;double r,s,a;main(m){
   ^
./Main.c:1:18: warning: return type defaults to ‘int’ [-Wimplicit-int]
 n,i;double r,s,a;main(m){
                  ^
./Main.c: In function ‘main’:
./Main.c:1:18: warning: type of ‘m’ defaults to ‘int’ [-Wimplicit-int]
./Main.c:2:6: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
  for(scanf("%lf%d%d",&r,&n,&m);i++<n+m;)s+=2*sqrt(r*r-(a=fmin(i<n?fabs(r-2*r*i/n):1e9,i>m?fabs(r-2*r*(i-m)/n):1e9))*a);
      ^
./Main.c:2:6: warning: incompatible implicit declaration of built-in function ‘scanf’
./Main.c:2:6: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
./Main.c:2:46: warning: implicit declaration of function ‘sqrt’ [-Wimplicit-function-declaration]
  for(scanf("%...

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 16
Set Name Test Cases
Sample 00_example_01.txt, 00_example_02.txt, 00_example_03.txt
All 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 10_rand_01.txt, 10_rand_02.txt, 10_rand_03.txt, 10_rand_04.txt, 10_rand_05.txt, 10_rand_06.txt, 10_rand_07.txt, 10_rand_08.txt, 20_hand_01.txt, 20_hand_02.txt, 20_hand_03.txt, 20_hand_04.txt, 20_hand_05.txt
Case Name Status Exec Time Memory
00_example_01.txt AC 1 ms 128 KB
00_example_02.txt AC 1 ms 128 KB
00_example_03.txt AC 2 ms 128 KB
10_rand_01.txt AC 1 ms 128 KB
10_rand_02.txt AC 1 ms 128 KB
10_rand_03.txt AC 1 ms 128 KB
10_rand_04.txt AC 1 ms 128 KB
10_rand_05.txt AC 1 ms 128 KB
10_rand_06.txt AC 1 ms 128 KB
10_rand_07.txt AC 1 ms 128 KB
10_rand_08.txt AC 1 ms 128 KB
20_hand_01.txt AC 2 ms 128 KB
20_hand_02.txt AC 2 ms 128 KB
20_hand_03.txt AC 2 ms 128 KB
20_hand_04.txt AC 1 ms 128 KB
20_hand_05.txt AC 1 ms 128 KB