Submission #20534967


Source Code Expand

Copy
import std.conv, std.functional, std.range, std.stdio, std.string;
import std.algorithm, std.array, std.bigint, std.bitmanip, std.complex, std.container, std.math, std.mathspecial, std.numeric, std.regex, std.typecons;
import core.bitop;

class EOFException : Throwable { this() { super("EOF"); } }
string[] tokens;
string readToken() { for (; tokens.empty; ) { if (stdin.eof) { throw new EOFException; } tokens = readln.split; } auto token = tokens.front; tokens.popFront; return token; }
int readInt() { return readToken.to!int; }
long readLong() { return readToken.to!long; }
real readReal() { return readToken.to!real; }

bool chmin(T)(ref T t, in T f) { if (t > f) { t = f; return true; } else { return false; } }
bool chmax(T)(ref T t, in T f) { if (t < f) { t = f; return true; } else { return false; } }

int binarySearch(alias pred, T)(in T[] as) { int lo = -1, hi = cast(int)(as.length); for (; lo + 1 < hi; ) { const mid = (lo + hi) >> 1; (unaryFun!pred(as[mid]) ? hi : lo) = mid; } return hi; }
int lowerBound(T)(in T[] as, T val) { return as.binarySearch!(a => (a >= val)); }
int upperBound(T)(in T[] as, T val) { return as.binarySearch!(a => (a > val)); }




void main() {
  try {
    for (; ; ) {
      const A = readReal();
      const B = readReal();
      const ans = (A - B) / A * 100.0L;
      writefln("%.12f", ans);
    }
  } catch (EOFException e) {
  }
}

Submission Info

Submission Time
Task A - Discount
User hos_lyric
Language D (LDC 1.20.1)
Score 100
Code Size 1412 Byte
Status AC
Exec Time 6 ms
Memory 3484 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 13
Set Name Test Cases
Sample 01_sample.txt, 02_sample.txt, 03_sample.txt
All 01_sample.txt, 02_sample.txt, 03_sample.txt, 04_hand.txt, 05_hand.txt, 06_hand.txt, 07_random.txt, 08_random.txt, 09_random.txt, 10_random.txt, 11_random.txt, 12_random.txt, 13_random.txt
Case Name Status Exec Time Memory
01_sample.txt AC 6 ms 3368 KB
02_sample.txt AC 4 ms 3256 KB
03_sample.txt AC 3 ms 3440 KB
04_hand.txt AC 4 ms 3376 KB
05_hand.txt AC 4 ms 3368 KB
06_hand.txt AC 3 ms 3376 KB
07_random.txt AC 4 ms 3360 KB
08_random.txt AC 4 ms 3484 KB
09_random.txt AC 3 ms 3440 KB
10_random.txt AC 3 ms 3368 KB
11_random.txt AC 4 ms 3408 KB
12_random.txt AC 5 ms 3376 KB
13_random.txt AC 5 ms 3376 KB