ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 1403. Courier

Pages: 1 2 Next
ADMINS! test #4 WA, but it's right algorithm
Posted by Alexander Prudaev 29 Aug 2006 19:46

explain me why WA twoalias[animal]inbox[youknow]ru

#include <stdio.h>
#include <memory.h>

struct elt
{
int c;
short i;
};

elt T[100001];

int main()
{
memset(T,0,sizeof(T));
int N;
scanf("%i",&N);
short i;
for (i=1;i<=N;i++)
{
int S,C;
scanf("%i %i",&S,&C);
if (C>T[S].c)
{
T[S].c=C;
T[S].i=i;
}
}
int j,ch=0;
for (j=0;j<100001;j++) if (T[j].c>0) ch++;
printf("%i\n",ch);
for (j=0;j<100001;j++) if (T[j].c>0) printf("%i ",T[j].i);
return 0;
}

Edited by author 29.08.2006 20:03
Re: ADMINS! test #4 WA, but it's right algorithm
Posted by AlexF 29 Aug 2006 20:37
I think you didn't understand the task right!
On the test
6
1 10
1 12
2 14
2 23
5 17
5 18
3
2 4 6
4
3 4 6 5

Edited by author 30.08.2006 00:13
Re: ADMINS! test #4 WA, but it's right algorithm
Posted by Alexander Prudaev 29 Aug 2006 21:26
but I think, right answer is
3
2 4 6

in your case 2-th (#4 (2, 23)) and
4-th (#5 (2, 17) orders is expired

if you right, then why you can't
output
5
1 3 4 5 6
or
6
1 2 3 4 5 6
?

please explain me, i can't understand
Re: ADMINS! test #4 WA, but it's right algorithm
Posted by AlexF 29 Aug 2006 23:52

Edited by author 29.08.2006 23:58

Edited by author 29.08.2006 23:59
Re: ADMINS! test #4 WA, but it's right algorithm
Posted by Alexander Prudaev 30 Aug 2006 09:11
twoalias[animal]inbox[youknow]ru

Edited by author 30.08.2006 09:16
Re: ADMINS! test #4 WA, but it's right algorithm
Posted by AlexF 30 Aug 2006 19:28
I've sent the message to you! If you won't get it write here, please!)
Re: ADMINS! test #4 WA, but it's right algorithm
Posted by Giorgi Saghinadze (Tbilisi SU) 3 Nov 2006 19:09
I have the same problem. I can't understand meaning of this problem.
Re: ADMINS! test #4 WA, but it's right algorithm
Posted by AlexF [USTU] 4 Nov 2006 17:53

Edited by author 04.11.2006 17:53
Re: ADMINS! test #4 WA, but it's right algorithm
Posted by Giorgi Saghinadze (Tbilisi SU) 6 Nov 2006 14:34

now I have WA 9:(
I used heap
Re: ADMINS! test #4 WA, but it's right algorithm
Posted by AlexF [USTU] 6 Nov 2006 17:22
I've sent a message!)
Re: ADMINS! test #4 WA, but it's right algorithm
Posted by Todor Tsonkov 3 Dec 2006 01:49
Can you explain it to all of us ?
Re: ADMINS! test #4 WA, but it's right algorithm
Posted by AlexF [USTU] 3 Dec 2006 14:39
I think this test is very useful for understanding this task
6
1 10
1 12
2 14
2 23
5 17
5 18
4
3 4 6 5

Re: ADMINS! test #4 WA, but it's right algorithm
Posted by Anton [SUrSU] 3 Dec 2006 15:40
I'm understand problem, but how using dp to solve task?
Re: ADMINS! test #4 WA, but it's right algorithm
Posted by AlexF [USTU] 3 Dec 2006 16:43
I solved it without using DP!)
Re: ADMINS! test #4 WA, but it's right algorithm
Posted by Neizvestnii 22 Jun 2007 22:50
AlexF [USTU] wrote 3 December 2006 16:43
I solved it without using DP!)
How?????
Re: ADMINS! test #4 WA, but it's right algorithm
Posted by AlexF [USTU] 23 Jun 2007 00:22
Re: ADMINS! test #4 WA, but it's right algorithm
Posted by Neizvestnii 23 Jun 2007 16:21
acmrulit@rambler.ru
Re: ADMINS! test #4 WA, but it's right algorithm
Posted by [WA] 11 Sep 2007 21:48
4
3 4 6 5
Re: ADMINS! test #4 WA, but it's right algorithm
Posted by Loky_Yuri [USTU] 12 Sep 2007 14:20
Come on! It's easy to understand it.
For example this test
3
1 9
2 10
2 11