| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| Что не так? Дома нормально - на сервере WA1 | gwire | 1100. Таблица результатов | 6 авг 2013 02:38 | 2 |
Такой вывод для первого теста подходит, т.к. "говорит" WA2 Console.Write("3 5\n26 4\n22 4\n16 3\n20 3\n1 2\n11 2\n7 1\n"); А этот WA1. В упор... =( . -------------------------------- using System; using System.Collections.Generic; class Program { struct TRec { public int ID, M; } static int Comp(TRec x, TRec y) { if (y.M < x.M) return -1; else if (y.M > x.M) return 1; else return 0; } static void Main() { int N = int.Parse(Console.ReadLine()); List<TRec> D = new List<TRec>(); string[] RecStr; for (int i = 0; i < N; i++) { RecStr = Console.ReadLine().Split(' '); TRec R = new TRec(); R.ID = int.Parse(RecStr[0]); R.M = int.Parse(RecStr[1]); D.Add( R ); } D.Sort(Comp); foreach (TRec X in D) Console.Write("{0} {1}\n", X.ID, X.M); Console.ReadLine(); } } Делаю в C#2012. Неужто в 2010 quick_sort работает по другому? hi! Need to use stable sort. I add extra field - ind, to compare 2 entry. using System; using System.Collections.Generic; class Program { struct TRec { public int ID, M, ind;} static int Comp(TRec x, TRec y) { if (y.M < x.M || (y.M == x.M && y.ind > x.ind)) return -1; if (y.M > x.M || (y.M == x.M && y.ind < x.ind)) return 1; return 0; } static void Main() { int N = int.Parse(Console.ReadLine()); List<TRec> D = new List<TRec>(); string[] RecStr; for (int i = 0; i < N; i++) { RecStr = Console.ReadLine().Split(' '); TRec R = new TRec(); R.ID = int.Parse(RecStr[0]); R.M = int.Parse(RecStr[1]); R.ind = i; D.Add(R); } D.Sort(Comp); foreach (TRec X in D) Console.Write("{0} {1}\n", X.ID, X.M); Console.ReadLine(); } } |
| if WA6 | hliu20 | 1017. Лестницы | 5 авг 2013 02:59 | 2 |
if WA6 hliu20 5 июн 2013 14:52 very strange, when using printf("%lld", ans); -> WA6 however, cout << ans << endl; ->AC same WA6 for me, but: printf("%I64d\n", answer); -> AC |
| Размерность результата | gwire | 1014. Произведение цифр | 5 авг 2013 00:50 | 1 |
Обратите внимание на результат при N = 1000000000. А точнее на его размер 555555555888 в 32 бита он не поместится. 8 тест из-за этого выдает "Wrong answer". |
| WA10 | rishi2110 | 1787. Поворот на МЕГУ | 5 авг 2013 00:42 | 1 |
WA10 rishi2110 5 авг 2013 00:42 Hi i'm getting WA for #10, can anyone help with this? My code works for everything ive tested so far public static void main( String [] args){ int a,b; Scanner sc = new Scanner(System.in); a = sc.nextInt(); b = sc.nextInt(); int[] array = new int[b]; for( int i = 0; i < b; i++) array[i] = sc.nextInt(); int carry = 0; for( int i = 0; i < b; i++){ array[i] = array[i] + carry; if(array[i] > a) carry = array[i]%a; else carry = 0; array[i] = array[i] - carry; } int answer=0; array[b-1]+=carry; int current = 0; for( int i = 0; i < b; i++){ if(array[current] <= a){ array[current] = 0; current++; } else array[current] = array[current] - a; } for( int i = 0; i < b; i++) answer+=array[i]; System.out.println(answer);
} Edited by author 05.08.2013 14:55 Edited by author 05.08.2013 17:31 |
| use unsigned long long for C++ | Valentin Pimenov | 1777. Племя аниндилъяква | 4 авг 2013 20:53 | 2 |
I didnt use ull & got AC. |
| Not so bad problem | ძამაანთ [Tbilisi SU] | 1873. Летопись GOV | 4 авг 2013 19:35 | 1 |
At first I was also pissed off but this problem is awesome in that it makes you remember forever that you need to first read input/ouput rather than problem itself! |
| Why does my program isn't working. | Ilian | 1001. Обратный корень | 4 авг 2013 17:23 | 1 |
#include<iostream> #include<stdio.h> #include<stack> #include<cmath> using namespace std; int main () { stack <unsigned long long int> a; unsigned long long int num; while (scanf("%llu",&num)!=EOF) { a.push(num); } for (;;) { printf("%.4lf\n",double(sqrt(double(a.top())))); a.pop(); if (a.empty()==1) break; } return 0; } That's my code. I have WA1. But my program writes right answer for the sample test. Where is my mistake is it printf (i tried with cout but the result was the same.)? Edited by author 04.08.2013 17:29 |
| How solve this problem? | Dmitry | 1971. Настройки графики | 4 авг 2013 17:17 | 1 |
|
| WA#5 | gochapod | 1881. Длинное условие задачи | 3 авг 2013 15:41 | 1 |
WA#5 gochapod 3 авг 2013 15:41 I have a problem with 5 test case. Firs I had Runtime Error, when I add lines: if(nextWord == null) continue; Runtime Error changed to WA. I'm using Java and i read my input as follow: StreamTokenizer in = in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); private static int nextInt() throws IOException { in.nextToken(); return (int) in.nval; } private static String nextString() throws IOException { in.nextToken(); return in.sval; } |
| test 6 | Ilya Lopukhin | 1971. Настройки графики | 3 авг 2013 14:33 | 3 |
test 6 Ilya Lopukhin 3 авг 2013 13:56 Somebody had a wrong answer in test 6? I can't understand what exactly can be wrong :( Please, help I had it when my program printed Perfect when FPS was 59.9 Edited by author 03.08.2013 14:32 |
| What is K?? | ayeritsian | 1009. K-ичные числа | 3 авг 2013 13:35 | 4 |
Please explane what is K. What it means K=10? Why then did not explain to others? Bin: K = 2, [0,1] Oct: K = 8, [0,1,2,3,4,5,6,7] (или [0..7]) Dec: K = 10, [0,1,2,3,4,5,6,7,8,9] (или [0..9]) Hex: K = 16, [0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F] (или [0..F]) То есть список цифр из которых может состоять К-ичное число = [0..K-1]. PS: В задаче K не > 10. Значит буквы не участвуют. |
| If you WA 8, change epsilon | Liu Strong | 1111. Квадраты | 3 авг 2013 11:53 | 4 |
To those who WA 8: Try to change your epsilon to something else then 1e-14. I changed that to 1e-8 and then I got AC. Also, don't calculate S△ABC as 0.5*AB*AC! It should be 0.5*AB*AC*sin∠A As I see - your advice is to use greater epsilon. May be it is better to avoid dangerous computations? I've solved this problem in integers - so all comparations were EXACT =) So, I think, the note about precision in problem text is superfluous. How did you solved it? My first solution was with integers but than i noticed not all squares are axes aligned. :( Anyway, could you send me you solution? My email is marshal at mail.bg. Thank you! I got AC without epsilon;) |
| My bad... | Sergey Filipkov | 1625. Hankel Matrix | 3 авг 2013 03:36 | 1 |
Edited by author 03.08.2013 03:37 |
| If you have WA #4 | PrankMaN | 1213. Тараканы! | 3 авг 2013 03:05 | 1 |
Name of a compartment might consists digits. |
| 13 test | Mirshod | 1820. Уральские бифштексы | 2 авг 2013 13:34 | 3 |
Because your solution are wrong. Cool answer. I'm sorry, but your English is bad. Solution can't be 'are'. |
| I can't understand the problem... | [中山一中]Rabidstorm | 1403. Курьер | 2 авг 2013 13:22 | 6 |
Don't it mean he only deliver one whisky on one day? I don't know the test while the others programmer offer... Who can tell me what the problem mean? example : 3 1 10 (order: 1) 2 15 (order: 2) 2 17 (order: 3) the answer: 2 2 3 ``````` The result don`t have (order: 1), because the last arrive day is 2, mean the man deliver twice, one day one once, the subject mean it find out max profit in no more than the last day 4 1 17 5 20 2 10 2 11 answer: 3 1 4 2 Do you understand ? Edited by author 30.12.2008 17:17 Can I answer in the first test "3 2"? Nope) "1 4 2" answer gives a 17+11+15=43$ reward. And there is no other sequence of delivery that will give us $43 reward. "If there are several solutions, output any of them." |
| Runtime Error What's wrong? | олька | | 2 авг 2013 01:59 | 2 |
using System; namespace ConsoleApplication4 { class Program { static void Main() { int x = 1; do { Console.WriteLine("введите число"); String строка = Console.ReadLine(); Single X; X = Single.Parse(строка); { if (X <= 4 && X >= 1 ) { Console.WriteLine(" few");} if( X <= 9 && X >= 5) { Console.WriteLine("several"); } if (X <= 19 && X >= 10 ) {Console.WriteLine("pack");} if( X <= 49 && X >= 20) { Console.WriteLine("lots");} if (X <= 249 && X >= 100) { Console.WriteLine("throng"); } if (X <= 99 && X >= 50) { Console.WriteLine("horde"); } if (X <= 499 && X >= 250) { Console.WriteLine("swarm"); } if (X <= 999 && X >= 500) { Console.WriteLine("zounds"); } if ( X <= int.MaxValue && X >= 1000 ) { Console.WriteLine("legion"); } } } while (x != 0); } } } using System; namespace ConsoleApplication4 { class Program { static void Main() { int x = 1; String строка = Console.ReadLine(); Single X; X = Single.Parse(строка); { if (X <= 4 && X >= 1) { Console.WriteLine("few"); } if (X <= 9 && X >= 5) { Console.WriteLine("several"); } if (X <= 19 && X >= 10) { Console.WriteLine("pack"); } if (X <= 49 && X >= 20) { Console.WriteLine("lots"); } if (X <= 249 && X >= 100) { Console.WriteLine("throng"); } if (X <= 99 && X >= 50) { Console.WriteLine("horde"); } if (X <= 499 && X >= 250) { Console.WriteLine("swarm"); } if (X <= 999 && X >= 500) { Console.WriteLine("zounds"); } if (X <= int.MaxValue && X >= 1000) { Console.WriteLine("legion"); } } } } } |
| Trolled | ძამაანთ [Tbilisi SU] | 1723. Книга Сандро | 1 авг 2013 20:02 | 1 |
Trolled ძამაანთ [Tbilisi SU] 1 авг 2013 20:02 This topic is devoted to trolled ppl :D God damn it I was ashamed after typing so many string super duper cumbersome functions XD |
| what`s the meaning of segment? | 95487701 | 1019. Перекрашивание прямой | 1 авг 2013 18:11 | 2 |
what`s the meaning of segment? [a,b],(a,b),(a,b],or [a,b)? Edited by author 18.04.2013 21:33 Segment is [a,b] (for painting). But you must output interval (a,b) Edited by author 01.08.2013 18:13 Edited by author 01.08.2013 18:13 |
| why WA#19 | Levin9 | 1959. GOV-стажировка 3 | 1 авг 2013 13:37 | 2 |
|