| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| some tests | Vladimir | 1936. Шоушилин | 24 май 2014 01:44 | 10 |
Give me, please, first 10-15 answers. It's not hard to get the correct formula for this problem, but harder to implement it because of high precision required. At last I had to use precalculated array for getting AC. Here's your answers: 2 -> 1.5 3 -> 2.25 4 -> 3.21428571 5 -> 4.48571429 6 -> 6.21981567 7 -> 8.64673579 8 -> 12.1044438 9 -> 17.0919353 10 -> 24.3495978 Re: some tests Vedernikoff 'Goryinyich' Sergey (HSE: АОП) 18 дек 2012 04:19 What was the issue? For me straightforward implementation in C++ using double got AC easily. How did you take 100th power of 3/2? I can't think it out. I've never used decimal long arithmetic. Edited by author 03.01.2013 16:06 Edited by author 03.01.2013 16:06 Re: some tests Vedernikoff 'Goryinyich' Sergey (HSE: АОП) 4 янв 2013 16:09 It is useful to remember that standard double type can store numbers up to 10^300 (and even a bit more). (3/2)^100 < 2^100 < 10^35 => no problem to compute it in double. And since you need relative accuracy of only 7 digits => 16+ digits that double variable stores is more than enough to compute what you need. Actually, here with usual double you can calculate answers for n up to 500+. Is it really true? I always thought that double type takes only 8 bytes of memory and hence cannot store such big numbers. But anyway thank you. Maybe I just have bad compiler or bad implementation as always :) Re: some tests Vedernikoff 'Goryinyich' Sergey (HSE: АОП) 6 янв 2013 01:25 good test: n=40 ans=3688328.070956036 The problem asks for at least 6 correct decimals. I had to compute up to 100 decimals (in intermediate computations) to get the required precision in the final answer for n = 100. Here is the (censored) answer for the biggest possible test: n = 100 answer = 13552*3*4*4*1*6*18.186159417 |
| although slower than DFA, AC with kmp ( 0.625 sec) | muhammad | 1102. Странный диалог | 24 май 2014 01:07 | 2 |
Are you kidding? My dumb solution in python ACCed in 0.3 sec:D Edited by author 24.05.2014 01:07 |
| WA #25 | igorsky | 1711. Кодовые имена | 23 май 2014 23:41 | 4 |
WA #25 igorsky 12 окт 2009 16:58 Re: WA #25 DM^Dude (Kherson State University) 22 окт 2009 01:53 me help test --------------------------------------------------- 16 cipher grille kamkohob names grillee pcodes newtests rejudge timus size volume summit watchmen braineater twosides solution random yesorno keywords subversion commands bosses shooting shaitan game strategy playgame mnemonic palindromes bestname eligibility rectangle rules txxxxxxx txxxyzasd txxxxxas volvo vlot volt vvv vvilia vvobla what is it zina whashing potatoes 2 1 7 10 9 6 11 3 8 4 5 12 13 14 15 16 ------------------------------------------------ answer is ------------------------------------------------ grillee kamkohob keywords mnemonic playgame random rectangle rejudge shaitan size twosides txxxxxas vlot vvilia what zina For your test,i got the same answer ,but my code wa#20 I've had this problem too. THen i found my mistake. My function that compared two strings and returned the lower one: f f("aa","aaaa")="aa"; f("aaaaa","aa")="aaaaa"; - this was a mistake. It should have returned "aa" sorry for my English |
| WA №3 | AKruglyak | 1131. Копирование | 22 май 2014 22:33 | 3 |
WA №3 AKruglyak 21 фев 2012 21:48 Why? This is my solution: #include <iostream> using namespace std; int main(){ long int a,b,f=0; long int k=1; cin>>a>>b; if (a==1) { f=0; cout<<f; return 0;
}
if (b>=a && a<=2) f=1;
else if(a!=1){ while (k<=b){ f++; k*=2;
} a -=k; while (a>0){ f++; a=a-b;
} } cout<<f;
return 0; } Some test for your program 10 1 ans 9 3 8 ans 2 Some test for your program 10 1 ans 9 3 8 ans 2 Спасибо, помогло=) |
| I u have WA #7 | † SiriuS † [TWYT Union] | 1419. Карта мира 40 островов | 22 май 2014 16:47 | 1 |
I got WA #7 several times. If u also got WA just try this test: 9 5 O-O-O-O-O |\ \|/ /| O-O O O-O |/|\ /|\| O-O-O-O-O It helped me to get AC. |
| acmp | Abdulkhakim | 1025. Демократия в опасности | 22 май 2014 15:12 | 3 |
acmp Abdulkhakim 15 янв 2014 14:54 why this is accepted but in the acmp wrong answer 2 461 in acmp Edited by author 15.01.2014 14:54 Because there numbers may be even. Re: acmp Smilodon_am [Obninsk INPE] 22 май 2014 15:12 Restrictions on number K are different |
| ... Stack overflow... ? C++ | Ingy | 1001. Обратный корень | 22 май 2014 14:58 | 2 |
#include <cmath> #include <iomanip> #include <iostream> using namespace std; int main () { double number [100000]; int i=0; while ( ! cin.eof()) { cin >> number [i]; i++; } for( int j=i-1; j>=0; j--) { cout<< setprecision (4) << sqrt(number[j])<<endl; } return 0; } here's my program but I don't know what's wrong.. when i put the number of elements of the array to 140000 it says "stack overflow", when i put 10000 it says wrong answer. All local variables are allocated in stack. Array "number"[] is local, because it is described in function "main". Standard size of stack is 1 MB, size of double variable is 8 bytes. So it isn't enough space to allocate all array with 140000 elements. You should increase stack size. http://acm.timus.ru/help.aspx?topic=cpp #pragma comment(linker, "/STACK:16777216") Edited by author 22.05.2014 15:07 |
| 2admins: why tle on test42? | svg2003 | 1915. Руины титанов: воссоздание былого | 21 май 2014 20:03 | 2 |
This my results. For this task, time limit is 1.0 second, so why it happend with 0.265 time? 5520909 12:24:55 21 фев 2014 svg2003 1915. Руины титанов: воссоздание былого Visual C# 2010 Time limit exceeded 42 0.265 49 708 КБ Edited by author 21.02.2014 12:30 Edited by author 21.02.2014 12:31 May be 0.265 is time of last succefull test. Looks like test 42 uses geometric progression - coins double many times. So solution should work with unlimited stacks. |
| 1083 Runtime error (integer division by zero)? SOS | Dior | 1083. Факториалы!!! | 21 май 2014 06:52 | 1 |
|
| AC with DP | [RISE] Levon Oganesyan [RAU] | 1786. Биография Сандро | 21 май 2014 01:42 | 1 |
AC with DP [RISE] Levon Oganesyan [RAU] 21 май 2014 01:42 I solve this problem with dp. Cool problem, similar to the Levenshtein,but with some differents. |
| WA 43 and 51 | [RISE] Levon Oganesyan [RAU] | 1769. Старая уральская легенда | 20 май 2014 23:01 | 1 |
if you have WA 43 and 51, check this tests 0 00 000 0000 00000 1 01 001 0001 00001 answers is primitive - 1,1,1,1,1,2,2,2,2,2 |
| WA8 | endtimes | 1820. Уральские бифштексы | 20 май 2014 22:40 | 4 |
WA8 endtimes 7 дек 2013 19:18 Module Module1 Sub Main() Dim a() As String = Console.ReadLine.Split(" ") Dim n, k As Integer n = 2 * CInt(a(0)) k = CInt(a(1)) Dim rez As Integer = Math.Ceiling(n / k) Console.WriteLine(rez) End Sub End Module I got wrong answer for test#8 but my output is 2. What is wrong? Edited by author 12.05.2014 00:54 |
| WA 27 | Sunnat | 1891. Язык Ocean | 20 май 2014 19:02 | 1 |
WA 27 Sunnat 20 май 2014 19:02 what's wrong in my code, please give me some test #include <iostream> #include <vector> #include <string> #include <map> using namespace std; map<string,string>functions; map<string,string>variables; int main(){ int count_function, count_variable,i,j; string line,s1,s2,s, type; cin >> count_function; for(i = 0; i < count_function; i ++){ cin >> s1; while(cin >> s){ if(s == ":") break; s1 = s1 + " " + s; } cin >> s2; functions[s1] = s2; }
cin >> count_variable;
vector<string>variable; vector<string>types;
for(i = 0; i < count_variable; i ++){ cin >> type >> s >> s1 >> s1; while(s1[s1.size() - 1] != ')'){ cin >> s2; s1 = s1 + " " + s2; } if(variables.find(s) == variables.end()){ s2 = ""; j = 0; while(s1[j] != '(') s2 += s1[j++]; s2 += '('; j ++; while(s1[j] != ')'){ line = ""; while(s1[j] != ',' && s1[j] != ')') line += s1[j++]; if(variables.find(line) == variables.end()){ cout << "Error on line " << i + 1 << ": " << "Unknown variable" << endl; return 0; } s2 += variables[line]; if(s1[j] == ','){ s2 += ", "; j += 2; } } s2 += ')';
if(functions.find(s2) == functions.end()){ cout << "Error on line " << i + 1 << ": " << "No such function" << endl; return 0; }
s2 = functions[s2];
if(type == "auto"){ variable.push_back(s); types.push_back(s2); type = s2; } if(type != s2){ cout << "Error on line " << i + 1 << ": " << "Invalid initialization" << endl; return 0; } variables[s] = s2; }else{ cout << "Error on line 2: Double declaration" << endl; return 0; } } for(i = 0; i < types.size(); i ++) cout << variable[i] << " : " << types[i] << endl; return 0; } |
| WA #1 | SeJIya | 1050. Подготавливая статью | 20 май 2014 04:00 | 1 |
WA #1 SeJIya 20 май 2014 04:00 |
| WA#8 | b108 | 1754. Взрыв в пирамиде | 19 май 2014 20:25 | 2 |
WA#8 b108 27 янв 2014 21:31 If you have WA#8 then check that m >= h Thanks a lot. if m<h then writeln('NO'). |
| Test 10 | Neo Nomaly | 1506. Столбцы чисел | 19 май 2014 14:47 | 6 |
Test 10 Neo Nomaly 22 янв 2007 10:01 WA 10. Give this test please... Have trouble with this test too... and one question: if input is like that: 7 6 1 2 3 4 5 6 7 should be output like that: 1 3 4 5 6 7 2 or that: 1 3 5 7 2 4 6 The answer is: 1 3 5 7 2 4 6 Remember about the correct number of spaces. Re: Test 10 Phan Hoài Nam - Đại học Ngoại ngữ Tin Học TP.HCM 11 мар 2009 15:56 My AC program show : 1 3 4 5 6 7 2 it is incorrect answer or test >the columns have the same height with the possible exception of the last column, which may be shorter This test is incorrect. Timus Online Judje Team likes give people incorrect tests. |
| A misprint in statement | urusant | 1289. Билет в один конец | 19 май 2014 10:56 | 1 |
The second word should be "crowd", according to the Russian translation. |
| Can you give me test data&//В чем дело? Пролетает то на первом, то на втором тестах. Хотя дома проверку проходит. Можете ли дать мне данные для проверки? | Evgeniy_Rus | 1297. Палиндромы | 19 май 2014 01:07 | 1 |
var a:array[1..1000] of string; S, pol:string; N, i, j, dlina:longint; function Sum(i, j:integer):string; var k:string; var i1:integer; begin k:=''; for i1:= i to j do k:=k+a[i1]; Sum:=k; end; function Sum1(i, j:integer):string; var k:string; var i1:integer; begin k:=''; for i1:= j downto i do k:=k+a[i1]; Sum1:=k; end; begin readln(S); N:=length(S); for i:= 1 to N do a[i]:=copy(lowercase(S), i, 1); dlina:=0; for i:= 1 to N-1 do begin for j:= i+1 to N do if (Sum(i, j)=Sum1(i, j)) and (length(sum(i, j))>dlina) then begin pol:=Sum(i, j); dlina:= length(sum(i, j)); end; end; writeln(pol); end. |
| WA #5, why !! :-( | simon.abdullah | 1350. Столовая | 18 май 2014 18:24 | 1 |
I always get WA in #5 here is my code, somebody help me please. <code> #include<stack> #include<iostream> #include<algorithm> #include<vector> #include<list> #include<iterator> using namespace std; int getSafe(vector<string> a,int an, vector<string> b, int bn){ int d=0; for(int i=0;i<an;i++){ for(int j=0;j<bn;j++) if(a[i]==b[j]){ d++; break; } } return d; } struct ve{ vector<string> v; }; int main(){ int n,N,m; cin>>N; string str; vector<string> menu; for(int i=0;i<N;i++){ cin>>str; menu.push_back(str); } cin>>n; int a,b; cin>>b; vector<string> fMenu; for(int i=0;i<b;i++){ cin>>str; fMenu.push_back(str); } int i=0; int nums[102]; ve res[102]; while(i<n){ cin>>a; nums[i]=a; for(int j=0;j<a;j++){ //cout<<"d"; cin>>str; //cout<<"s"; res[i].v.push_back(str); } i++; } cin>>m; for(int i=0;i<n;i++){ int x=getSafe(res[i].v,nums[i],fMenu,n); int c=getSafe(menu,N,res[i].v,nums[i]); if(x-nums[i]==0) cout<<"YES\n"; else if(N-b-nums[i]+x-m<0) cout<<"NO\n"; else cout<<"MAYBE\n"; } return 0; } </code> |
| test #3 | yarmet | 1917. Руины титанов: убийственная точность | 18 май 2014 17:52 | 1 |
кто-нибудь знает какой 3 ий тест ? Уже 7ой раз на нем фейлится, long'и использую. Edited by author 18.05.2014 18:13 Edited by author 18.05.2014 18:13 |