## Search found 132 matches

Sat Aug 30, 2003 7:08 pm
Forum: Volume 103 (10300-10399)
Topic: 10314 - Three Pigs
Replies: 20
Views: 9840

### Tests 2

Try this

Code: Select all

``````2
1
2
2
1 1
1 2``````
Output should be

Code: Select all

``````-1
-1``````
Sat Aug 30, 2003 5:44 pm
Forum: Volume 103 (10300-10399)
Topic: 10314 - Three Pigs
Replies: 20
Views: 9840

### Tests

Try this test 4 5 1 1 1 1 1 2 1 2 2 1 2 1 1 2 1 2 1 1 2 1 2 2 2 2 1 5 1 1 1 1 1 1 2 1 1 1 1 2 1 1 1 1 2 1 1 1 1 2 1 1 1 6 1 1 1 1 1 1 1 2 1 2 2 1 1 1 1 1 2 1 1 2 1 1 2 1 1 2 2 2 2 1 1 1 1 1 1 1 7 1 1 1 1 1 1 1 1 2 1 2 1 2 1 1 1 1 2 1 1 1 1 2 2 2 2 2 1 1 1 1 2 1 1 1 1 2 1 2 1 2 1 1 1 1 1 1 1 1 Outpu...
Fri Aug 29, 2003 6:23 pm
Forum: Volume 105 (10500-10599)
Replies: 13
Views: 6326

I thoght much about the problem. It is not so hard. I try to find out the formula that solved this problem but fail I used some kind ob binary search (actually, it was 3-ary search) to solve it and get AC. But I want to know if there is another (easier) way to solve it.
Thu Aug 28, 2003 8:10 pm
Forum: Volume 105 (10500-10599)
Topic: 10547 - Hidden Truth in Recurrence
Replies: 7
Views: 2991
Thanks for advise - I change my code, but now I get Runtime Error :( Can you say why it's happen ? [cpp]#include <iostream.h> #include <stdio.h> int main() { unsigned long long n, k, t, m, testid = 0, d; while (1) { scanf("%lld %lld %lld", &k, &n, &t); if (n == 0 && k == 0 && t == 0) break; cout << ...
Wed Aug 27, 2003 9:06 pm
Forum: Volume 105 (10500-10599)
Topic: 10547 - Hidden Truth in Recurrence
Replies: 7
Views: 2991

### 10547 - Hidden Truth in Recurrence

I have got many WAs. As I understood the program should calculate (k^n) mod (10^t) Am I right ? If I am then it is very very strange. To calculate (k^n) mod (10^t) I use Modular-Exponentiation Algo based on repeated squaring. But WA :-? Here is my program [cpp]#include <iostream.h> #include <stdio.h...
Wed Aug 27, 2003 8:49 pm
Forum: Volume 105 (10500-10599)
Topic: 10548 - Find the Right Changes
Replies: 6
Views: 2971
Thank you!
But my solution still is the slowest
It work 0.2 sec
Wed Aug 27, 2003 6:45 pm
Forum: Volume 105 (10500-10599)
Topic: 10548 - Find the Right Changes
Replies: 6
Views: 2971

### 10548 - Find the Right Changes

Can anybody tell me how can I improve my algo. I get AC. I do brute froce with some improvements, but they are not enough. My Code: [pascal]Program p10548; type LongInt = Int64; Var a, b, c, n, t, beg : LongInt; i, j : Integer; function gcd(a, b : LongInt) : LongInt; begin if a = 0 then gcd := b els...
Mon Aug 18, 2003 6:27 am
Forum: Volume 7 (700-799)
Topic: 755 - 487--3279
Replies: 115
Views: 28744
Ops
I should find these bugs, but no with your help I have fixed all of them and get Accepted
Thank you!
Sat Aug 16, 2003 10:23 pm
Forum: Volume 7 (700-799)
Topic: 755 - 487--3279
Replies: 115
Views: 28744
Thanks for help I've fixed some bugs But still WA My Code [pascal]Program p755; Const MaxN = 110000; LDig : Array['A'..'Z']of Integer = ( 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 0, 7, 7, 8, 8, 8, 9, 9, 9, 0 ); Type Point = Record i : Integer; s : String[7]; End; Var T,tt,i : Integer; p,j,k,c...
Sun Aug 10, 2003 9:14 pm
Forum: Volume 102 (10200-10299)
Topic: 10263 - Railway
Replies: 14
Views: 5685

### Yes!

Thanks, thanks. thanks !
Now, I've fixed all my bugs and get Accepted
Sun Aug 10, 2003 9:11 pm
Forum: Volume 102 (10200-10299)
Topic: 10263 - Railway
Replies: 14
Views: 5685

### :(

Tanks, I fixed it But I still get WA :( [pascal]Program p10263; {\$n+} Const Eps = 1e-7; Eps2 = 1e-5; Type Point = Record x, y : Extended End; Var M, S : Point; N, i : Integer; R, Rp : Point; Function Dist(A, B : Point) : Extended; begin Dist := Sqrt(Sqr(A.x - B.x) + Sqr(A.y - B.y)); end; Function Ge...
Fri Aug 08, 2003 2:34 pm
Forum: Volume 102 (10200-10299)
Topic: 10268 - 498-bis
Replies: 51
Views: 17488

### I get AC!!!

Thanks!

I get AC
Fri Aug 08, 2003 11:40 am
Forum: Volume 102 (10200-10299)
Topic: 10268 - 498-bis
Replies: 51
Views: 17488

### Help me

I try everything, but I get WA Please, help me My code [pascal]Program p10268; {\$n+} Var X, Ans : Extended; XPow : Extended; A : Array[0..1000000]of Extended; N, i : Integer; Function ReadInteger(Var I : Extended) : Boolean; Var Ch : Char; Cnt : Integer; begin I := 0; Cnt := 0; While Not (Eoln or Eo...
Fri Aug 08, 2003 10:10 am
Forum: Volume 102 (10200-10299)
Topic: 10263 - Railway
Replies: 14
Views: 5685

### 10263 - Railway

This problem seems to be so easy, but I'm getting WA :cry: My algo is simple: 1. For each segment AB do 1.a Check if points A or B can be choosen (It's possible if cos(A) <= 0 or cos(B) <=0)) 1.b Else try to find such point X on AB that XM is minimal 1.c Check if the point X that we found is better ...
Mon Jan 13, 2003 8:49 pm
Forum: Volume 104 (10400-10499)
Topic: 10426 - Knights' Nightmare
Replies: 17
Views: 7790

### Yes! I fix it!!!!!

Thanks to all who tries to help me
I get it. I get Accepted