Search found 15 matches

by armansuleimenov
Fri Oct 23, 2009 7:00 am
Forum: Volume 101 (10100-10199)
Topic: 10136 - Chocolate Chip Cookies
Replies: 6
Views: 4116

Re: 10136 - Chocolate Chip Cookies

My algorithm is the following: 1) Consider all pairs of points, for each pair of points (A, B): if they are at <=5 cm distance from each other, then find the centers of two possible circles with points A and B on the circumference, count how many of the points given are inside these circles 2) Draw ...
by armansuleimenov
Sun Oct 05, 2008 12:55 am
Forum: Volume 115 (11500-11599)
Topic: 11519 - Logo 2
Replies: 6
Views: 2605

11519 - Logo 2

Our team submitted this problem 5 times during the contest, and got WA each time. The idea behind our approach is the following: if the missing number is in the command "lt" or "rt", just brute-force over all possible degrees [0,359] and return the degree with which we come back to point (0,0). If t...
by armansuleimenov
Sat Oct 04, 2008 7:12 pm
Forum: General
Topic: Waterloo ACM Programming Contest Fall 2
Replies: 0
Views: 2257

Waterloo ACM Programming Contest Fall 2

Waterloo ACM Programming Contest Fall 2: please put new problems for this contest, not the ones that were last week!
by armansuleimenov
Mon Sep 01, 2008 11:54 pm
Forum: ACM ICPC Archive Board
Topic: 4094 - WonderTeam
Replies: 1
Views: 4339

4094 - WonderTeam

I have been trying to solve this problem http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=4094 from "Asia - Tehran - 2007/2008" since early morning. I think greedy should work. According to my observations, the wonderteam should have 0 draws not to increase its points count. Hence, ...
by armansuleimenov
Sun Dec 30, 2007 7:43 am
Forum: Volume 113 (11300-11399)
Topic: 11371 - Number Theory for Newbies
Replies: 65
Views: 22393

How can I optimize my solution to run in <=1 sec? Here is my code: #define For(i,b) for(int i = 0; i < (int)b; ++i) #define All(t) t.begin(),t.end() string itos (int i) {stringstream s; s << i; return s.str();} int stoi (string s) {istringstream in(s); int ret; in >> ret; return ret;} string itos (i...
by armansuleimenov
Sat Nov 24, 2007 4:10 pm
Forum: Volume 113 (11300-11399)
Topic: 11353 - A Different Kind of Sorting
Replies: 17
Views: 7506

11353 - A Different Kind of Sorting

Here is the problem: http://icpcres.ecs.baylor.edu/onlinejudge/contests/190-53d26a44/11353.html I got TLE twice. But I don't see how I can optimize my solution. Could you please help me with this. Here is my code (w/o includes and other formal things): #define Fori(i,a,b) for(int i = a; i < (int)b; ...
by armansuleimenov
Wed Nov 14, 2007 5:08 am
Forum: Volume 113 (11300-11399)
Topic: 11349 - Symmetric Matrix
Replies: 43
Views: 19017

Oh, I see: [-2^32 ... 2^32] doesn't fit signed 32-bit integer ([-2^32...2^31-1]), I overlooked that. However I still get WA.

I changed this

Code: Select all

int m[110][110]; 
to this

Code: Select all

long long m[110][110]; 
That is the only I change I need to do to use 64-bit integers.
by armansuleimenov
Tue Nov 13, 2007 9:49 pm
Forum: Volume 113 (11300-11399)
Topic: 11349 - Symmetric Matrix
Replies: 43
Views: 19017

What is wrong with this code, I got WA?

Code: Select all

thanx, luishhh and sclo! got AC
Please give sample input with the correct output that make my program fail.
by armansuleimenov
Tue Nov 13, 2007 7:17 am
Forum: Volume 113 (11300-11399)
Topic: 11342 - Three-square
Replies: 14
Views: 6554

11342 - Three-square

this is my function that given k returns the vector that contains a,b,c such that a*a+b*b+c*c = k, however it's too slow (TLE), what optimization will speed it up?

Code: Select all

got AC
by armansuleimenov
Tue Nov 13, 2007 6:56 am
Forum: Volume 113 (11300-11399)
Topic: 11341 - Term Strategy
Replies: 20
Views: 7708

I don't think I completely understand what I am asked in this problem. Could someone explain me?
by armansuleimenov
Mon Nov 12, 2007 5:41 am
Forum: Volume 113 (11300-11399)
Topic: 11340 - Newspaper
Replies: 154
Views: 42963

should I use 64-bit integer to store the value of cents?
by armansuleimenov
Mon Nov 12, 2007 5:39 am
Forum: Volume 113 (11300-11399)
Topic: 11340 - Newspaper
Replies: 154
Views: 42963

so each element of string is char (not unsigned char) and you must handle this.
What input routine should I use then?

I can't use the code below since the character can be whitespace (' '):

Code: Select all

ll cost;
unsigned char ch;
cin>>ch>>cost;
cnt[(int)ch]=cost;
by armansuleimenov
Sun Nov 11, 2007 8:01 pm
Forum: Volume 113 (11300-11399)
Topic: 11340 - Newspaper
Replies: 154
Views: 42963

I used stl map, got TLE, now switched to simple hash table, got WA 3 times. what is wrong with my code?

Code: Select all

thanx all, got AC
by armansuleimenov
Sun Oct 07, 2007 6:19 am
Forum: Volume 100 (10000-10099)
Topic: 10020 - Minimal coverage
Replies: 57
Views: 20376

TLE after a week of struggle

I have been solving this problem ("Minimal coverage "): http://acm.uva.es/p/v100/10020.html for about a week. I got TLE and WA all the time. I assume the numbers in pairs are doubles. With the last version of my code I got TLE. Could you please point out how I can improve the efficiency and get AC? ...
by armansuleimenov
Tue Sep 25, 2007 3:20 am
Forum: Volume 101 (10100-10199)
Topic: 10183 - How Many Fibs?
Replies: 66
Views: 23274

How to debug the program to find the reason of RE

I'm using BigInteger class ( http://online-judge.uva.es/board/viewtopic.php?t=5922&start=0&postdays=0&postorder=asc&highlight=mahbub+murshed+suman ). I've run my program with all the tests from the board, it solves all the tests correctly. But I'm getting Runtime Error from judge. What is the reason...

Go to advanced search