Search found 85 matches

by medv
Wed Jan 04, 2006 8:46 pm
Forum: Volume 109 (10900-10999)
Topic: 10945 - Mother bear
Replies: 65
Views: 16813

The answers are correct.

To Schutzstaffel:
The answers are correct.

Send me your code to my e-mail - I'll check your program.
by medv
Wed Jan 04, 2006 2:05 pm
Forum: Volume 108 (10800-10899)
Topic: 10820 - Send a Table
Replies: 34
Views: 14299

Hint

To xlvector: I think it's enough to evaluate f(n): int f(int n) { int result = n; for(int i=2;i*i <= n;i++) { if (n % i == 0) result -= result / i; while (n % i == 0) n /= i; } if (n > 1) result -= result / n; return result; } Then precompute all f(n), n=1,50000. And will get ACC. Still wa - write m...
by medv
Fri Nov 11, 2005 9:13 am
Forum: Volume 107 (10700-10799)
Topic: 10763 - Foreign Exchange
Replies: 45
Views: 17719

10763 - Wrong TESTS! Author, change tests!

Hi! I solved this problem using trees, BUT! Found absolutely stupid and incorrect solution and it is ACCEPTED: #include <stdio.h> int i,n,a,b,_a,_b; int main(void) { while(scanf("%d",&n),n>0) { _a = _b = 0; for(i=0;i<n;i++) { scanf("%d %d",&a,&b); _a ^= a; _b ^= b; } if (_a == _b) printf("YES\n"); e...
by medv
Wed Oct 26, 2005 8:56 pm
Forum: Volume 109 (10900-10999)
Topic: 10945 - Mother bear
Replies: 65
Views: 16813

Thank

O SORRY SRX!
You are right! I got Ac.
THANK to ALL!
by medv
Wed Oct 26, 2005 7:43 pm
Forum: Volume 109 (10900-10999)
Topic: 10945 - Mother bear
Replies: 65
Views: 16813

yes

yes - the program works correctly on all my tests
by medv
Wed Oct 26, 2005 2:38 pm
Forum: Volume 109 (10900-10999)
Topic: 10945 - Mother bear
Replies: 65
Views: 16813

10945 - Mother bear

Why WA? Help me to find test where I am wrong please!!!! #include <stdio.h> #include <string.h> #include <ctype.h> char s[1000]; /// I tried here even 1000000, but still WA int i,j; int main(void) { while(gets(s), strcmp(s,"DONE")) { i = j = 0; while(s[++i]) if (isalpha(s[i])) s[++j] = s[i]; for(i=0...
by medv
Tue Oct 04, 2005 9:33 am
Forum: Volume 106 (10600-10699)
Topic: 10680 - LCM
Replies: 38
Views: 12525

10680 - TLE! Why?

I don't know why TLE How can I speed up a program? #include <stdio.h> #include <math.h> #include <memory.h> const int MAX=1000001; const int SqrtMAX = (int)sqrt(MAX); int m[MAX]; int i,n; void gen_mas_m(void) { int i,j; memset(m,127,sizeof(m)); m[0] = m[1] = 1; for(i=2;i<=SqrtMAX;i++) if (m[i] == 0x...
by medv
Thu Sep 15, 2005 8:11 pm
Forum: Volume 106 (10600-10699)
Topic: 10623 - Thinking Backward
Replies: 13
Views: 4857

I can help you

Send me your code and I will check your program
my e-mail: medv@roller.ukma.kiev.ua
I will test your code. If I'll find mistake - I'll send you tests where you are wrong.
by medv
Thu Sep 15, 2005 7:39 am
Forum: Volume 106 (10600-10699)
Topic: 10623 - Thinking Backward
Replies: 13
Views: 4857

I already accepted

Thank you. I have accepted it already
by medv
Sun Jun 05, 2005 8:27 pm
Forum: Volume 101 (10100-10199)
Topic: 10126 - Zipf's Law
Replies: 36
Views: 8798

10126 TLE

I have TLE in this problem because I use in a program g += tolower(c); in a part of code string g; char c; vector<pair<string,int> > v; while(scanf("%c",&c)) { if (!isalpha(c)) { if (g.size() > 0) { if (g == "endoftext") break; i = Find(g); if (i < 0) v.push_back(make_pair(g,1)); else v[i].second++;...
by medv
Thu May 26, 2005 11:09 pm
Forum: Volume 108 (10800-10899)
Topic: 10815 - Andy's First Dictionary
Replies: 116
Views: 30658

I used STL

If you want - send me your code, I will look at it and will help you
by medv
Fri May 20, 2005 10:05 pm
Forum: Volume 6 (600-699)
Topic: 604 - The Boggle Game
Replies: 33
Views: 10047

604 - WA. Help me!

Hello! I tried a lot of tests, but get WA. I don't know why. I even found author's test data (in previous board messages were links there). My program works well. But getting WA. #pragma warning(disable:4786) #include <cstdio> #include <memory> #include <set> #include <string> using namespace std; s...
by medv
Sun May 01, 2005 9:43 pm
Forum: Volume 108 (10800-10899)
Topic: 10806 - Dijkstra, Dijkstra.
Replies: 24
Views: 17797

10806 - help! WA!

I tested a lot, but WA. Help me please! #include <stdio.h> #include <limits.h> #include <memory.h> const int MAX = 101; int i,n,m,res; int b,e,dist; int mas[MAX][MAX]; int used[MAX],d[MAX]; int next[MAX]; int dejkstra(void) { int i,j,min,ptr; memset(next,-1,sizeof(next)); memset(used,0,sizeof(used))...
by medv
Wed Mar 23, 2005 7:06 pm
Forum: Volume 3 (300-399)
Topic: 340 - Master-Mind Hints
Replies: 27
Views: 8355

340 - WA. Why?

Why WA? #include <stdio.h> const int MAX = 1001; int gameno,i,j,n; int code[MAX],guess[MAX],match[MAX]; int strong,weak; int main(void) { gameno = 0; while(scanf("%d",&n),n!=0) { for(i=0;i<n;i++) scanf("%d",&code[i]); printf("Game %d:\n", ++gameno); while(1) { for(i=0;i<n;i++) scanf("%d",&guess[i]);...
by medv
Mon Mar 21, 2005 11:45 pm
Forum: Volume 7 (700-799)
Topic: 703 - Triple Ties: The Organizer's Nightmare
Replies: 3
Views: 3677

703 - Triple Ties: The Organizer's Nightmare

Help me ! What's wrong? #include <stdio.h> #include <assert.h> #define MAX 101 #define MAX2 1000000 int table[MAX][MAX]; int points[MAX]; int n; int count; typedef struct tie { int t1; int t2; int t3; } tie; tie ties[MAX2]; void addTie(int t1, int t2, int t3) { ties[count].t1 = t1; ties[count].t2 = ...

Go to advanced search