| Show all threads Hide all threads Show all messages Hide all messages |
| TEST9 | lm | 1024. Permutations | 4 Oct 2014 14:50 | 1 |
TEST9 lm 4 Oct 2014 14:50 I always WA at TEST9,who can give me a test like test9 ? other test in discuss were all used.It's right. |
| Format of output | Aleksandar Bukva | 1319. Hotel | 4 Oct 2014 06:03 | 1 |
What is the format of output, blank spaces before number? |
| if you hava wa8! | Ching Tyan | 1489. Points on a Parallelepiped | 3 Oct 2014 19:21 | 5 |
I have wa8 when I used float numbers, when I changed it to double I get ac. Never use float at ACM contests :) Re: if you hava wa8! UXMRI: Sergey Baskakov, Raphail Akhmedisheff and Denis Nikonorov 26 Jun 2009 17:02 just forget this wrong word 'float' :) right words are 'extended' 'double' :) Great thanks to you! :) Really helpful! thank you very very much!!! |
| Почему не принимает решение, хотя в eclipce всё правильно работает | Danila | 1000. A+B Problem | 3 Oct 2014 11:20 | 2 |
import java.util.Scanner; public class Summa { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner scan=new Scanner( System.in); System.out.println("Введите значение a"); int a; a=scan.nextInt(); System.out.println("Введите значение b"); int b; b=scan.nextInt(); System.out.println(" a + b = " + (a + b)); } } You program outputs: Введите значение a Введите значение b a + b = 6 istead of just 6 Edited by author 03.10.2014 11:20 |
| WA2 please give some tests | Mixer.Lviv.Ua | 1106. Two Teams | 2 Oct 2014 21:52 | 1 |
|
| Wrong Answe test 4 java | shagi | 1313. Some Words about Sport | 2 Oct 2014 18:54 | 1 |
I don't understand what's wrong? In my IDEA all works! import java.io.IOException; import java.util.Scanner; public class summa { public static void main(String[] args) throws IOException { Scanner s = new Scanner(System.in); int n = s.nextInt(); int[] mas = new int[n*n]; if(n!= 0) { for (int i = 0; i < n * n; i++) { mas[i]=s.nextInt(); } if(mas.length>1) { qSort(mas, 0, mas.length-1); for (int i = 0; i < mas.length; i++) { System.out.print(mas[i] + " "); } }else System.out.println(mas[0]); }else System.out.println("0 элемнтов"); } public static void qSort(int[] A, int low, int high) { int i = low; int j = high; int x = A[(low+high)/2]; do { while(A[i] < x) ++i; while(A[j] > x) --j; if(i <= j){ int temp = A[i]; A[i] = A[j]; A[j] = temp; i ++ ; j --; } } while(i <= j);
if(low < j) qSort(A, low, j); if(i < high) qSort(A, i, high); } } Edited by author 02.10.2014 20:36 Edited by author 02.10.2014 20:36 |
| WA #10 (+) | Vedernikoff 'Goryinyich' Sergey (HSE: АОП) | 1460. Wires | 1 Oct 2014 01:31 | 1 |
WA #10 (+) Vedernikoff 'Goryinyich' Sergey (HSE: АОП) 1 Oct 2014 01:31 Any suggestions of the test? I rewrote solution from numerical to purely geometric, but still WA #10 and I can't find the reason. |
| What is Test#3 | sonamon | 1993. This cheeseburger you don't need | 1 Oct 2014 00:20 | 2 |
Can anyone provide with more tests? especially Test#3 ? (We) [are] {blind}, (we) [could not see] {creation of this clone army} |
| Hint | PrankMaN | 1353. Milliard Vasya's Function | 30 Sep 2014 22:12 | 3 |
Hint PrankMaN 30 Mar 2013 17:47 It's not the easiest problem and I don't know good solution, but if I was on the olympiad and would have to solve the problem, I would just precalculate the answer. a difficult combinatorics problem. x1 + x2 +... + x10 = S with limitation: xi between ? , ? Need to fill an array COUNT[1..9][0..81] and answer is COUNT[9][S] Exclusion: if S == 1, then answer is 10 Edited by author 30.09.2014 22:13 |
| [Pascal] | Pham Le Tuan Nam | 1083. Factorials!!! | 28 Sep 2014 09:02 | 1 |
[Pascal] Pham Le Tuan Nam 28 Sep 2014 09:02 Why "Time limit exceeded" ??? Edited by author 28.09.2014 09:03 |
| For C++ programmers | evggenshch | 1020. Rope | 27 Sep 2014 23:06 | 2 |
Use G++ 4.7.2. G++ 4.7.2 C11 works wrong. I don't know about 2013, but C11 works fine now. |
| Please help Time limit problem=1100 | (TUIT 420-14) Rakhmatov Izzat | | 26 Sep 2014 23:33 | 1 |
import java.util.Scanner; public class Acm { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt(); int[] a = new int[n]; int[] b = new int[n]; for(int j = 0; j < n; j++){ Scanner u = new Scanner(System.in); a[j] = s.nextInt(); b[j] = s.nextInt(); }
for(int p = 100; p >= 0; p--){ for(int q = 0; q < n; q++){ if(b[q] == p){ System.out.println(a[q] + " " + b[q]); } } } } } Edited by author 26.09.2014 23:34 |
| hint for some one that want to think more... | mhg | 1319. Hotel | 26 Sep 2014 21:48 | 1 |
hi,i know! there are some solution in this discussion that is a dangerous thing for someone that want to think more... so i say something about this problem for only hint.. for solving this problem this is better to check 2 or 3 example then consider a general case with n as input then try to simulate the answer and in the final step code it. be successful... |
| WA 8 | Lesha | 1248. Sequence Sum | 26 Sep 2014 12:15 | 1 |
WA 8 Lesha 26 Sep 2014 12:15 I tried everything before I realized that my program should accept numbers like 1.e+1 even if there is no digits after '.'. Weird! I hope this information would be helpful to someone. |
| how is output 383 and not 241 for sample cases | Mayank Punetha | 1119. Metro | 26 Sep 2014 00:05 | 3 |
first the person goes to (2,2) from (1,1) +141 then (3,2) +100 so why not 241? (0, 0) -> (1, 1) = sqrt(2) * 100 (1, 1) -> (2, 1) = 100 (2, 1) -> (3, 2) = sqrt(2) * 100 Total: 382.842712475 ~ 383 Edited by author 26.07.2014 17:17 Then shouldnt the problem wording be stated as rounding the solution to the nearest integer? If I just round 382.84 to its integer value, it would be 382. |
| Help me WA# 7 | Passarit | 1193. Queue at the Exam | 25 Sep 2014 20:32 | 5 |
My algorithm is 1. sort wait time min -> max 2. variable time declared to add total time 3. add minimal wait time and exam time to var(time) 4. add exam time everybody 5. if time > freetime print time-freetime else print 0 I think my algorithm is right ,but I got WA #7 Could you help me plz? I see. My algorithm has a little mistake. Now I got AC. you're wrong ! Let consider this test : 2 100 50 160 200 250 300 your answer : 100 correct answer : 150 Phan Hoài Nam - Đại học Ngoại ngữ Tin Học TP.HCM - Your test case is wrong. T2 cant be greater than 240 Edited by author 25.09.2014 20:32 Edited by author 25.09.2014 20:33 Try test 2 50 10 50 150 20 200 Answer: 10 |
| Hint | Ibragim Atadjanov (Tashkent U of IT) | 1789. Searching for the Dodecahedron | 25 Sep 2014 12:58 | 2 |
Hint Ibragim Atadjanov (Tashkent U of IT) 17 Oct 2010 13:45 This problem seems hard but the algo is so simple. if there n pedestals then the m is always 2 * n - 1; if you just at i-pedestal and original is at jth, then 1. if abs(i - j) - even you can catch it if you just walk towards it just by one. 2. if abs(i - j) - odd then you just two times take the i-th pedestal to make the difference even and go to 1. For doing above algo just start from the 1st pedestal to n and take n again then go back to the 2nd pedestal Good luck Edited by author 17.10.2010 13:47 You say m is always 2 * (n-1) or is it (2*n) - 1 whichever it is, your initial logic doesn't even satisfy the given output for n = 3. By your above method m should either be 2 * (3-1) = 4 or (2*3) - 1 = 7 whichever formula you intended to say - none of them satisfy the given output i.e. for n = 3 , m = 2 |
| RuntimeError (1001. Обратный корень) | don`t_even_you | 1001. Reverse Root | 25 Sep 2014 01:58 | 1 |
import java.util.*; import java.text.*; public class Test{ public static void main(String args[]){ Scanner in = new Scanner(System.in);
String s;
s = in.nextLine();
char c;
int i = 0;
Double [] mass = new Double [256];
String st = "";
for(int j = 0; j < s.length(); j++){ c = s.charAt(j);
if(c == ' ' || j == s.length() - 1){ //реализация вывода корня mass[255 - i] = Double.valueOf(st);
i++;
st = ""; }
if(c != ' ') st += c; }
DecimalFormatSymbols symbol = new DecimalFormatSymbols(); symbol.setDecimalSeparator('.'); DecimalFormat f = new DecimalFormat("#,##0.0000", symbol);
for(Double d: mass){ if(d != null){ System.out.println(f.format(Math.sqrt(d))); }
} } } Edited by author 25.09.2014 02:00 |
| How to calculate the expected number. | Dextrom | 1887. Frequent Flyer Card | 24 Sep 2014 22:16 | 4 |
When probability from 0~9 different, how to calculate the expected number??? Thank very much!! I have used Dynamic Programming. To do this, you need to store 2^10 states ... I have used Dynamic Programming to get probability. But don't know how to get EP. If probability is equal it's a coupon collector's problem? Please, explane this in more details. |
| Time limit #11 | bilac | 1100. Final Standings | 24 Sep 2014 00:39 | 1 |
import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.Scanner; import java.io.BufferedReader; import java.io.InputStreamReader; public class hgg { /** * @param args */ public static ArrayList<concho> listcho = new ArrayList<concho>(); public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in))); int a = sc.nextInt(); for (int i = 0; i < a; i++) { listcho.add(new concho(sc.nextInt(),sc.nextInt())); } Collections.sort(listcho, new Comparator<concho>() { public int compare(concho o1, concho o2) { // TODO Auto-generated method stub if(o1.kg<o2.kg) return 1; if(o1.kg>o2.kg) return -1; return 0; } }); for (concho item : listcho) { System.out.println(item.tuoi+" "+item.kg); } } public static class concho { int tuoi; int kg; public concho(int t, int k) { tuoi=t; kg=k; } } } |