| Show all threads Hide all threads Show all messages Hide all messages |
| C/C++ Compiler Upgraded to Visual C++ 2010 | Vladimir Yakovlev (USU) | | 5 Aug 2010 01:01 | 5 |
If you encounter any problems please describe it in this thread. Thanks a lot! Waiting for C# upgrade! PS and dont forget to import(add reference) System.Numerics :) Can you please describe the most significant changes in this compiler compared to previous one? well.. I'm very glad to find that an additon "system("pause")" in the last line won't lead to WA still. (Otherwise we may encounter lots of WAs if there's rejudge...) However, I noticed that there's a slight difference in the memory usage indicator. A+B Problem, for instance, previously they're 121KB for both C/C++. They are actually 104/188KB now. It's not a very critical problem after all :) I'm just a bit afraid that we may have to change a little bit of our "code style" to fit with the new compiler... Then go for it~ Bytewise reading now works slower than scanf. Thats the first thing I've noticed. |
| some help if you have Crash 4 | Andrew Hoffmann aka SKYDOS [Vladimir SU] | 1002. Phone Numbers | 4 Aug 2010 14:06 | 1 |
1) I used Dictionary<,> and had crash 4, 'cause there were equal words. 2) For example you have two(three) words like: akt blu ckv *they all have code 258, so you can take any of these words. These two "bugs" after fixing gave me AC with 0.14 time and ~9MB on C#. Good Luck. Edited by author 04.08.2010 14:08 |
| AC with interval tree but how to do it using segment tree? | muhammad | 1019. Line Painting | 4 Aug 2010 05:17 | 2 |
I got AC with interval tree. but it's so painful coding it. How to do it with segment tree? The range is too large... please help. thanks in advance to make it "discrete", is that the right word? i mean, we only care the points mentioned in the input. Edited by author 04.08.2010 05:18 |
| Can anyone help me shortening this problem statement ? | ConanKudo | 1721. Two Sides of the Same Coin | 3 Aug 2010 23:15 | 2 |
Can anyone tell me what does the problem say in short ? This problem is too long to read...-.-" Just read only two last paragraphs of statement. |
| What idea in solution? | Kirin Vladislav | 1222. Chernobyl’ Eagles | 3 Aug 2010 17:38 | 9 |
I thought that we must do with heads (n) next: 2*2*2*...*(n div 2) ---> for odd(n)=false and 2*2*2*...*3*((n-3) div 2)---> for odd(n)=true. What why answer for n=: 5-->2*3=6 6-->2*2*2=8 7-->2*2*3=12 8-->2*2*2*2=16 9-->2*2*2*3=24 but when I write solution, a saw that ans for 6=3*3=9(not an 8), for 9=3*3*3=27(not a 24). COULD YOU HELP ME WITH RIGHT IDEA? Edited by author 29.05.2006 18:25 The last number must be 3,and others must be 2.So you have to judge whether n is an odd number or an even number first.This step is very important.And the n must be: n=2+2+2...+3(if n was an even number,there is no 3.) if n mod 3=0 then ansver is 3 in pover (n div 3); in other cases answer is 2*2*2*...*3 if n mod 3=0 then ansver is 3 in pover (n div 3); in other cases answer is 2*2*2*...*3 3*3 > 2*2*2, so your assumption is wrong. The answer is 2*3*3*...*3, when n is even and 3*3*...*3 otherwise. for 8-->3*3*2=18(not a 16) Edited by author 03.08.2010 17:40 Answer is a simple multiplication: 3*3*...*3. If n % 3 == 2, then it ends with ...*2*2. It's somehow linked with E, but how? If n could be divided on rational numbers, then the max product will be always (n/k)^k, where k is integer, such that abs(n/k - E) is minimal possible value. It is a well-known theorem. |
| WA5 | kamsiroy | 1016. Cube on the Walk | 3 Aug 2010 15:17 | 1 |
WA5 kamsiroy 3 Aug 2010 15:17 does anyone know what's the Test 5 ? Or can sent some tests. Thx |
| If you are stuck | void | 1378. Artificial Intelligence | 3 Aug 2010 03:14 | 1 |
Try to find minimal and maximal distance between figure's center and border, and think about possible shapes. |
| What's the test 5? | uuu | 1097. Square Country 2 | 1 Aug 2010 15:08 | 1 |
Who can give me the test 5?I get WA5!Thanks! |
| Wa Test #3 help Me | Quyon | 1085. Meeting | 1 Aug 2010 05:15 | 2 |
Try test 4 2 2 1 2 2 2 3 2 0 3 1 0 2 1 answer 1 0 |
| if WA9 | yuanyuan | 1060. Flip Game | 31 Jul 2010 19:45 | 2 |
if WA9 yuanyuan 7 May 2009 11:48 if WA9, try to check wwww wwww wwwb wwbb ans=1 My solution: program p1060; type frr=array[0..5,0..5] of boolean; var f:frr; ans:byte; procedure init; var i,j:byte; ch:char; begin fillchar(f,sizeof(f),true); for i:=1 to 4 do begin for j:=1 to 4 do begin read(ch); if ch='b' then f[i,j]:=false; end; readln; end; end; function check(f:frr):boolean; var b:boolean; i,j:byte; begin b:=f[1,1]; for i:=1 to 4 do for j:=1 to 4 do if f[i,j]<>b then exit(false); exit(true); end; function min(a,b:byte):byte; begin if a<b then exit(a) else exit(b); end; procedure find(f:frr;x,y,t:byte); begin if check(f) then begin ans:=min(ans,t); exit; end; if x>4 then exit; if y=4 then find(f,x+1,1,t) else find(f,x,y+1,t); f[x,y]:=not(f[x,y]); f[x-1,y]:=not(f[x-1,y]); f[x+1,y]:=not(f[x+1,y]); f[x,y-1]:=not(f[x,y-1]); f[x,y+1]:=not(f[x,y+1]); if y=4 then find(f,x+1,1,t+1) else find(f,x,y+1,t+1); end; procedure outit; begin if ans=17 then writeln('Impossible') else writeln(ans); end; begin init; ans:=17; find(f,1,1,0); outit; end. Edited by author 07.05.2009 11:48 Edited by author 07.05.2009 11:49 Yeah !! Thank you very much; I had tried many times. |
| TLE#12. Algo Kruscal doesn't work! Help :( | Alexey | 1416. Confidential | 31 Jul 2010 19:29 | 2 |
Please, tell me what kind of mistake can I have? I see that there are a lot of persons who has problems with Test#12. Is there smth speciale? Thanks. Edited by author 14.05.2006 15:27 I also have TLE 12 and write Kruskal and his advanced version with DSU. It doesn't meter. But when at finding secondcost i stoped finding, if secondcost became equal to firstcost i got AC at Java with 0.2 sec with complexity o(n^3) at worst case :-) Edited by author 31.07.2010 19:32 |
| Nice problem! | Andrew Hoffmann aka SKYDOS [Vladimir SU] | 1497. Cutting a Square | 31 Jul 2010 19:24 | 1 |
Nice problem! Andrew Hoffmann aka SKYDOS [Vladimir SU] 31 Jul 2010 19:24 Try these tests: (1) - No 10001 11001 10011 11111 11111 (2) - Yes 100001 110001 111001 111011 111111 111111 (3) - Yes 111111 111010 111010 111010 111010 000000 Good luck! Edited by author 31.07.2010 19:34 |
| IMHO, good test for convex hull solutions | Alexander Samal | 1246. Tethered Dog | 31 Jul 2010 19:03 | 1 |
9 0 0 1 0 1 1 2 2 3 1 3 0 4 0 4 3 0 3 answer: ccw Edited by author 31.07.2010 19:05 |
| How to solve it? | Fdg | 1772. Ski-Trails for Robots | 31 Jul 2010 14:43 | 3 |
DP + sqrt-decomposition (or tree-like structure) I think that Djkstra in graph of robot's ends will work. |
| To admins! Bug with C# compiler. | OpenGL | | 31 Jul 2010 03:38 | 2 |
My submit #3115142 get CE. And report on this submit contains strange symbols. Edited by author 31.07.2010 01:15 Fixed Vladimir Yakovlev (USU) 31 Jul 2010 03:38 |
| At last I solved it! | bsu.mmf.team | 1763. Expert Flea | 30 Jul 2010 20:30 | 1 |
It was really difficult for me, although I read one very good article and understood the idea of the solution. And I don't know how to solve it without any precalculations. I did a lot of them. Does there exists another solution, without using a big recurrence formula? You can read about this problem here: http://www.cse.ust.hk/tcsc/RR/2004-02.ps.gz |
| I am sure that my algo is right,but WA#4 | nargiT | 1075. Thread in a Space | 30 Jul 2010 20:19 | 1 |
// 1075.cpp : Defines the entry point for the console application. // #include <iostream> #include <cmath> #include <algorithm> #include <iomanip> #include <stdio.h> using namespace std; struct point{ int x; int y; int z; void in(point *); double dist(point *,point *); }Tigran; void point::in(point *a){ cin>>a->x; cin>>a->y; cin>>a->z; } double point::dist(point *a, point *b){ double res_x,res_y,res_z; double total_res; res_x=((a->x)-(b->x))*((a->x)-(b->x)); res_y=((a->y)-(b->y))*((a->y)-(b->y)); res_z=((a->z)-(b->z))*((a->z)-(b->z)); total_res=sqrt(res_x+res_y+res_z); return (total_res); } int main(){ double answer; point a,b,c; double t; double d; double x,y,z; int R; Tigran.in(&a); Tigran.in(&b); Tigran.in(&c); cin>>R; x=Tigran.dist(&a,&c); y=Tigran.dist(&b,&c); z=Tigran.dist(&a,&b); if((x*x+z*z<=y*y) && (y*y+z*z<=x*x)){ answer=z; } else { t=acos((x*x+y*y-z*z)/(2*x*y)); d=(x*y*sin(t))/z; if(d>=(double)R){ answer=z; } else { answer=sqrt(x*x-R*R)+sqrt(y*y-R*R)+R*(t-acos(R/x)-acos(R/y)); } } printf("%0.2f",answer); return (0); } |
| "Задач послано" и "Задач решено" | Andrew Hoffmann aka SKYDOS [Vladimir SU] | | 30 Jul 2010 19:41 | 3 |
Задач послано 120 Задач решено 111 Задач решено - ясно как подсчитывается, а вот как считается "Задач послано", как-то понять не могу. Возможно ли при "задач послано">"задач решено" уравнять эти значения, если да, то как? Thanks! Solved - number of solved problems (Привет КЭП :) ) Submitted - number of problem, which you tried to solve (may be, unsuccessful). Submitted - number of problem, which you tried to solve (may be, unsuccessful). Got it! Thanks ;) |
| What is the answer for n = 10? | DK [Samara SAU] | 1763. Expert Flea | 30 Jul 2010 17:51 | 6 |
And what is the answer for n = 20. Is it 19044? Simple backtrack can easily yield the answers up to 30 (and more). However, this didn't help me much. Here there are if it will help you with something. Answer for n = 6 is 12 Answer for n = 7 is 46 Answer for n = 8 is 144 Answer for n = 9 is 110 Answer for n = 10 is 312 Answer for n = 11 is 290 Answer for n = 12 is 670 Answer for n = 13 is 706 Answer for n = 14 is 1538 Answer for n = 15 is 1732 Answer for n = 16 is 3504 Answer for n = 17 is 4288 Answer for n = 18 is 8098 Answer for n = 19 is 10568 Answer for n = 20 is 19044 Answer for n = 21 is 26042 Answer for n = 22 is 45222 Answer for n = 23 is 64220 Answer for n = 24 is 108382 Answer for n = 25 is 158324 Answer for n = 26 is 261754 Answer for n = 27 is 390314 Answer for n = 28 is 635666 Answer for n = 29 is 962282 Answer for n = 30 is 1550244 Answer for n = 31 is 2372372 Answer for n = 32 is 3792560 Thank you! These answers helped me a lot. |
| how read data? | tttwet | 1612. Tram Forum | 30 Jul 2010 13:17 | 2 |
hi guys how i must read string, using c# i mean read the WHOLE string, not just trim before '\n' sry for my language while((line=Console.ReadLine())!=null){ //..code here } |