Submission #983676


Source Code Expand

import std.stdio;
import std.string;
import std.algorithm;
import std.array;
import std.regex;
import std.random;
import std.range;
import std.conv;
import std.math;

int a, b, c;

real f(real t)
{
  return a * t + b * sin(c * PI * t) - 100;
}

real g(real t)
{
  return a + b * c * PI * cos(c * PI * t);
}

void main()
{
  auto arg = readln.chomp.split.map!(to!int);
  a = arg[0];
  b = arg[1];
  c = arg[2];
  real t = cast(real)100 / a;
  for (int i = 0; i < 1000000; ++i) {
    t = t - f(t) / g(t);
  }
  writefln("%.10f\n", t);
}

Submission Info

Submission Time
Task D - 高橋君ボール1号
User arukuka
Language D (DMD 2.066.1)
Score 100
Code Size 569 Byte
Status AC
Exec Time 112 ms
Memory 928 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 17
Set Name Test Cases
Sample example_0.txt, example_1.txt
All example_0.txt, example_1.txt, random_0.txt, random_1.txt, random_2.txt, random_3.txt, random_4.txt, random_5.txt, random_6.txt, random_7.txt, random_8.txt, random_9.txt, special_0.txt, special_1.txt, special_2.txt, example_0.txt, example_1.txt
Case Name Status Exec Time Memory
example_0.txt AC 99 ms 796 KB
example_1.txt AC 99 ms 920 KB
random_0.txt AC 99 ms 920 KB
random_1.txt AC 100 ms 928 KB
random_2.txt AC 100 ms 800 KB
random_3.txt AC 107 ms 800 KB
random_4.txt AC 99 ms 928 KB
random_5.txt AC 112 ms 924 KB
random_6.txt AC 110 ms 920 KB
random_7.txt AC 98 ms 800 KB
random_8.txt AC 100 ms 736 KB
random_9.txt AC 99 ms 796 KB
special_0.txt AC 97 ms 928 KB
special_1.txt AC 100 ms 924 KB
special_2.txt AC 94 ms 916 KB