| Show all threads Hide all threads Show all messages Hide all messages |
| source codes | Snetch | | 9 Oct 2010 10:12 | 1 |
Is there any way that we can download all our source codes in one big archive, without entering the ID a hundred times? |
| The trick is here : gcd ( x , x + 1 ) = 1 | Phan Hoài Nam (HUFLIT) | 1040. Airline Company | 9 Oct 2010 00:04 | 1 |
This problem is so easy ^^! |
| WA 13 | JohNY_green | 1510. Order | 8 Oct 2010 20:09 | 2 |
WA 13 JohNY_green 30 Jul 2009 08:11 Can anybody give some stress test for this task?pls If you have problem with WA #13 try this test. 7 10000000 10000001 10000001 100000002 1000000000 10000001 10000001 Right answer is 10000001 |
| BinarySearch | хус | 1021. Sacrament of the Sum | 8 Oct 2010 19:49 | 2 |
AC code *** var a : array[1..500001] of integer; function BinarySearch(l, r, q : integer): boolean; begin if (r - l = 1) then if ((a[l] = q) or (a[r] = q)) then result := true else result := false else if a[(l+r) div 2] > q then result := BinarySearch(l, (l+r) div 2, q) else result := BinarySearch((l+r) div 2, r, q); end; var n, i, k, x : integer; begin readln(n); for i := 1 to n do read(a[i]); readln(k); for i := 1 to k do begin read(x); if BinarySearch(1, n, 10000-x) then begin writeln('YES'); exit; end end; writeln('NO'); end. *** |
| Access violation on test 3. Why? | Slava Muravjev | 1355. Bald Spot Revisited | 8 Oct 2010 02:57 | 1 |
Why do I have access violation on test 3? There is my cod: var t,i,j,l:longint; a,b,s,x:int64; x1,x2,r:extended; m,d:array [1..124776567] of int64; k:array [1..20] of int64; smena:boolean; begin readln(t); for i:=1 to t do begin readln(a,b); if b mod a<>0 then k[i]:=0 else if a=b then k[i]:=1 else begin x:=round(b/a); s:=x; l:=0; smena:=true; j:=1; x1:=1; x2:=1; while (j<100) or (x2-x1>1e-5) do begin r:=x2; x2:=1/2*(x1+x/x1); x1:=r; inc(j); end; j:=3; if s mod 2=0 then begin l:=1; d[l]:=2; while (s mod 2=0) and (s<>2) do begin s:=s div 2; inc(m[2]); end; smena:=true; end; while (s>j) and (j<=round(x2)) do if s mod j=0 then begin if smena then begin smena:=false;inc(l);end; d[l]:=j; s:=s div j; inc(m[j]); end else begin inc(j,2);smena:=true;end; inc(l); d[l]:=s; inc(m[s]); s:=1; for j:=1 to l do begin if m[d[j]]<>0 then s:=s+m[d[j]]; m[d[j]]:=0; d[j]:=0; end; k[i]:=s; end; end; for i:=1 to t do writeln(k[i]); end. |
| What is test 22? | KALO | 1494. Monobilliards | 8 Oct 2010 02:04 | 1 |
I've got AC (but only with dirty cheatings). Edited by author 21.10.2010 03:31 |
| I got AC just exactly 0.5 sec! | wangyin | 1126. Magnetic Storms | 7 Oct 2010 20:01 | 2 |
1229600 17:52:56 3 Jul 2006 wangyin 1126 Pascal Accepted 0.5 330 KB Funny...... the fast is the 0.015s,and my test accepted in 0.031s just by pascal,it's just no fun to say. |
| I change the way of Input and Passed Test#11 and got AC | petercai | 1519. Formula 1 | 7 Oct 2010 16:35 | 1 |
maybe some special character which is not "." or "*"? |
| Some tests | [SSAU #647] Caesar aka Gaidel Andrey Viktorovich | 1724. Origin of Man Clarified | 7 Oct 2010 02:15 | 2 |
Some tests [SSAU #647] Caesar aka Gaidel Andrey Viktorovich 19 Aug 2010 23:02 These tests have helped me to solve the problem. Test #1 input: A 1 1 1 output: 0 Test #2 input: Aa 3 1 1 1 2 2 2 output: 010 Test #3 input: AacCAa 5 1 6 1 2 1 4 2 3 5 6 output: 01001 Test #4 input: AaCAac 6 1 6 1 2 3 6 4 5 2 3 1 5 output: 111100 But what is wrong with the Test 3 in your example? The output is correct. |
| WA14 | Borozdin Kirill | 1203. Scientific Conference | 6 Oct 2010 21:37 | 1 |
WA14 Borozdin Kirill 6 Oct 2010 21:37 Please, give me some tests to solve this problem ;) |
| WA#4 - answer! | Ilmir Tazetdinov [IATE] | 1507. Difficult Decision | 6 Oct 2010 18:49 | 1 |
Our mistake was following: we used wrong function of matrix multiplication. Our function had three parameters FUNC(a, b, c). We call FUNC(x, y, x) to calculate x = x * y; but there is mistake, because when we calculate resulting matrix we should use constant "x" and "y", but first source parameter "x" is the same as third resulting parameter "x". "X" is changing during calculation and so we change also source parameter. Right decision is to use additional variable to store "x" t = x; FUNC(t, y, x); That's all |
| cannot understand \par | Seter | 1050. Preparing an Article | 6 Oct 2010 16:00 | 4 |
example: \""\para\"" what's right output? And how about the following input: \""\para\"" \endinputpar \endinput" \endinput What about: "\p ar" \endiput I cannot understand the question at all... corrected example: \""\para\"" \endinput correct output: \"``\para\"'' \endinput thus \para is just some other TeX command and you should not care what it does. in this test all text contained in one paragraph. |
| I help you:( | biksu | | 6 Oct 2010 00:32 | 2 |
I need help with code 1409:
#include <stdio.h> int main() { int a,b,c,d; scanf("%d%d",&a,&b); printf("%d\n",c=10-a,d=10-b, c+d<10); scanf("%d%d",&c,&d); getchar(), getchar(); return 0; } You don't understand this problem. Let Harry shooted A cans and Larry shooted B cans, then together they shooted A+B-1 cans. So Harry didn't shoot (A+B-1)-A = B-1 cans, and Larry didn't shoot (A+B-1)-B = A-1 cans. And it's the answer! |
| I help you:( | biksu | | 5 Oct 2010 23:49 | 1 |
I need help with code 1409:
#include <stdio.h> int main() { int a,b,c,d; scanf("%d%d",&a,&b); printf("%d\n",c=10-a,d=10-b, c+d<10); scanf("%d%d",&c,&d); getchar(), getchar(); return 0; } |
| plzzz can anybody give me the 7th test? | Roshka | 1343. Fairy Tale | 5 Oct 2010 21:30 | 2 |
Try something like 2 00 or 3 001 ;) |
| No matter how to choose blanks | Fokysnik | 1053. Pinocchio | 4 Oct 2010 16:50 | 2 |
Confusing question: HOW ARE THE BLANKS CHOSEN? Let's see example 2 3 4 - initial blanks I choose blanks 2 and 4 - they are different so I cut off piece of length 2 from the long blank (4). After that we have blanks: 2 3 2 - two blanks coincide so one is eliminated: 2 3 they are different so we cut of blank with length 3. We have: 2 1. Cut again we have 1 1. Eliminate one blank and we get a result - 1. You may try other ways to choose blank - but you will get same answer. So, NO MATTER HOW TO CHOOSE 2 blanks. Moral: What is not said does not matters ;) By the way algorithm is very very easy... try to think Captain Obvious Edited by author 04.10.2010 16:51 |
| advice for people, who make this problem on pascal | Alic | 1224. Spiral | 4 Oct 2010 01:13 | 1 |
don't use longint. do it using int64 |
| Executing time growing, without changing the code. Why? | Spiteful Berkut | 1224. Spiral | 4 Oct 2010 00:58 | 2 |
I know English bad and ask the question in Russian too. 1. I got AC with using "*2": ET = 0.015 s; 2. I replaced "*2" to "shl 1": ET = 0.001 s; 3. I tried to replace "(n-1)" to "Prev(n)": ET = 0.015 s; 4. I returned "(n-1)" instead "Prev(n)": ET = 0.015 s; Code #4 and code #2 are identical but ET different. Why? In Russian. Теперь по-русски. Прогу написал, послал -- ответ положительный, время выполнения 0,015 сек. Заменил умножение на 2 смещением влево на 1: время выполнения 0,001 сек. Заменил вычитание на Pred(n): Время опять 0,015; Вернул все как было, а время выполнения не поменялось. Почему, кто скажет. при первом прогоне кода время частенько меньше, чем после повторных попыток. не знаю, почему, но у меня тоже так было |
| excuse me where is my problem | BORIS (YSU) | 1110. Power | 2 Oct 2010 21:51 | 3 |
Edited by author 02.10.2010 21:48 Try this test: 900 800 700 x^n > max int and there is overflow. Edited by author 02.10.2010 12:59 |
| WA15 | agtr | 1133. Fibonacci Sequence | 1 Oct 2010 17:28 | 3 |
WA15 agtr 22 Nov 2009 20:40 Why WA15? I use binarysearch in the range [-2*10^9;2*10^9] Thanks, I tried, but also WA15 . I can't understand where is my mistake. |