Submission #929475


Source Code Expand

<?php
/*
    http://arc062.contest.atcoder.jp/tasks/arc062_a

    Score  :
    Result :
    Time   : ms
    Memory : KB
 */

// define('DEBUG', true);
define('DEBUG', false);

// test
$N = 10;
$a = array(3, 9, 7, 1, 10, 8, 5, 2, 4, 6);
$TT = 0;
$AA = 0;

fscanf(STDIN, "%d", $N);
for ($i = 0; $i < $N; $i++) {
	fscanf(STDIN, "%d %d", $T, $A);
	if ($i == 0) {
		$TT = $T;
		$AA = $A;
	} else {
		$TT = 0;
		$AA = 0;
		while ($TT < $prevTT || $AA < $prevAA) {
			$TT += $T;
			$AA += $A;
		}
	}
	$prevTT = $TT;
	$prevAA = $AA;
	// echo "{$TT} {$AA}\n";
}

echo ($TT + $AA) . PHP_EOL;

Submission Info

Submission Time
Task C - AtCoDeer and Election Report
User takepan
Language PHP (5.6.30)
Score 0
Code Size 621 Byte
Status TLE
Exec Time 2103 ms
Memory 3704 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 3
AC × 6
TLE × 9
Set Name Test Cases
Sample 0_000.txt, 0_001.txt, 0_002.txt
All 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt
Case Name Status Exec Time Memory
0_000.txt AC 17 ms 3704 KB
0_001.txt AC 15 ms 3452 KB
0_002.txt AC 16 ms 3452 KB
1_003.txt AC 16 ms 3452 KB
1_004.txt AC 16 ms 3452 KB
1_005.txt TLE 2103 ms 3452 KB
1_006.txt TLE 2103 ms 3452 KB
1_007.txt TLE 2103 ms 3452 KB
1_008.txt TLE 2103 ms 3452 KB
1_009.txt TLE 2102 ms 3452 KB
1_010.txt TLE 2102 ms 3452 KB
1_011.txt TLE 2102 ms 3452 KB
1_012.txt TLE 2103 ms 3452 KB
1_013.txt TLE 2102 ms 3452 KB
1_014.txt AC 45 ms 3452 KB