Task: | Number |
Sender: | Feeniksi |
Submission time: | 2016-10-04 17:01:53 +0300 |
Language: | Java |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.68 s | details |
#2 | WRONG ANSWER | 0.15 s | details |
#3 | ACCEPTED | 0.12 s | details |
#4 | WRONG ANSWER | 0.11 s | details |
#5 | ACCEPTED | 0.11 s | details |
#6 | ACCEPTED | 0.20 s | details |
#7 | WRONG ANSWER | 0.14 s | details |
#8 | ACCEPTED | 0.12 s | details |
#9 | WRONG ANSWER | 0.12 s | details |
#10 | ACCEPTED | 0.12 s | details |
#11 | ACCEPTED | 0.23 s | details |
#12 | WRONG ANSWER | 0.14 s | details |
#13 | ACCEPTED | 0.10 s | details |
#14 | WRONG ANSWER | 0.17 s | details |
#15 | ACCEPTED | 0.12 s | details |
#16 | ACCEPTED | 0.23 s | details |
#17 | WRONG ANSWER | 0.12 s | details |
#18 | ACCEPTED | 0.16 s | details |
#19 | WRONG ANSWER | 0.15 s | details |
#20 | ACCEPTED | 0.13 s | details |
#21 | ACCEPTED | 0.40 s | details |
#22 | WRONG ANSWER | 0.15 s | details |
#23 | ACCEPTED | 0.13 s | details |
#24 | WRONG ANSWER | 0.12 s | details |
#25 | ACCEPTED | 0.11 s | details |
#26 | ACCEPTED | 0.52 s | details |
#27 | WRONG ANSWER | 0.12 s | details |
#28 | ACCEPTED | 0.13 s | details |
#29 | WRONG ANSWER | 0.11 s | details |
#30 | ACCEPTED | 0.11 s | details |
Code
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author viljampa */ public class kilpa51 { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here IO io = new IO(); long x = io.nextLong(); long a = io.nextLong(); long b = io.nextLong(); // long x = 3; // long a = 5; // long b = 3; // long x = 5; // long a = 10; //// long b = 1; // long x = 1000000000; // long a = 10; // long b = 1000000; int summa = 0; while (x != 0) { if (x % 2 != 0) { if (a < ((x+1) / 2) * b) { x /= 2; summa += a; } else { x--; summa += b; } } else if (a < (x / 2) * b) { x /= 2; summa += a; } else { x--; summa += b; } } io.println(summa); // String a = io.next(); // Lukee seuraavan välein erotellun merkkijonon. // int b = io.nextInt(); // Lukee seuraavan välein erotellun int-kokonaisluvun. // long c = io.nextLong(); // Lukee seuraavan välein erotellun long-kokonaisluvun. // double d = io.nextDouble(); // Lukee seuraavan välein erotellun double-liukuluvun. // Toimii kuten System.out.println. // io.println("Annoit syötteenä " + a + " " + b + " " + c + " " + d); io.close(); // TÄYTYY KUTSUA LOPUKSI, muuten tuloste voi jäädä kirjoittamatta } }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
804289384 846930887 8 |
correct output |
---|
3302440542 |
user output |
---|
-992526754 |
Test 2
Verdict: WRONG ANSWER
input |
---|
714636916 957747794 424238336 |
correct output |
---|
27665414904 |
user output |
---|
1895611128 |
Test 3
Verdict: ACCEPTED
input |
---|
719885387 3 10 |
correct output |
---|
90 |
user output |
---|
90 |
Test 4
Verdict: WRONG ANSWER
input |
---|
189641422 189641422 189641422 |
correct output |
---|
5309959816 |
user output |
---|
1014992520 |
Test 5
Verdict: ACCEPTED
input |
---|
25202363 8 783368691 |
correct output |
---|
200 |
user output |
---|
200 |
Test 6
Verdict: ACCEPTED
input |
---|
102520060 44897764 7 |
correct output |
---|
224398341 |
user output |
---|
224398341 |
Test 7
Verdict: WRONG ANSWER
input |
---|
365180541 540383427 304089173 |
correct output |
---|
15198530875 |
user output |
---|
-1981338309 |
Test 8
Verdict: ACCEPTED
input |
---|
303455737 2 9 |
correct output |
---|
58 |
user output |
---|
58 |
Test 9
Verdict: WRONG ANSWER
input |
---|
294702568 294702568 294702568 |
correct output |
---|
8546374472 |
user output |
---|
-43560120 |
Test 10
Verdict: ACCEPTED
input |
---|
726956430 3 861021531 |
correct output |
---|
90 |
user output |
---|
90 |
Test 11
Verdict: ACCEPTED
input |
---|
278722863 233665124 8 |
correct output |
---|
979718228 |
user output |
---|
979718228 |
Test 12
Verdict: WRONG ANSWER
input |
---|
468703136 101513930 801979803 |
correct output |
---|
2943903970 |
user output |
---|
-1351063326 |
Test 13
Verdict: ACCEPTED
input |
---|
315634023 9 10 |
correct output |
---|
261 |
user output |
---|
261 |
Test 14
Verdict: WRONG ANSWER
input |
---|
125898168 125898168 125898168 |
correct output |
---|
3399250536 |
user output |
---|
-895716760 |
Test 15
Verdict: ACCEPTED
input |
---|
59961394 7 628175012 |
correct output |
---|
182 |
user output |
---|
182 |
Test 16
Verdict: ACCEPTED
input |
---|
656478043 131176230 4 |
correct output |
---|
688824428 |
user output |
---|
688824428 |
Test 17
Verdict: WRONG ANSWER
input |
---|
859484422 914544920 608413785 |
correct output |
---|
27130216465 |
user output |
---|
1360412689 |
Test 18
Verdict: ACCEPTED
input |
---|
756898538 9 5 |
correct output |
---|
262 |
user output |
---|
262 |
Test 19
Verdict: WRONG ANSWER
input |
---|
149798316 149798316 149798316 |
correct output |
---|
4194352848 |
user output |
---|
-100614448 |
Test 20
Verdict: ACCEPTED
input |
---|
38664371 4 184803527 |
correct output |
---|
104 |
user output |
---|
104 |
Test 21
Verdict: ACCEPTED
input |
---|
412776092 424268981 7 |
correct output |
---|
1570896123 |
user output |
---|
1570896123 |
Test 22
Verdict: WRONG ANSWER
input |
---|
749241874 137806863 42999171 |
correct output |
---|
3935781156 |
user output |
---|
-359186140 |
Test 23
Verdict: ACCEPTED
input |
---|
982906997 2 6 |
correct output |
---|
60 |
user output |
---|
60 |
Test 24
Verdict: WRONG ANSWER
input |
---|
84420926 84420926 84420926 |
correct output |
---|
2279365002 |
user output |
---|
-2015602294 |
Test 25
Verdict: ACCEPTED
input |
---|
937477085 8 572660337 |
correct output |
---|
240 |
user output |
---|
240 |
Test 26
Verdict: ACCEPTED
input |
---|
159126506 805750847 10 |
correct output |
---|
1591265060 |
user output |
---|
1591265060 |
Test 27
Verdict: WRONG ANSWER
input |
---|
100661314 433925858 141616125 |
correct output |
---|
11122301217 |
user output |
---|
-1762600671 |
Test 28
Verdict: ACCEPTED
input |
---|
84353896 3 6 |
correct output |
---|
81 |
user output |
---|
81 |
Test 29
Verdict: WRONG ANSWER
input |
---|
998898815 998898815 998898815 |
correct output |
---|
29966964450 |
user output |
---|
-97806622 |
Test 30
Verdict: ACCEPTED
input |
---|
548233368 5 585990365 |
correct output |
---|
150 |
user output |
---|
150 |