| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| . | Ruben Ashughyan | 1852. Гигантский мезон с вишнями | 12 июн 2016 01:12 | 1 |
. Ruben Ashughyan 12 июн 2016 01:12 email: ruben.ashughyan@gmail.com Edited by author 01.11.2017 22:56 Edited by author 12.05.2021 20:35 |
| Wrong Answer Test #1 Please Help! Why it is wrong? | Evgeniy_Rus | 1020. Ниточка | 11 июн 2016 21:42 | 2 |
Edited by author 01.06.2014 20:04 |
| Test 1 plzzz | shweta | 1106. Две команды | 11 июн 2016 19:20 | 1 |
my code is running correctly but yet it fails at test 1 :( |
| To admins | Scalar | | 11 июн 2016 16:50 | 1 |
Can you add Rust language compiler? Edited by author 11.06.2016 16:54 |
| Visual C++ vs. G++ | yongwhan | 1249. Древний некрополь | 11 июн 2016 03:48 | 3 |
Just a passing note: the same exact code gets TLE in G++ but AC in Visual C++ (with a very comfortable margin). Make sure to test your code in both compilers before making a judgement that your code is too slow, for those who are coding in C/C++. That's ridiculous for some reason. TLE in G++ but AC in Visual C++ without a single edit in the source code. wow, the same one problem |
| 1100 Final Standings Solved Using C++ STL Vector , Pair And stable_sort | Ashadullah Shawon | 1100. Таблица результатов | 11 июн 2016 01:54 | 1 |
Here is my Solution. As this problem is related to stable sort and there is built in stable_sort function in c++ so it has become easier #include <bits/stdc++.h> using namespace std; bool compare( const pair<long long int,long long int>& x, const pair<long long int, long long int>& y ) { return (x.second>y.second); } int main() { vector<pair<long long int,long long int> >a; long long int n,i,j,b,c; cin>>n; for(i=1;i<=n;i++) { cin>>b>>c; a.push_back(pair<long long int,long long int>(b,c)); } stable_sort(a.begin(),a.end(),compare); //must include stable_sort vector<pair<long long int,long long int> >::iterator p; for(p=a.begin();p!=a.end();p++) { cout<<p->first<<" "<<p->second<<endl; } return 0; } Edited by author 11.06.2016 01:55 |
| Whats wrong with my code- Failing Test 6! | Sri Praneeth Iyyapu | 1787. Поворот на МЕГУ | 10 июн 2016 22:26 | 2 |
Whats wrong with my code. I get correct answer for Test 6 on my compiler, but when I submit the solution, I get wrong answer. Please help!! I tried with below values and got correct answer 4 3 3 4 5 Correct answer: 1 #include <iostream> using namespace std; int main() { int a,k,n,d; int b=0; cin>>k>>n>>d; for (int i=0;i<n-1;i++) { cin>>a; a=a-k; b=b+a; } if (d-k>=0) { if (b+d-k>=0) cout<<b+d-k; else cout<<0; }
else if (b>0) cout<<b; else cout<<0; char f; cin>>f; } I have some problem, try 5 4 3 , you must have 0. |
| TLE#11? Help... | caoyuan9642 | 1806. Мобильные телеграфы | 10 июн 2016 15:18 | 4 |
I used Dijkstra+heap optimized but still got TLE on #11.. Is there some better algorithm? help.. my email:caoyuan@mail.ustc.edu.cn thx. Try to use numbers instead of strings How to cope with the strings? I put all strings to a map, then for each string I construct all possible neighbours and then I check if they are in a map. So I have to deal with 50000 * 135 * 16 = 108 000 000 operations. It is too much. I can use a hash table. However, is there any simpler solution than using the hash table? You can use strings (because it's so conveniently), but you have to forget about std::map. Use unordered_map<string> (or your hash table) instead of it. I had TLE on test 11 with std::map, but when I changed map to unordered_map, I got AC with not bad time. I think it's easier than use numbers instead of strings. |
| WA Please give me the Test#6 | Luciano | 1209. 1, 10, 100, 1000... | 10 июн 2016 05:19 | 2 |
What is wrong #include <cstdio> unsigned long int contador[65535]; void carga() { for(int i=0;i<65535;i++) { if(i==0) contador[i] = 1; else contador[i] = contador[i-1] + i; }} bool busqueda(unsigned long int k[], int i) { bool buscador = false; int inf = 0, sup = 65534, centro; while(inf <= sup) { centro = ((sup - inf) / 2) + inf; if(contador[centro] == k[i]) { buscador = true; break; } if(contador[centro] < k[i]) { inf = centro + 1; } if(contador[centro] > k[i]) { sup = centro - 1; }} return buscador; } int main() { carga(); unsigned long int k[65535]; int n, i; scanf("%d", &n); for(int i=0;i<n;i++) { scanf("%lud", &k[i]); } for(i=0;i<n-1;i++) { if(busqueda(k, i)) printf("1 "); else printf("0 "); } if(busqueda(k, i)) printf("1"); else printf("0"); printf("\n"); } i am also getting WA at 5 |
| very easy | Maryin Dima | 1485. Лживый футбол | 9 июн 2016 23:53 | 7 |
It was very easy. Backtracking(перебор с возвратом) I think that it is hard problem and has exp(n) complexity. If remove psevdopractic decoration it is to solve a system boolean equation of 100 unknows Xi with type of Xi^Xj=0; (NotXi)^Xj=0;(NotXi)^(NotXj)=0. Amount of equation is near 10000. Thus we have easy problem for weak tests and very hard problem for detailed test. This situation was brightly shoun for identical Ships problems.Programmers should create code working on all possible tests in prescribed range of variables. Now I am also having Ac(0.031) by using backtracking. I have applied this method to boolean problem not to Graf. But I fear that we all will lost our submits if problem will be rejudged. In worst case in complexy is O(n^2) Yes, it's O(N^2). And resembles another problem of this type: 1382 does transitive closure algorithm work here? Just a standard 2-SAT problem. |
| TLE #10 | rkhapov | 1438. Time Limit Exceeded | 9 июн 2016 20:49 | 1 |
. Edited by author 13.06.2016 15:16 |
| help test #3 | elsukov43 | 1869. Новогодний круиз | 7 июн 2016 21:07 | 1 |
|
| WA #1 | mezkresh | 1500. Разрешения на проезд | 6 июн 2016 17:52 | 1 |
WA #1 mezkresh 6 июн 2016 17:52 I tried test 1 given in task on my computer and got the same answer. But i get WA #1 wwhen submit |
| hint | arun | 1056. Центры сети | 6 июн 2016 10:53 | 1 |
hint arun 6 июн 2016 10:53 try to locate the centre of the diameter of the tree ! O(N) |
| WA #10 | vtalgo16_alysenko | 1795. Мужья в магазине | 6 июн 2016 02:46 | 1 |
WA #10 vtalgo16_alysenko 6 июн 2016 02:46 My programm passes all tests from forum, but i still got WA 10. Have anybody some more tricky tests? |
| WHAT IS WA#4 | Buni_Real | 1354. Палиндром. Он же палиндром | 6 июн 2016 00:17 | 7 |
ADMINSTRATOR HELP PLEASE !!!!!!!!!!!! IT'S MY COD var a:array [1..20010] of char; i,j,k,n,w:integer; r:char; s:string; f:boolean; g:text; t:integer; procedure solve; label 1; var e:integer; begin f:=false; t:=0; for k:=1 to n+i do if (a[k]<>a[n+i-k+1]) then goto 1; f:=true; 1: end; {IMPORTANT PART} Begin assign(g,'input.txt'); reset(g); while not eof(g) do begin readln(g,s); n:=0; for i:=1 to length(s) do begin n:=n+1; a[n]:=s[i]; end; i:=0; repeat solve; if not(f) then begin i:=i+1; for j:=n+i downto n+1 do begin a[j]:=a[j-1]; end; a[n+1]:=a[i]; solve; end; until f; end; // close(g); for j:=1 to n+i do write(a[j]); readln;readln; end. REAL MADRID LUCK THE BEST CLUB Me too!!! program Ural1354; var s:string; a,b,l:longint; begin readln(s); l:=length(s); a:=1; while a<l do begin if s[a]<>s[l] then begin s:=s+' '; for b:=length(s) downto l+2 do s[b]:=s[b-1]; inc(l); s[l]:=s[a]; end; inc(a);dec(l); end; writeln(s); end. You are to find a nonempty word S2 if the input is palindrome... Test#4 abaabaaba ans: abaabaaba //for WA4, because S2 must be not empty! abaabaabaaba //for AC Edited by author 25.11.2011 17:57 I have the same answer, but still get WA4. What the problem? That's not the answer my friend. This is correct: abaabaaba abaababaaba As you see, your solution add three characters. Mine add only two. Greetings! nope, you should print S1 S2, as you see in your answer there is not clearly S1 |
| I have problems | Ivan Metelev | 2081. Испорченный циферблат | 5 июн 2016 23:09 | 6 |
There are mistake in statement may be. Difference between ._. ._. ..| and ._| is 1 |_. |_. Difference between ._. ._. ..| and |.| is 2 (the second example, the second number) |_. |_| My program write '02:05' except '00:05' like in example and I have wrong answer. Can someone help me? Edited by author 04.06.2016 15:30 Of course only after the end of contest For this task, pay attention to last few sentences. >>Each subsequent value must be strictly less than the preceding one.<< and >>If several answers exist, output any of them. It is guaranteed that there is at least one consistent sequence.<< Thanks a lot! I forgot that 1 test can be not like in statement. And I'll fix my mistake. Edited by author 05.06.2016 15:30 Edited by author 05.06.2016 15:27 Edited by author 07.06.2016 16:45 |
| Python big numbers | TwoEightNine Goes #STAG [146110 SSAU] | 1153. Суперкомпьютер | 5 июн 2016 19:43 | 5 |
print(int((((8*int(input())+1)**.5)-1)/2)) why the fuck doesnt it work???? i got wa6, who can help me with tests? Do you know how floating-point numbers work? Hint: use binary search Edited by author 24.10.2014 14:27 10^600 gives "OverflowError: int too large to convert to float" :) You can use Python library "decimal" |
| linkedlist gives wa21, arraylist takes 0.2s for AC | esbybb | 1901. Космический лифт | 5 июн 2016 04:55 | 1 |
sort, read from head and tail\ if head+tail>maximum -> add head,tail to the answers (in front),\ otherwise, add head to answers (to the back)\ wow! interesting observation though |
| Must all technologies of a project be used? | Bruce Merry | 2085. Волшебный программист | 4 июн 2016 15:52 | 2 |
When Ivan enters a project, *must* he use all the technologies used in the project, or can he choose to use only a subset of them (so as to avoid using a technology he has already used)? |