| Show all threads Hide all threads Show all messages Hide all messages |
| About The Testdata | SuperScz | 1546. Japanese Sorting | 14 Jul 2008 20:33 | 3 |
is there any blank lines in an input file? No. At least my AC solution would ignore them. |
| 5 | mahbubul | 1546. Japanese Sorting | 14 Jul 2008 20:33 | 2 |
5 mahbubul 21 Apr 2007 15:15 Is there any such pic name: "aa" or like "aa10bv10" ? Re: 5 Denis Koshman 14 Jul 2008 20:33 |
| Test | Roman | 1546. Japanese Sorting | 14 Jul 2008 20:33 | 3 |
Test Roman 21 Apr 2007 18:01 a a0 a00 => a a00 a0 Why a00 is lower than a0? In lexicographic order a0 is lower... Maybe the Black Box is incorrect?.. Edited by author 21.04.2007 18:35 Re: Test Denis Koshman 14 Jul 2008 20:33 That's part of rules inside blackbox |
| Compilation error.Why? | Raphael1105 | 1002. Phone Numbers | 14 Jul 2008 20:32 | 2 |
I run the program in my computer.The answer is correct.But after I submit,it say my error is 'Compilation error'. Who can tell me the reason?Thanks a lot! What language? If you using string class in C++ you must include some additional libraries( i include <string> and <cstring> ) |
| It seems that the sorting rule is the same as the rule windows XP used to sort files... | fOrgIvE | 1546. Japanese Sorting | 14 Jul 2008 20:32 | 9 |
What rules are used in sorting zeroes? Can anyone describe? It`s very interesting question. Why "a00"<"a0"? first treat all 000000 as 0 and all 00000003 as 3 compare the whole string if equals, treat 000000 < 000 and 00000003 < 003 compare the whole string again... 0000aa < 000aa < 0000ab < 000ab Our program correctly process tests like that, but we have WA2. Zeroes matters only if strings w/o them are equal. Longer leading zero sequence makes numerical sequence LESS. |
| The Solution to this misleading, ill-stated problem. Simpler to code than to explain. | Anisimov Dmitry | 1546. Japanese Sorting | 14 Jul 2008 20:31 | 4 |
[code deleted] Edited by moderator 09.05.2007 16:03 Can you explain me some part of your program? Becauze, I'm Pascal programer and a new one in C++. Why do you put '*' so often? What does it mean? What does "(void*)" and "*(char**)" mean? Thanks. These are typecasts required for C-style writing in C++. And * is the derefence operator (almost same as ^ in Pascal) Actually, it's easy to explain =) |
| Can be such test? | Taran_Alex | 1546. Japanese Sorting | 14 Jul 2008 20:30 | 3 |
photo01a45b photo2a46b photo02a5b how to sot that? or it cannot be such tests? my output is: photo01a45b photo02a5b photo2a46b See blackbox app to see how to sort that... And yes, such a test can be |
| What's wrong with my algo? | inkognito | 1546. Japanese Sorting | 14 Jul 2008 20:29 | 2 |
#include <iostream> #include <string> #include <algorithm> #include <vector> using namespace std; bool lesslength(const string& s1, const string& s2) { return s1.length()<s2.length(); } int main() { string s; vector<string>a; while((cin>>s))
{
a.push_back(s);
} stable_sort(a.begin(),a.end(),lesslength); vector<string>::iterator pos; for ( pos = a.begin(); pos != a.end(); ++pos) { cout<<*pos<<endl; } return 0; } I've WA 2. It's not just about length |
| Does everybody know "english"? | PigTree | 1571. Interpreters | 14 Jul 2008 19:43 | 14 |
Is the 1st test is a sample one? Can i use any laguage? Than why i got WA then using "MyLanguage"? Algo does the order of printed language is important? russian-english english-german english-french is the same as english-russian english-german english-french or no? It is a mistake in sample output must be russian-french russian-german french-german Good test, but now WA6... :( Really, i do not understand why we cant use some intermidiate language what is known only by translators in order to ahieve minimum? Problem's definition must be corrected. We can use any intermediate languages. More exactly - we must use it. Otherwise, you won't pass all the tests. 1. There is language "english" in 15-th test, so if you always will use "english" - you'll get WA 2. You can use your own languages, but they should correspond to restrictions on length and case Edited by author 06.10.2007 23:05 Good test, but now WA6... :( Really, i do not understand why we cant use some intermidiate language what is known only by translators in order to ahieve minimum? Problem's definition must be corrected. I also don't understand at all why solution, which out for test 4 a b c d 4 a-b b-c c-d a-d is incorrect In your situation, when crews "a" and "c" want to speak each other, they have to use two interpreters: "a-b" and "a-c" (or, may be, "a-d" and "c-d" - it does not matter). But in this case, crew "b" can understand their talk, because language "b" is used in it! You should always add a language, except special cases with n <= 2. Edited by author 07.10.2007 21:47 There are at least 3 cases when N>2 |
| If n=2 | 2rf | 1571. Interpreters | 14 Jul 2008 19:41 | 2 |
Is it true, that if n=2 we need only one translator who know both languages from the input and it doesn't matter these languages are equal or not? And what is the answer for this test: 2 rus rus ? Edited by author 13.10.2007 17:56 |
| Is concatenation (a0) describe empty set of words?(-) | diver_ru (Fishburg SAAT) | 1559. TruCoders Linguistics | 14 Jul 2008 18:48 | 7 |
I think, it describes word a Re diver_ru (Fishburg SAAT) 23 Sep 2007 15:37 but you have wa... I think that if for "abc" power of set will be (1 * 1 * 1) = 1, for "ab(c|d)" power will be (1 * 1 * 2) = 2, than for (a0) power of set will be 1 * 0 = 0 Re: Re Vedernikoff Sergey 23 Sep 2007 16:31 But why power of the empty set is equal to 0? I think, it is equal to 1... Some hints: 1) power of set (a0) is 0 2) By statement, "it means (if there is '*') <symbol>0|<symbol>1|…|<symbol>n|… (arbitrarily many times) where <symbol>i means <symbol><symbol>…<symbol> (i times) and <symbol>0 means the set consisting of one empty word ", so power of set (0)* is 1, and set (a)* is inifnite Edited by author 23.09.2007 17:00 0 does not mean the set consisting of one empty word, but rather it means an empty set of words. Still, there is a way to obtain a set consisting of one empty word. Edited by author 14.07.2008 18:49 Edited by author 14.07.2008 18:49 |
| What answer? :) | pperm | 1559. TruCoders Linguistics | 14 Jul 2008 18:28 | 4 |
Some test: a0a* F (a0*a)* N 0* F (0*)* N The last one is F, not N. Edited by author 14.07.2008 18:45 |
| EOLN in C++ | AlMag | 1102. Strange Dialog | 14 Jul 2008 16:06 | 3 |
In Pascal the End of Line looks like EOLN. I can write While not Eoln() Begin ... End; How to make it work in C++? I want to do smthng like scanf("%d",&n); for(; n>0; --n) { while ((c=getc(stdin))!=EOLN) { line[sz]=c; sz++; } ... } you should use EOF || '\n' thus you would stop your execution if the line ends or the file ends. It is up to you then to process the to results as they should be. I used while ((c = getc (stdin)) != '\n' && c > 0) |
| are there inaccuracy conditions?.. | kavolorn | 1606. Slalom | 14 Jul 2008 13:52 | 3 |
I think there is inaccuracy in conditions. I answer the first example 2 5 1 3. Why is not it correct? Edited by author 02.03.2008 12:04 2 5 1 3 - is it correct. Edited by author 14.07.2008 22:50 |
| C# locale | penartur | | 14 Jul 2008 03:18 | 1 |
Looks like russian locale is used on a test server: the following code [code] String[] numbers = Console.ReadLine().Split(); float n1 = float.Parse(numbers[0]);[/code] crashes and you need to replace the second line with: [code] float n1 = float.Parse(numbers[0].Replace('.', ',')); [/code] |
| Which operation is A + B?.. | Enots: Revolution | 1530. Ones and Zeroes | 14 Jul 2008 01:52 | 4 |
Is it: 1) A OR B (element-wise OR) 2) A + B (where A, B are numbers) ?.. (A + B) mod (2^n) ? i.e. string with length n? A+B as numbers, and defined only for non-overflowing addition of same-length sequences Edited by author 14.07.2008 01:52 |
| A hint ? | Yosif Yosifov | 1530. Ones and Zeroes | 14 Jul 2008 01:47 | 9 |
A hint ? Yosif Yosifov 20 Feb 2007 01:33 Can someone give me a little hint, please ? make 2 sequences (s1 and s2) such that s1[i]+s2[i]<>2 My solution is based on a greedy approach. I think that an algorithm has many special cases. Main rool:to correct firstly s2[i] from 1 to 0 in pair s1[i]=1 and s2[i]=1 diminishing B but have pair 0, 0 in older position correcting it to 0, 1 for final increasing lexiographicly of B Who can find all cases he solve the problem After getting AC i have counted 6 cases next tests correspong each of cases 4 1011 0011 1011 0100 4 1010 0111 1011 0000 4 1011 0110 1100 0000 4 1111 0101 0000 0000 4 1010 0101 1011 0000 4 1011 0100 1100 0000 Edited by author 21.02.2007 13:58 My program successfully passed all of your test cases, but I still WA3... What can it be??? You are need in additional tests Best if you will create them yourself I have only 3 cases 1) attempt to build a >b 2) attempt to build a+1 0 3) build 0 0 |
| help WA 17 | Giorgi Saghinadze (Tbilisi SU) | 1530. Ones and Zeroes | 14 Jul 2008 01:43 | 3 |
help WA 17 Giorgi Saghinadze (Tbilisi SU) 30 Aug 2007 16:41 I think my algo is correct but I still have WA 17. I saw that some people had TLE 17, can anybody tell my what kind of test is it? got AC :) I had very stupid mistake Those TLEs are probably attempts to find test internals because the problem is linear. |
| what mean "lexicographically first compatible pair" ? | dibrov.bor[SumySU] | 1530. Ones and Zeroes | 14 Jul 2008 01:40 | 3 |
I try to output zeros in this case, but seems like I'm wrong please show me some example for example for this case 2 11 11 Edited by author 11.12.2007 21:50 This test is correct, and the answer should be 00 00 |
| How to solve this problem,plz give some hints............. | tob | 1527. Bad Roads | 13 Jul 2008 23:46 | 2 |
Create splices over the cost, make binary search on height by checking ability to meet the time requirement |