| Show all threads Hide all threads Show all messages Hide all messages |
| Test Case 8 | Imran | 1414. Astronomical Database | 23 Jun 2016 08:55 | 1 |
Can someone tell me what's test case 8? With set, all testcases pass but with Trie, I am getting WA at testcase 8. |
| Объяснения по-русски | __Andrewy__ | 1218. Episode N-th: The Jedi Tournament | 23 Jun 2016 06:31 | 3 |
Короче,у нас проходит некий турнир.Правила таковы: мы выбираем любых двух джедаев из оставшихся ,они между собой сражаются,из них по условию ровно один побеждает,проигравший исчезает с турнира. И так далее: снова выбираем двух джедаев,один остается,и т.д. По условию либо Джедай А сильнее Джедая Б либо наоборот. Сильнее значит не менее чем по двум параметрам один джедай выигрывает у другого(т.е. соответствующие значения строго больше). Нам нужно найти всех возможных победителей,т.е. тех,кто останется последним. Мы можем как угодно формировать расписание турнира,т.е. выбирать кто с кем из оставшихся будет драться. Победитель может провести всего 1 бой,а может 2,а может 3,... .Расписание мы САМИ формируем!!! У кого нет идей,советую узнать про алгоритм Тарьяна и граф конденсации. Edited by author 31.08.2015 22:18 За N*logN решается, есличо)) |
| some tests | FrostCode | 1612. Tram Forum | 22 Jun 2016 01:50 | 2 |
Input: trams trolleybuses trambus bus Output: Bus driver Input: tram tramtrolleybus bus Output: Tram driver Input: trams trolleybus trolleybus tram! tram. Output: Bus driver Input: bus bus tratrolleybus trolleybu tra. Output: Bus driver Input: trams trolleybuses trambus bus Output: Bus driver Input: tram tramtrolleybus bus Output: Tram driver Input: trams trolleybus trolleybus tram! tram. Output: Bus driver Input: bus bus tratrolleybus trolleybu tra. Output: Bus driver Thanks a lot... :) |
| Some test cases... | Ealham | 1601. AntiCAPS | 21 Jun 2016 23:57 | 1 |
I've been struggling hard to overcome WA4 and WA9... In the problem statement, it says "Sentences in a message consist of words, spaces and punctuation marks". Then I've made these test cases and got AC in one go... :) Try these cases if u get WA... Case 1: WHO ARE UUUUUUUUUUUUUUUUUUU UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU? CANT U SEE IT ? Ans: Who are uuuuuuuuuuuuuuuuuuu uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu? Cant u see it ? Case 2: WHO ARE UUUUUUUUUUUUUUUUUUU UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU? CANT U SEE IT ? Ans: Who are uuuuuuuuuuuuuuuuuuu uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu? Cant u see it ? (It looks same to case 1, but it has an initial space character in the first line and I think this was causing WA9 for me...) Case 3: AND BEING CARELESS, WE ARE DESTROYING THE EARTH. ????? WHO ARE UUUUUUUUUUUUUUUUUUU UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU? CANT U SEE IT ? WHY DID U DO THIS? UUUUUUUU UUUUUUUU IDIOT. BYE. Ans: And being careless, we are destroying the earth. ????? Who are uuuuuuuuuuuuuuuuuuu uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu? Cant u see it ? why did u do this? Uuuuuuuu uuuuuuuu idiot. Bye. Case 4: ...ARE U THERE STILL? PLEASE, ANSWER MEEEEEEEEE , ANSWER ME , ANSWER ME... PLEASE Ans: ...Are u there still? Please, answer meeeeeeeee , answer me , answer me... Please Let me know if any1 finds any error... Thanks. |
| Add test please | Fyodor Menshikov | 1494. Monobilliards | 21 Jun 2016 11:34 | 2 |
I know heuristic solution to problem 1494 that passes all Timus tests but fails tests of some kind. The simplest test that it does not pass is 5 4 2 5 3 1 |
| what is the test #3??? | maslowmw | 1732. Ministry of Truth | 20 Jun 2016 20:59 | 13 |
this input help me pass test #3 lossiblossible lossible answ: ______lossible Thanks, this test help me too))), but now i have TLE on test5 TL5 Dmitry Kostyanetsky 2 Nov 2009 09:24 I use hash, but I have TL#5 too, how I can pass this test? help me. Re: TL5 Dmitry Kostyanetsky 2 Nov 2009 18:12 Yes! finally I got AC =) may it help somebody: look attentively on this code for (int i = 0;i<strlen(s);i++) { ... } and this int l = strlen(s); for (int i = 0;i<l;i++) { ... } Edited by author 02.11.2009 18:12 Edited by author 02.11.2009 18:14 are you sure this is test 3 ? perhaps i can't really understand the description because it works just fine but it always breaks on test 3... can someone help with these intervals or... i don't know give some tests to try abcx abcxx abcxx abc abcx abc x My programm gives answ "I HAVE FAILED!!!" for test abcx abcxx abcxx abc abcx abc x Is it rigth answer??? sorry.i found my mistake.Now i have wa7 And what is now your answer for a test? And check may be you put a trailling space at the end... Why the answer for the input lossiblossible lossible is ______lossible instead of lossibl______e ? Edited by author 05.03.2016 04:02 Edited by author 05.03.2016 04:03 Lucas Lustosa Madureira, No. Edited by author 20.06.2016 20:59 s = input() sl = input().split() result = '' _delete = lambda ls: ''.join({' ': ' '}.get(lc, '_') for lc in ls) def delete(ls): global s, result try: pos = s.index(ls) except: print('I HAVE FAILED!!!') exit() result += _delete(s[:pos]) s = s[pos:] result += ls s = s[len(ls):] is_first = True for ls in sl: if is_first: is_first = False else: delete(' ') delete(ls) print(result+_delete(s)) It's WA3 too Edited by author 20.06.2016 20:58 |
| WA on test case 5 | Drixmux | 1646. Godzilla Strikes Back! | 20 Jun 2016 02:46 | 1 |
I need help, I got WA on test case 5, and I do not know what's the problem. Here my code: #include <bits/stdc++.h> using namespace std; string getPrefix(string s, int n){ string result; if(n >= s.size())result = s; else result = s.substr(0,n); return result; } string getSuffix(string s, int n){ int newN; string result; if(n >= s.size()) result = s; else result = s.substr(s.size() - n); return result; } int main(){ string s, a, b; int m; while(cin>>s>>a>>b>>m){ vector<pair<string, string> > v(m + 10, {"",""}); vector<long long int> cnt(m + 10, 0); v[1] = {a, a}; cnt[1] = 0; v[2] = {b, b}; cnt[2] = 0; long long int maxi = 0; for(int i = 3, from, to; i <= m + 2;i++){ cin>>from>>to; string text = v[from].second + v[to].first; string text2 = v[from].first + v[to].second; string prefix = getPrefix(text, s.size() - 1); string suffix = getSuffix(text, s.size() - 1); string prefixNew = getPrefix(text2, s.size() - 1); string suffixNew = getSuffix(text2, s.size() - 1); v[i] = {prefixNew, suffixNew}; cnt[i] = (cnt[from] + cnt[to]) % 1000000007; if(text.size() >= s.size()){ for(int j = 0 ; j < text.size() - s.size() + 1; j++){ if(s == text.substr(j,s.size()) ) cnt[i] = (cnt[i] + 1) % 1000000007; } } } long long int sol = 0; for(int i = 1; i <= m + 2; i++){ sol = max(sol, cnt[i]); } cout<<sol<<endl; } return 0; } |
| I got 89 for the example, not 90, why? | David Yin [ECUPL] | 1009. K-based Numbers | 19 Jun 2016 14:02 | 5 |
I got 89 for the example: 2 10, not 90, why? Any one know this? 9*10=90; 9 - count of possible first digits (zero not allowed); 10 - count of possible second digits. How did you get 89? it's because of pow-function pow(10,2)==99 U may: if ( result_of_pow % 9 == 0) result_of_pow++; Edited by author 25.02.2016 17:48 > pow(10,2)==99 It's really weird if some language's standard library doesn't work in so visible way. User mistake is much more likely. So what is language and "pow" function declaration? Probably you use any floating numbers pow, like "C++, double pow (double base, double exponent)". In this case I expect pow returns approx. 100 (99.999 for example) and then you convert double to int in wrong way. Edited by author 25.02.2016 20:35 I missed placed 2 as k and 10 as n, ar, that's stupid. |
| Can anynoe tell me what trap is there in test#2 | wtw | 2075. Take care of your eyebrows! | 18 Jun 2016 18:15 | 2 |
Pay attention to this: "Oleg stops drinking as soon as there is no cocktail on the current height. But in case barman pours the liqueur exactly at this moment Oleg continues drinking". So, for the test 3 1 a 30 20 Oleg 20 31 a 30 correct answer is: 20-30 a and not is 20-30 a 31-61 a This helped me to pass 2nd test. |
| If you get a WA for test#15 | Sandu Petrasco | 1297. Palindrome | 17 Jun 2016 15:51 | 3 |
Try abasajhdabba the answer should be 'abba' Mine is. I don't know why but I'm getting a TLE. My answer is 'abba'. But I still have a wrong answer in #12. |
| Same as the Coin Change Problem | Erik Arakelyan(AUA) | 1073. Square Country | 17 Jun 2016 15:08 | 1 |
#include <iostream> #include <cmath> using namespace std; int minCoins(int coins[], int m, int V) { int table[V+1];
table[0] = 0;
for (int i=1; i<=V; i++) table[i] = INT_MAX;
for (int i=1; i<=V; i++) { for (int j=0; j<m; j++) if (coins[j] <= i) { int subResult = table[i-coins[j]]; if (subResult != INT_MAX && subResult + 1 < table[i]) table[i] = subResult + 1; } } return table[V]; } int main() { int V; cin>>V; int coins[1000]; int i;
for(i=1;i<=sqrt(V);i++) { coins[i-1] = (i)*(i); } int m = sqrt(V); cout<< minCoins(coins, m, V)<<endl; return 0; } This problem can be translated to get the minimum amout of coins to get the value N.(We must just check that the coins are the actual square numbers). |
| Why do I get Runtime error C# | Jaideep Chandra | 1001. Reverse Root | 16 Jun 2016 21:01 | 2 |
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Problem_1001 { class Program { static void Main(string[] args) { ulong[] input = new ulong[4]; for (int i = 0; i < input.Length; i++) { input[i] = ulong.Parse(Console.ReadLine()); } for (int i = input.Length - 1; i >= 0; i--) {
Console.WriteLine(String.Format("{0:F4}",Math.Sqrt(input[i]))); } //Console.ReadLine(); } } } You think there are exactly 4 numbers in the input. Also you think there is 1 number per line. Please show task fragment describing input format as you think. Edited by author 16.06.2016 21:02 |
| No subject | __Andrewy__ | 1980. Road to Investor | 16 Jun 2016 19:51 | 1 |
Edited by author 26.08.2016 20:54 |
| 2 Admins: AC but.. | AIT | 1378. Artificial Intelligence | 15 Jun 2016 21:51 | 1 |
got AC but for the following rectangle ((12, 0), (100, 12), (88, 100), (0, 88)) - you can shift it in any position, my solution will choose 'circle' |
| Problem 1369 "Cockroach Race". Time limit decreased | Vladimir Yakovlev (USU) | 1369. Cockroach Race | 15 Jun 2016 07:37 | 18 |
The new time limit for the problem id 4 seconds. With old time limit 5 seconds bruteforce solutions could pass all tests. I think time limit should be decreased down to 1 second. It is not hardest problem otherwise. My AVX solution w/o custom input/output can pass all the tests too. http://acm.timus.ru/getsubmit.aspx/6871223.cppAnother way to make this problem interesting is to change N from 10000 to 100000. AVX? :) if solution requires manual vectorization to avoid TL - it is still hard problem, but trivial (double precision) arithmetic is enough here for now. Edited by author 08.06.2016 04:43 IMO time limit should be 2 (or 3) seconds - it breaks brute force, at least for now, but still allow(?) good java solutions (best - 1.7 seconds). Simple arithmetic gives TLE 9. BTW Fortune's algorithm also implies just only trivial arithmetic (i.e. +-*/), do you mean this? No, I mean absolutely straightforward O(N*M) algorithm, 20 lines of c/++ So, I reached 1.7 seconds It is not brute force now (since there are several non-trivial optimizations), but it is still O(N*M) algorithm... It should be 1.5-2X faster when AVX512 is available. AVX (256 bit, 4 dobule) is not faster then SSE (128 bit, 2 double) on the judging system, though. Because of bus width, I think. gcc msvc 1xD: TL9 3.260 2xD: 1.981 2.308 4xD: 1.575 1.482 Edited by author 10.06.2016 12:55 I really want to see your solution! Can we trade it for top3? Edited by author 10.06.2016 22:27 Just understand what is "top3" - thank you - no, I like problem solving :) Edited by author 11.06.2016 06:44 That means problem 1548. Anyways I will to solve this problem using Voronoi. But now I just especially interested in manual vectorization technique. And SSE/AVX/AVX512 solution is just a "reference point" for "right" solution via Fortune's algorithm. Yep, I understood. Please share your email. I don't think that my solution will help you, it is based on very specific optimizations. How to improve SSE solution in such a way, that it became 2.5x faster? Very interesting optimizations should be here. Edited by author 13.06.2016 01:39 New time limit is set to 2 sec. Thanks for reporting a problem. It seems that solutions of other problems may have benefit from new hardware too. Maybe it make sense to rejudge a couple of tens of hardest problems (at least 100-200 top solutions). |
| WA#3 | Justin Lil | 1340. Cucaracha | 14 Jun 2016 05:46 | 1 |
WA#3 Justin Lil 14 Jun 2016 05:46 Can anybody explain the problem of test 3? I'm getiing WA again and again :( Edited by author 22.06.2016 19:38 |
| C# Solution | german_goncharov | 1197. Lonesome Knight | 14 Jun 2016 00:06 | 1 |
using System; namespace CSharp_1197 { public class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); string str2 = ""; for (int i = 1; i <= n; i++) { string str1 = Console.ReadLine(); if (str1 == "a1" || str1 == "h1" || str1 == "a8" || str1 == "h8") str2 = str2 + 2 + " "; else if(str1 == "b1" || str1 == "g1" || str1 == "b8" || str1 == "g8" || str1 == "a2" || str1 == "h2" || str1 == "a7" || str1 == "h7") str2 = str2 + 3 + " "; else if(str1 == "b2" || str1 == "g2" || str1 == "b7" || str1 == "g7" || str1 == "a3" || str1 == "h3" || str1 == "a6" || str1 == "h6" || str1 == "c1" || str1 == "f1" || str1 == "d1" || str1 == "e1" || str1 == "c8" || str1 == "f8" || str1 == "d8" || str1 == "e8" || str1 == "a4" || str1 == "h4" || str1 == "a5" || str1 == "h5") str2 = str2 + 4 + " "; else if (str1 == "b3" || str1 == "g3" || str1 == "b6" || str1 == "g6" || str1 == "c2" || str1 == "f2" || str1 == "d2" || str1 == "e2" || str1 == "c7" || str1 == "f7" || str1 == "d7" || str1 == "e7" || str1 == "b4" || str1 == "g4" || str1 == "b5" || str1 == "g5") str2 = str2 + 6 + " "; else str2 = str2 + 8 + " "; } Console.WriteLine(str2); } } } |
| Где логика? Как может быть вес корзины равнятся нулю. Все имеет вес... | IlushaMax | 2001. Mathematicians and Berries | 13 Jun 2016 21:59 | 2 |
См. пример. Лично меня это сбило Edited by author 07.03.2016 21:36 Не обращай внимания и все |
| solutions of problems ? | shweta | | 13 Jun 2016 16:04 | 3 |
what can i do if i struck on a problem,becoz there are no solutions n hints availabe here :( 1. Lay down. 2. Cry of despair. 3. Try to think of a more effecient solution or learn some new algos. 4. Use google and sometimes you can find hints for your task or even some solutions shared around the net. Good luck! hahaha..thanks but google does not help all the time :( |
| Take care of your Binary Search !!!!!!! | blablabla | 1133. Fibonacci Sequence | 13 Jun 2016 14:12 | 2 |
for(int m=i+2;m<=j;m++) if((m-i)%2==1) { t2+=t1; if(t2<-8000000000LL||(t2>8000000000LL))//Look at this line. break; } else { t1+=t2; if(t1<-8000000000LL||(t1>8000000000LL))//Look at this line. break; } ---- Sorry for my bad English You can also do equation system (IDK if it's the correct name). You can make two equations, with two incognitas. It can be solved because you have the same amount of equations and incognitas. Be careful, it's easier with java big integer rather than C++ long long or long double. |