I replaced this part of your code
for(i=0;i<26;i++){
if(my[i]>=my[i+26]){
my[i]+=my[i+26];
if(max<my[i]){
max=my[i];
}
my[i+26]=0;
}
else{
my[i+26]+=my[i];
if(max<my[i+26]){
max=my[i+26];
}
my[i]=0;
}
with:
max=0;
for(i=0;i<52;i++)
if(my[i]>max)
max=my[i];
And got AC ...
Search found 19 matches
- Tue Jun 07, 2005 4:42 pm
- Forum: Volume 4 (400-499)
- Topic: 499 - What's The Frequency, Kenneth?
- Replies: 93
- Views: 20687
- Tue Jun 07, 2005 4:17 pm
- Forum: C++
- Topic: A very simple program about "cin", What's the matt
- Replies: 3
- Views: 2463
- Fri May 13, 2005 3:00 am
- Forum: Volume 5 (500-599)
- Topic: 516 - Prime Land
- Replies: 23
- Views: 9334
- Mon May 09, 2005 8:00 pm
- Forum: Volume 3 (300-399)
- Topic: 383 - Shipping Routes
- Replies: 27
- Views: 10753
Hey,
My AC program outputs
But if you're getting WA instead of PE (Presentation Error) you should consider checking your algorithm instead.
Good luck,
Sahand.
My AC program outputs
Code: Select all
SHIPPING ROUTES OUTPUT
DATA SET OUTPUT 1
<one only blank line>
END OF OUTPUT
Good luck,
Sahand.
- Mon May 02, 2005 4:02 am
- Forum: Volume 3 (300-399)
- Topic: 383 - Shipping Routes
- Replies: 27
- Views: 10753
- Fri Apr 29, 2005 6:16 pm
- Forum: Volume 3 (300-399)
- Topic: 386 - Perfect Cubes
- Replies: 53
- Views: 16978
- Fri Apr 29, 2005 5:58 pm
- Forum: Volume 3 (300-399)
- Topic: 383 - Shipping Routes
- Replies: 27
- Views: 10753
- Thu Apr 28, 2005 3:08 pm
- Forum: Volume 3 (300-399)
- Topic: 320 - Border
- Replies: 24
- Views: 4845
- Thu Apr 28, 2005 2:57 pm
- Forum: Volume 3 (300-399)
- Topic: 325 - Identifying Legal Pascal Real Constants
- Replies: 63
- Views: 25467
- Wed Apr 27, 2005 3:42 pm
- Forum: Volume 3 (300-399)
- Topic: 325 - Identifying Legal Pascal Real Constants
- Replies: 63
- Views: 25467
Yes, I checked that. I was not correct but I corrected it and I still get WA.
Here's the new code:
Thanks!
Here's the new code:
Code: Select all
code removed
- Wed Apr 27, 2005 3:35 pm
- Forum: Volume 3 (300-399)
- Topic: 352 - The Seasonal War
- Replies: 54
- Views: 23032
- Tue Apr 26, 2005 12:10 am
- Forum: Volume 3 (300-399)
- Topic: 352 - The Seasonal War
- Replies: 54
- Views: 23032
352 - The Seasonal War - WA - Please help!!
Another problem that I keep getting WAs on without any good reason.
I checked all the sample input on the board but no luck!
Please help me!!
I checked all the sample input on the board but no luck!
Please help me!!
Code: Select all
code removed!
- Mon Apr 25, 2005 11:52 pm
- Forum: Volume 3 (300-399)
- Topic: 320 - Border
- Replies: 24
- Views: 4845
- Sun Apr 24, 2005 10:38 pm
- Forum: Volume 3 (300-399)
- Topic: 325 - Identifying Legal Pascal Real Constants
- Replies: 63
- Views: 25467
325 - Pascal real numbers - WA - please help!
This is my code for 325, but I keep getting WAs!
I checked all the sample inputs on this board, and it gives correct output.
I would really appreciate if somebody could tell me what i'm doing is wrong.
P.S. I know it's not an efficient way of doing it. I know about FSMs but just didn't feel like ...
I checked all the sample inputs on this board, and it gives correct output.
I would really appreciate if somebody could tell me what i'm doing is wrong.
P.S. I know it's not an efficient way of doing it. I know about FSMs but just didn't feel like ...
- Sun Apr 24, 2005 10:34 pm
- Forum: Volume 3 (300-399)
- Topic: 320 - Border
- Replies: 24
- Views: 4845