OJ Board
The Online Judge board
Skip to content
Search
Advanced search
Quick links
Unanswered topics
Active topics
Search
FAQ
Login
Register
Board index
Search
Search
Search found 5 matches
Go to advanced search
Search
Advanced search
Search found 5 matches • Page
1
of
1
by
jiayaoyu
Wed Jan 22, 2003 12:50 am
Forum:
Volume 4 (400-499)
Topic:
439 - Knight Moves
Replies:
33
Views:
14986
AC with D.P
Dijkstra is not very efficient.
I got AC after I switched to dynamic programming.
jhonny_yang,
the code here should give the correct answer as well, so generate all possible input and compare the output of my program with yours. Hope this can help.
Jump to post
by
jiayaoyu
Tue Jan 21, 2003 6:23 pm
Forum:
Volume 4 (400-499)
Topic:
439 - Knight Moves
Replies:
33
Views:
14986
why do i get TLE???
[c]
#include <stdio.h>
int graph[64][64];
int result[64][64];
int visited[64];
int len[64];
int dijkstra(int s,int d);
void init()
{
int i,j;
for(i = 0;i<8;i++)
for(j = 0;j<8;j++)
{
if(i+2<8)
{
if(j-1>=0)
graph[8*i+j][8*(i+2)+(j-1)] = 1;
if(j+1<8)
graph[8*i+j][8*(i+2)+(j+1)] = 1;
}
if ...
Jump to post
by
jiayaoyu
Sun Jan 19, 2003 4:46 pm
Forum:
Volume 4 (400-499)
Topic:
497 - Strategic Defense Initiative
Replies:
144
Views:
44333
Could someone tell me why '1 3 2 5 4'should give '1 3 4'?
My prog(WA) gives '1 3 5', is there anything i missed out in the problem description?
Jump to post
by
jiayaoyu
Sun Jan 19, 2003 1:40 pm
Forum:
Volume 101 (10100-10199)
Topic:
10131 - Is Bigger Smarter?
Replies:
93
Views:
88834
10131 - Is Bigger Smarter?
[c]
#include <stdio.h>
int w[1001];
int s[1001];
int pre[1001];
int lens[1001];
void output(int last)
{
if(pre[last]==-1)
printf("%d\n",last+1);
else{
output(pre[last]);
printf("%d\n",last+1);
}
}
int main(int argc, char *argv[]) {
int num=0,i,j,max = 1,last = 0;
while(scanf("%d %d",&w[num ...
Jump to post
by
jiayaoyu
Sun Dec 22, 2002 8:57 pm
Forum:
Volume 3 (300-399)
Topic:
349 - Transferable Voting (II)
Replies:
9
Views:
3430
If there were any invalid ballots, print an additional line
[c] //output
printf("Election #%d\n",elec);
printf(" %d bad ballot(s)\n",nbad);
[/c]
You should not output "0 bad ballot(s)" if there is none. [/cpp]
Jump to post
Display:
All results
1 day
7 days
2 weeks
1 month
3 months
6 months
1 year
Sort by:
Author
Post time
Forum
Topic title
Post subject
Direction:
Ascending
Descending
Search found 5 matches • Page
1
of
1
Go to advanced search
Jump to
Real Time Contests and Last Minute Information
↳ General
↳ Real Time Clarification
↳ Fixing Mistakes
↳ HOWTOs
↳ Bugs and suggestions
New system
↳ FAQ
↳ Bugs and suggestions
Let's make some programs!
↳ Other words
↳ Algorithms
↳ New features
Help on the Problemset
↳ Volume 1 (100-199)
↳ Volume 2 (200-299)
↳ Volume 3 (300-399)
↳ Volume 4 (400-499)
↳ Volume 5 (500-599)
↳ Volume 6 (600-699)
↳ Volume 7 (700-799)
↳ Volume 8 (800-899)
↳ Volume 9 (900-999)
↳ Volume 10 (1000-1099)
↳ Volume 11 (1100-1199)
↳ Volume 12 (1200-1299)
↳ Volume 13 (1300-1399)
↳ Volume 14 (1400-1499)
↳ Volume 15 (1500-1599)
↳ Volume 16 (1600-1699)
↳ Volume 17 (1700-1799)
↳ Volume 100 (10000-10099)
↳ Volume 101 (10100-10199)
↳ Volume 102 (10200-10299)
↳ Volume 103 (10300-10399)
↳ Volume 104 (10400-10499)
↳ Volume 105 (10500-10599)
↳ Volume 106 (10600-10699)
↳ Volume 107 (10700-10799)
↳ Volume 108 (10800-10899)
↳ Volume 109 (10900-10999)
↳ Volume 110 (11000-11099)
↳ Volume 111 (11100-11199)
↳ Volume 112 (11200-11299)
↳ Volume 113 (11300-11399)
↳ Volume 114 (11400-11499)
↳ Volume 115 (11500-11599)
↳ Volume 116 (11600-11699)
↳ Volume 117 (11700-11799)
↳ Volume 118 (11800-11899)
↳ Volume 119 (11900-11999)
↳ Volume 120 (12000-12099)
↳ Volume 121 (12100-12199)
↳ Volume 122 (12200-12299)
↳ Volume 123 (12300-12399)
↳ Volume 124 (12400-12499)
↳ Volume 125 (12500-12599)
↳ Volume 126 (12600-12699)
↳ Volume 127 (12700-12799)
↳ Volume 128 (12800-12899)
↳ Volume 129 (12900-12999)
↳ Volume 130 (13000-13099)
↳ Volume 131 (13100-13199)
Help on languages
↳ C
↳ C++
↳ Pascal
↳ Java
Off Topic
↳ Off topic (General chit-chat)
Category
↳ ACM ICPC Archive Board