| Show all threads Hide all threads Show all messages Hide all messages |
| Has anyone solve this by dynamic programming? | phizaz | 1005. Stone Pile | 12 Dec 2011 22:50 | 3 |
please tell me how do you? I found one algo but it uses memory equal to W<sub>i</sub> limitation. if maximum of W<sub>i</sub> is 100000 it uses 100000 too. Maybe it use 2 times more. Edited by author 05.04.2011 22:59 Hey, did you solve it with DP ? Please let me know how did you solve it ? Thanks |
| WA 21 | ONU_Latysh | 1601. AntiCAPS | 12 Dec 2011 22:26 | 2 |
WA 21 ONU_Latysh 12 Dec 2011 21:32 Any sugestions!? My programme passed 20 tests, so I'm surprised and don't know what to do I want to tell you guys that you need to mind this: -HI - HI the answer is: -Hi - Hi So you need to leave the capital letter in the begining of the line after '-' (ASCII is 45) |
| why test 10? | Pop Ioachim | 1545. Hieroglyphs | 12 Dec 2011 14:51 | 1 |
|
| To ALL: Unfair for Pascal programmers to compete with C++/C | DR. Zhihua Lai | | 12 Dec 2011 02:26 | 3 |
I spent two days on tweaking my code for Problem 1532 First I wrote the solution in Pascal, which solves at 0.687 sec. And I rewrite the same algo in C++/C, it gives 0.32 sec http://acm.timus.ru/status.aspx?author=46914&status=accepted So I guess the Free Pascal does not turn on {$Optimization 2}, Please, Admins, could you kindly check? and if I use "goto" in FreePascal, I will get a "Compiler (Fail)" How do I enable "goto"? I tried "{$GOTO ON}" but it does not work... anyway.. finally, my ranking for Problem 1532 has reached the second... I am happy... http://acm.timus.ru/rating.aspx?space=1&num=1532 Edited by author 11.12.2011 20:58Why do you think the same algo in C/C++ and Pascal should produce similar result in terms of time? Even if all optimizations would be enabled that doesn't mean these compilers optimizers are equally smart. If you are concerned about such imbalance just install exactly the same compilers as online judge uses, compile your programs with exactly the same options and compare assembler listings of both programs. And only if you prove the sensible difference between {$Optimization 2} and current pascal switches you may say "Unfair for Pascal programmers to compete with C++/C". I met opposite situation in 1001: the same algo gives 0.046 in pascal and 0.14 in C++. What really makes me mad is that this C++ solution required only 0.062 in 2007 :-O > if I use "goto" in FreePascal, I will get a "Compiler (Fail)" How do I enable "goto"? > I tried "{$GOTO ON}" but it does not work... You may email admins and ask them add this info into FAQ. Thanks... I will look into this... |
| Это норм? | RuslanRussel | | 11 Dec 2011 22:27 | 1 |
|
| WA #8 | Vinod Shunmugavel | 1079. Maximum | 11 Dec 2011 18:51 | 1 |
WA #8 Vinod Shunmugavel 11 Dec 2011 18:51 Can somebody help me.. Whats the 8th test case?? |
| Help me WA 9 | spark-roman | 1586. Threeprime Numbers | 11 Dec 2011 16:50 | 2 |
You probably didnt MOD correctly. I got wa in case 9 for this |
| Accepted | Habib [ Tashkent U of IT ] | 1044. Lucky Tickets. Easy! | 11 Dec 2011 16:06 | 5 |
Accepted Habib [ Tashkent U of IT ] 13 Oct 2011 19:56 #include <stdio.h>
int main() { int N; scanf("%d", &N); switch(N) { case 2: printf("10\n"); return 0; case 4: printf("670\n"); return 0; case 6: printf("55252\n"); return 0; case 8: printf("4816030\n"); return 0; default: return 0; } return 0; } Delete your code Habib!!!! its too easy, the problem is how generate all combinations possibles, can you tell me!!!!!!... |
| Read this lessons | DixonD (Lviv NU) | 1465. Pawn Game | 11 Dec 2011 13:04 | 5 |
Thank you very much! Finally I got AC. I've calculating the nim-sequence for this game about 3 hours)))) Thank you! Very useful articles. thank you sincerely!!!!!!!!!!!!!!!!! wonderful artical!!!!!!!!!!!!!! great ideas!!!!!!!!!!!!!!!!!!!!!!1 Edited by author 13.12.2011 17:50 |
| Why this problem is classified as Data Structure? | ahyangyi(newer id) | 1628. White Streaks | 11 Dec 2011 10:44 | 3 |
I feel this is somewhat misleading as Data Structure isn't necessary for this problem. Agree. Solves with sort only. Sorting is good, yes. But it can be solved with data stuctures too. I used map<int,set<int> > and it gave slow AC (0.75 sec). |
| Why WA? | Figznaetlto | 1820. Ural Steaks | 11 Dec 2011 05:24 | 1 |
Why WA? Figznaetlto 11 Dec 2011 05:24 Edited by author 11.12.2011 07:01 Edited by author 11.12.2011 07:02 |
| tests | Childofbodom | 1433. Diamonds | 10 Dec 2011 20:13 | 2 |
tests Childofbodom 23 Jul 2009 03:51 please,somebody! take me tests!!! wa on 1st test :/ but work on all my tests GRBY YGBR equal BBGY GYBB equal YGBR GBRY different BYRG GYRB different |
| What's this mean... | Sunnat | 1353. Milliard Vasya's Function | 10 Dec 2011 19:19 | 1 |
mem[1][9] <=> 1=>>10 mem[20][9] <=> 20=>>299 or 29 ? |
| will any body help me? I am OLE | mahbubul | 1164. Fillword | 10 Dec 2011 12:05 | 2 |
I am Output Limit Exceed. my source is in C++. Here this is: #include<iostream.h> #include<string.h> main() { int len,temp,i; int n,m,j,p; char ch[12][12],word[15]; char letter; long int array[30]; for(i=0;i<27;i++) array[i]=0; cin>>n>>m>>p; for(i=1;i<=n;i++) cin>>ch[i]; for(i=1;i<=p;i++){ cin>>word; len=strlen(word); for(int k=0;k<len;k++){ temp=word[k]; array[temp-64]--; }} for(i=1;i<=n;i++) for(j=0;j<m;j++){ temp=ch[i][j]; array[temp-64]++; } for(i=1;i<27;i++){ temp=array[i]; letter=i+64; while(temp!=0){ cout<<letter; temp--; }} cout<<endl; return 0; } make temp!=0 - temp > 0; and some other changes, but it gets WA11 Edited by author 10.12.2011 12:10 |
| To Admin: I got "Fail (compiler)" | DR. Zhihua Lai | | 10 Dec 2011 05:22 | 1 |
Hi Admin, I got "Fail (compiler)" message if I use "goto" statement in Pascal... but it compiles fine on my machine.. Why? can I not use "goto" ? Thanks... |
| what is the algorithm :? | 59838AD | 1656. Far Away Kingdom's Army | 10 Dec 2011 04:47 | 6 |
the algorithm consist of transposition the most high soldier to the centre of the line and to the centre of the column. in cycle from 1 to n gives bubble sorting. Please can you explain how to do bubble sort in 2-d array here? I constructed such an algorithm. It requires the soldiers to be sorted by their height downwards. When the soldiers are sorted, take them one by one and fill the square diamond by diamond, starting from center. A "diamond" contains those cells (x,y) for which |x - x_center| + |y - y_center| == C, C ranges [0; n-1]. Edited by author 11.03.2009 08:54 There is a much simpler method, which also uses less memory. Hint: try a O(n) sort. Also try not to store n*n elements in memory (print line by line instead). |
| what is perfix | shahmohammadi | 1842. Local Roots | 10 Dec 2011 02:40 | 2 |
if in a case p is abcde, is ab a prefix of p? or ab is prifix of cde? in other word is prefix and suffix of a word a part of that or placed in out of it? thank you. thanks. now i know what problem want. and i know when we say A is Prefix/suffix of B,=> B includes A. |
| No subject | Nigora | 1385. Interesting Number | 9 Dec 2011 22:12 | 1 |
|
| No subject | Toshev Qulmurod | 1069. Prufer Code | 9 Dec 2011 21:15 | 1 |
|
| 1334 | davlatov jaloliddin | 1506. Columns of Numbers | 9 Dec 2011 19:53 | 1 |
1334 davlatov jaloliddin 9 Dec 2011 19:53 |