Search found 27 matches

by Examiner
Wed May 22, 2013 6:01 pm
Forum: Volume 102 (10200-10299)
Topic: 10293 - Word Length and Frequency
Replies: 18
Views: 7830

Re: 10293 - Word Length and Frequency

There are extra lines after the last # line, as the following program reaches the time limit.

Code: Select all

#include <iostream>
using namespace std;

int main() {
    string s;
    while (getline(cin, s));
    if (s[0] != '#')
        for (;;);
}
by Examiner
Wed Apr 24, 2013 1:29 pm
Forum: Volume 110 (11000-11099)
Topic: 11063 - B2-Sequence
Replies: 73
Views: 39909

Re: 11063 - B2-Sequence

Try this:

Code: Select all

3
1 3 5
by Examiner
Mon Aug 30, 2004 1:03 pm
Forum: Volume 107 (10700-10799)
Topic: 10700 - Camel trading
Replies: 32
Views: 14237

Re: problem with 10700

Eduard wrote:I don't know why i'm geting WA.My solution is good solution I use DP and get right answers for simple input.
I saw that nobody at this moment have got this problem AC by Pascal.
Whats wrong. :roll:
Did you define infinity correctly? That was my problem.
by Examiner
Sun Aug 08, 2004 3:19 pm
Forum: C++
Topic: Woes of strstream
Replies: 4
Views: 2037

The longer I think about it, the easier my question looks. You are right, Krzysztof, I could do that, at the cost of a bit more typing. I could also create a big struct/class to include everything. For each test case, I declear an object of it and consequently get an empty strstream object. [cpp]str...
by Examiner
Sat Aug 07, 2004 3:25 pm
Forum: C++
Topic: Woes of strstream
Replies: 4
Views: 2037

Thank you very much for your suggestion. Your code works very well. The only problem is that I then need lots of ugly [cpp](*in) >> n;[/cpp] instead of [cpp]in >> n;[/cpp] I am thinking of defining [cpp]istream *operator>>(istream *in, int &n); istream *operator>>(istream *in, char &c); // etc.[/cpp...
by Examiner
Sat Aug 07, 2004 12:48 pm
Forum: C++
Topic: Woes of strstream
Replies: 4
Views: 2037

Woes of strstream

I've been able to keep strstream objects local before. But not this time. Now I need a global strstream object (as my global functions need it), which has to be emptied before every test case. I've tried to use a reference by declaring [cpp]strstream ∈[/cpp] However, whenever I say [cpp]int main(...
by Examiner
Thu Jun 17, 2004 6:03 am
Forum: Volume 106 (10600-10699)
Topic: 10671 - Grid Speed
Replies: 2
Views: 1681

10671 - Grid Speed

I have some difficulty with the second sample test case. My program reports it is possible to travel, and I have to agree! My diagram looks like this 8) 20 /--<--S 7) 10 | 6) 20 | 5) 10 | 4) 30 T--<--/ 3) 20 2) 20 1) 10 10 20 20 30 10 20 10 10 1) 2) 3) 4) 5) 6) 7) 8) Going along the route indicted a...
by Examiner
Fri Jun 11, 2004 12:10 pm
Forum: Other words
Topic: acm solve sites
Replies: 51
Views: 25922

This story seems appropriate here. Once upon a time, a dying father called his son to his bed and said to him, "Son, I don't have many days left, but I want you to do me a favour. After I leave, you will be the only bread runner of the family, but you have never worked before. I want to see you earn...
by Examiner
Sat Jun 05, 2004 12:09 pm
Forum: Volume 105 (10500-10599)
Topic: 10520 - Determine it
Replies: 15
Views: 8248

Then the formula implies a[n, 1] is always 0; this contradicts the input, unless the second number is also 0.
by Examiner
Thu Jun 03, 2004 11:59 am
Forum: Volume 6 (600-699)
Topic: 679 - Dropping Balls
Replies: 5
Views: 5228

679 - Dropping Balls

I notice that the reverse of I - 1 (in binary form) is the position of the ball in the last row. For example, when n = 4, I = 1 = 000 + 1, p = 000 = 0, ans = 0 + 2**3; I = 2 = 001 + 1, p = 100 = 4, ans = 4 + 2**3; I = 3 = 010 + 1, p = 010 = 2, ans = 2 + 2**3; I = 4 = 011 + 1, p = 110 = 6, ans = 6 + ...
by Examiner
Thu Jun 03, 2004 10:03 am
Forum: Off topic (General chit-chat)
Topic: How old are you? Statistics.
Replies: 121
Views: 175359

Hi, my info:
[cpp]struct examiner {
int age = 0x15;
/* to look younger :) */

double membership_in_year = 0.499314162272;
/* don't trust its precision; it's floating-point */

int num_solved_problems = 370;
};[/cpp]
Judge wrote:Compile Error!
by Examiner
Tue Jun 01, 2004 10:44 am
Forum: Off topic (General chit-chat)
Topic: Isn't this nice?
Replies: 0
Views: 1573

Isn't this nice?

This is Pascal's triangle, with '.' represent odd number of digits and '#' even number of digits. I got this as a by-product when doing Problem 10219 Find the ways! Isn't it nice? (Best viewed at 1024 x 768) . . . . . . . . . . . . . . . . . # # . . . . # # # . . . . # # # # . . . . # # # # # . . . ...
by Examiner
Sat May 29, 2004 1:57 pm
Forum: C++
Topic: How to skip lines while using cin <<
Replies: 7
Views: 4253

I'll simply write:
[cpp]int n, dummy;
cin >> dummy >> dummy >> n;
[/cpp]
by Examiner
Fri May 21, 2004 8:25 pm
Forum: Volume 101 (10100-10199)
Topic: 10190 - Divide, But Not Quite Conquer!
Replies: 105
Views: 23756

Do you refer to this line? a[1] = n, a = a[i-1] div m, for all 1 < i <= k Now I understand what you mean. I interpreted the inequality "1 < i ≤ k" as only a restriction on i. When k ≤ 1, this inequlity never holds, so the quoted statement is always satisfied. But you think the statement is also a re...
by Examiner
Fri May 21, 2004 11:17 am
Forum: Volume 101 (10100-10199)
Topic: 10190 - Divide, But Not Quite Conquer!
Replies: 105
Views: 23756

Why is the answer "Boring!" but not "1", when n = 1 and 0 ≤ m < 2,000,000,000? Can't k be 1?

Go to advanced search