| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| new flashmob on timus | Baurzhan | | 9 сен 2010 09:40 | 1 |
Let's solve problems which have the same number with your rank in authors ranklist. Milanin is lucky=) |
| No subject | SHAN2 | 1068. Сумма | 8 сен 2010 21:31 | 1 |
|
| test 5 | abdkanan | 1295. Бред | 8 сен 2010 21:29 | 2 |
test 5 abdkanan 10 фев 2006 02:49 Re: test 5 Pustovalov Evgeny [Ekaterinburg SESC USU] 8 сен 2010 21:29 А ты подставь 300000, работать будет? ;) And you substitute 300000, will work?;) |
| PASCAL AC Solution 9 lines!!!! | George Skhirtladze | 1068. Сумма | 8 сен 2010 19:59 | 2 |
var n,i:longint; begin read(n); if n<=0 then begin n:=n*-1; write(((n*(n+1))div 2)*-1+1); end else writeln(n*(n+1)div 2); end. Edited by author 13.04.2010 16:42 Edited by author 13.04.2010 16:43 Use single formula, without 'if'-condition. Hint: Use Abs() |
| Помогите!!!Лимит времени(= | Dj_Denis | 1423. Басня о строке | 7 сен 2010 22:34 | 3 |
Что здесь поменять чтоб количество циклов было меньше... var n,x,i,j,t:integer; a,b:array[1..250000]of char; tempchar,ch:char; label fin,step; begin readln(n); x:=-1; for i:=1 to n do read(a[i]); readln; for i:=1 to n do read(b[i]); readln; i:=1; while i<=n do begin j:=1; while j<=n do begin if j=1 then begin tempchar:=a[1]; a[1]:=a[n]; end else begin ch:=a[j]; a[j]:=tempchar; tempchar:=ch; end; j:=j+1; end; for t:=1 to n do if a[t]=b[t] then x:=i else begin x:=-1;goto step; end; if i=n then x:=0; goto fin; step:i:=i+1; end; fin:write(x); end. Your realisation is 'naive', takes in worst case O(N^2) operations. for 250000 it's about 62,5 billions iterations. It will take almost 1 minute on even strong CPU's Use, for example, hash function. Try test with 249999 equal symbols and one another Избежать лемит времени можно написав КМП ;) |
| I have Knut_Morris_Pratt Algo, but why do I have WA#8? | Alexey | 1423. Басня о строке | 7 сен 2010 20:37 | 3 |
Someone knows what is that test? give me some tests please... I got AC (with time 0,5 sec), using cyclic 64bit xor-hash. Try test like that: 250000 aaaaaaaaa .... (fill this with 'a') ... aaaaaB aaaaaa .... aaaBaaaaa .... aaaaaa or (in second line) Baaaa .... or aaaaa ..... aaaaaBa |
| Hint for test#10 | Nguyễn Kim Vỹ | 1116. Кусочно-постоянная функция | 7 сен 2010 07:55 | 3 |
increase size of array. 15000 (not 14999) Edited by author 25.07.2010 03:39 Edited by author 25.07.2010 03:40 AC!! ░▒ Nguyễn Kim Vỹ ▒░ 25 июл 2010 03:32 Edited by author 25.07.2010 03:40 increase size of array. THE ANS ARRAY 50000!!! |
| some tests | Georgiy Platonov | 1665. Финансовая пирамида декана | 6 сен 2010 21:45 | 1 |
Here some testcases and my AC program's answers. May be these would be helpful for you. Good Luck. 10 NO 100 YES 1000 YES 8 YES 16 NO 32 YES 64 NO 125 YES 126 YES 1 NO 12345678 YES 17 YES 107 YES 267 YES 2992 YES 987456 YES 769 YES 896 NO 1536 NO 796 YES |
| Help!!! Wrong answer! test #1,what does it means? | GaoHughes | 1079. Максимум | 6 сен 2010 21:37 | 1 |
#include<iostream> using namespace std; void K(int); void main() { int b[10],j=0,k=0; for(;j<10;j++) { cin>>b[j]; if(b[j]==0) break; } for(;k<j;k++) K(b[k]); }
void K(int n) { if(n!=1) { n++; int *a = new int [n]; a[0]=0; a[1]=1; int i=2; for(;i<n;i++) { if(i%2==0){a[i]=a[i/2];} else {a[i]=a[(i-1)/2]+a[(i-1)/2+1];} } if(n%2==0){cout<<a[n-1];} else {cout<<a[n-2];} cout<<endl; } else { cout<<0<<endl; } } |
| Output format | Fyodor Menshikov | 1248. Сумма последовательности | 6 сен 2010 19:42 | 2 |
Checker accepts any number of digits in mantissa, so it is possible to output just exact answer having all digits. Rounding to 19 digits or appending zeros to 19 digits is not required. For answer calculated in java.math.BigDecimal the following simple statement works: out.println(sum.toPlainString() + "e0"); |
| Why the sample output is 3 ? But not 2 ? | GaoHughes | 1005. Куча камней | 6 сен 2010 18:50 | 3 |
The sample input is: 5 5 8 13 27 14 output is: 3 !!!! But (5+5+13+14)=37 (8+27)=35 so 37-35=2!!!!!!!!!!! why is 3 ?? // the number of stones 5 // their weights 5 8 13 27 14 |
| CLARIFICATION | Vedernikoff Sergey (HSE: АОП) | 1739. Фарюки | 6 сен 2010 17:43 | 1 |
"When a faryuk is sprayed upon with the deodorant, its aroma strength decreases by 25 percent. When a faryuk is scented, its aroma strength increases by 10 percent. (In both cases, the aroma strength can become fractional)." The question is about what is the base for calculations of 10% and 25% if we spray one faryuk several times: is it 10% and 25% of _initial_ aroma strength of a faryuk, or 10%/25% of aroma strength which we got after first aromatization? |
| WA 3 | ib18 | 1015. Найдите различия! | 5 сен 2010 21:27 | 1 |
WA 3 ib18 5 сен 2010 21:27 Help me please! What's wrong with my program?? #include <iostream> using namespace std; #define ll unsigned long long ll f(ll* a) { swap(a[4], a[5]); for (int i=1; i<=3; i++) if (a[2*i-1]>a[2*i]) swap(a[2*i-1], a[2*i]); for (int c=1; c<=3; c++) for (int i=1; i<3; i++) if (a[2*i-1]>a[2*i+1]) { swap(a[2*i-1], a[2*i+1]); swap(a[2*i], a[2*i+2]); } return a[6]+10*a[5]+100*a[4]+1000*a[3]+10000*a[2]+100000*a[1]; } ll a[100001][7], sol[800][100010], sum; int main() { ll n, k=0, sum; cin>>n; for (ll i=1; i<=n; i++) { for (int j=1; j<=6; j++) cin>>a[i][j]; sum=f(a[i]); //cout<<"i="<<i<<" "<<sum<<endl; bool f=true; for (ll cnt=1; cnt<=k; cnt++) if (sol[cnt][100009]==sum) { f=false; ll tmp=++sol[cnt][0]; sol[cnt][tmp]=i; break; } if (f) { ++k; sol[k][0]=1; sol[k][1]=i; sol[k][100009]=sum; } } cout<<k<<endl; for (ll i=1; i<=k; i++) { for (ll j=1; j<=sol[i][0]; j++) cout<<sol[i][j]<<" "; cout<<endl; } } |
| Any simple approach? | Artem Khizha [DNU] | 1057. Количество степеней | 5 сен 2010 15:46 | 1 |
Well, after all, I solved this problem, but it took a long time for me to find all mistakes in my calculations. My idea was to generate F[N,K] in a O(log(N)*log(N)) time, which means an amount of numbers with N or less digits (in a certain base) with K one-digits. Then I wrote a function C(N, K), which finds an amount of numbers with K one-digits in [1, N] using F and deleting its first digit every time. Actually it's all about dynamic programming. But I think there must be more clear and efficient solutions, than mine (O(log(N)*log(N)) for time and memory). If it does, please, would you be so kind to share it? |
| Clarification (+) | Dmitry 'Diman_YES' Kovalioff | 1320. Разбиение графа | 5 сен 2010 08:51 | 9 |
The text is incorrect: "...to present it by the set of pairs of adjacent edges..." means not to transform the graph into a form in which it will be unequivocally presented by the set of pairs of its adjacent edges (it is rather difficult problem), but only to share (divide, separate) it into pairs of adjacent edges (it is easy). i.g. you can divide graph [1-2-3-4-1] into [1-2] and [3-4] Text is correct. One can understand this problem with a help of simple example: Imagine graph drawn on a wall. Select any vertex and erase exactly two edges incidental to this vertex. The question of problem is: "Is it possible to erase all edges of graph doing in this way?". The text is "There is a simple graph with an even number of edges. You are to define if it is possible to present it by the set of pairs of adjacent edges (having a common vertex)." Isn't it? It differs from "Imagine graph drawn on a wall. Select any vertex and erase exactly two edges incidental to this vertex. The question of problem is: "Is it possible to erase all edges of graph doing in this way?"" Isn't it? I've understood the real definition, 'cause I was on quaterfinal, and I still think that the text doesn't correspond this definition. Text should be changed. It's easy. Isn't it? I think statement is correct. I also was at quarterfinal, but understand problem in right way. I was in jury of that quarterfinal, so I know this problem better. I doubt problem text will be changed, because union of original text and clarification text (about graph on a wall) should be enough to solve this (easy) problem. Too lazy to change or too stubborn to recognize a mistake? So now everyone who wants to solve this problem and was not in jury of that quarterfinal should get WA several times and then come to the board and see your "clarification"? By the way, do you know why this ("easy") problem has only 11% of AC? >Too lazy to change or too stubborn to recognize a mistake? Mostly: jury is very tired. There were no questions on this issue on contest, so text is OK.There are questions at timus - and they are answered. Anyway, before throwing such words ("lazy", "stubborn", "mistake") you should organize couple of quarterfinals (for example next quarterfinal) yourself. All question to jury of this particular contest should be posted to contest.ur.ru/board/ >By the way, do you know why this ("easy") problem has only 11% of AC? Here "easy" means "has simple solution" but not "is obvious". >Anyway, before throwing such words ("lazy", "stubborn", "mistake") you should organize couple of quarterfinals (for example next quarterfinal) yourself. Really? So I will take your word for it. I am ready to do it. In fact, I've thought about organizing 1/8 final zone, but I was not sure it is possible. And now such an opportunity! Thank you very much. Mail me to dimanyes@mail.ru for next discussing. To everyone: Mr. Mironenko wants me to organize next quaterfinal. So, welcome next year to Dmitry "Diman_YES" Kovalioff's Quaterfinal in Tyumen! Actually I didn't understand problem statement either. I don't like going to the boards before solving a problem because sometimes the solution is spoiled. In this particular case if you don't GUESS what the problem statement means you HAVE TO come to the board. |
| I GOT AC!!!!!!!! | FELIX | 1024. Перестановки | 4 сен 2010 22:39 | 2 |
i'm so glad that i can do the problem on myself!!!i come up with the right way to solve the probmlem,but i forgot about the time.so i time time limit exceeded.then i did some work and——i got ac!!!here's the for example to the problem,hope to help you:4?3=12,and 2?3=6. cycle length + GCD thats all. |
| Why I got WA on #15? | HJ | 1151. Радиомаяки | 4 сен 2010 21:33 | 2 |
|
| WA 12, what's wrong ? | Alias (Alexander Prudaev) | 1151. Радиомаяки | 4 сен 2010 21:32 | 3 |
RSignJ - distance from checkpoint I to beacon J - can be 0 |
| What does SURFACE mean? | TestKiller | 1315. ПДВАС и ПВИПАС | 3 сен 2010 21:02 | 1 |
In the text, what does the word SURFACE mean? Consider the following case: 3 6 2 2 3 #.# #.# #.# #.# ... ### Can he rescued by himself?????? |
| Sort users by country | Alexander Georgiev | | 3 сен 2010 11:56 | 3 |
Is there any possibility to make Authors Ranklist also viewable per country? I mean every country to has a separate ranklist for just its coders. Shouldn't be more than few lines of code and one WHERE clause more in the database query :) For what purpose? Country shouldn't be a parameter by which you can sort people. Are you nationalist? I mean only add an option to show only people from a certain country. I would like to see how are the other people from my country doing. |