1207 - AGTC

All about problems in Volume 12. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
biswajitsc
New poster
Posts: 3
Joined: Thu Mar 21, 2013 6:19 pm

1207 - AGTC

Post by biswajitsc » Fri Mar 22, 2013 7:15 pm

Why am i getting WA? I know my algorithm is correct. Its a standard algorithm for edit distances. Any mistake in I/O?

Code: Select all

#include <iostream>
#include <stdio.h>
using namespace std;
//<removed after AC>
    scanf("%d%s",&n,a);
    scanf("%d%s",&m,b);
//<removed after AC>
    printf("%d",ans);
    return 0;
}
Last edited by biswajitsc on Sat Mar 23, 2013 2:42 pm, edited 1 time in total.

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 1207- AGTC

Post by brianfry713 » Fri Mar 22, 2013 10:22 pm

Input contains several datasets
Check input and AC output for thousands of problems on uDebug!

biswajitsc
New poster
Posts: 3
Joined: Thu Mar 21, 2013 6:19 pm

Re: 1207- AGTC

Post by biswajitsc » Sat Mar 23, 2013 2:43 pm

brianfry713 wrote:Input contains several datasets
Yes made the changes and got AC. Thank you :)

cyberdragon
New poster
Posts: 20
Joined: Fri Aug 30, 2013 5:42 am

Re: 1207- AGTC

Post by cyberdragon » Fri Aug 30, 2013 5:50 am

Why WA ?

http://ideone.com/DgLr4E

@brianfry713

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 1207- AGTC

Post by brianfry713 » Fri Aug 30, 2013 10:10 pm

Input:

Code: Select all

66 GCTACACGCAGTTGCCTCGAGGAAACAAGCGCAATCGGATCGCGCATCCACACCACGACCCTGTAA
67 GGGGATTCGGCATGGCGTAGGGGAATTGCTGAACGACACTCGTGCATTTAAGGGGGAACTATTACAG
8 TTTACACT
17 AGCAGTGCATTGGCGGG
16 GCTCCCGCACGTCCCC
66 AGTCCCGTATAGAGACATACGCAGAGGCATAAATCCCAGCTGTATTCTCCGTAGAATGCTACTGCG
9 GGCGCGGGA
88 TACGGGCTGCCTGGTTAAGGAGTGTATAGGAAGCGTTTCGCAATGTCGAACAGGGGGAGCGCCTAACATAGGAGAGATCATAAACGGT
53 CTGACGAAGAACGATCGAGTAAAGACCCGAGTACACTATGATTCATAGTGGTG
83 GAGTTTATAATCACCAGTGACTAGTCAATAGAACTTCTTCTCGTATAGCGCAACCTACTTCATTCCCACGTGAAGATGCGCAG
37 TGTCACAACTCACTCTCATCGAGCCCACTCATTTGTC
47 GTAGGATATCCTCAACGCATCCTACCTCTCAAGAGCAATTTGCGCCT
49 TTCGCCTAGGTTGTAGGTCGCGATAGGCAGTTAGACAACGGGGTAGAGA
92 CTCATCAGTCGAGGATGCTGAATGGCCTCTTGCCGCAGTTTAAGGAATTTATTTGGGTAACTGGGCTGTCGCCGTAGTTACTACTGTAATAC
21 TATCGCACGTTATGACGCGGA
31 ACTGCCGGGTAGCTCGTGCCACGGCTTGGAG
42 GCGTACATTGGCACGGAAGTGTGGCCCCATGGCTACGGGACC
74 CCGATGAGAGACCCAAAAACGCGCACTGTGTGAAGTCGACTAAGCGCTGCGTACGAAAGTGAGGGCGTAGGTCC
32 TCTAAATACAATAGCCCTTTCACCCTGAGGAA
57 AAGAAAGTGGCGTATGATACTCAGGGGTCCTCCATCGAGCGTTAATGACGCGTCTGT
36 GCTAAATTGTATAACGAGCATACGTAAATAAATAAT
53 ATCGCTATTCATACTTCGACGACAGTAATGTTACATGACACCTCACCTTCGAT
73 ACAAGGTACGAGCATCTGGGGTTACCGCGGCGTTGGAAGCCCTACCTGTATGACGCATGGATCTCTATACGCA
84 GCCTGATCTACGGACAGTAGCATGACGCATCGCGATGTGATTGGATGGTCCGCCCCAAGATTGGACGGGCGGCTCCCTTGGCCT
40 CAGTGACCCTATACGCTTGGGTAGGCTTGTATTGCACGTA
97 ATTAGACAATGGTCCAAGTGAAGAGTATATTATCGATTGTTCACATCAAGCGGTGTCGCTGCTAAAATAGCTATGACTGCATTCCAGACTTTGTTCT
2 TG
8 ACGTTGGC
2 TG
39 TGTTCAGGTATCTGCTCGACAGGTCCCGCGCGCCAACCG
19 AACGCGATGCTCATACGGA
90 CAGACCAAAGGCCGATTGTTCCCACGGACCGACCAAAAAACCTATTTTGTCTGAATCGTATAGCTGCTCTAAGTAACTTTCGTTCTCAAC
24 CGGGTAGGTGGAAGACAACTGGCT
41 AGTATATGGGTAGAGAGCAGTATAAGTCCGGCCGCGGCTCT
16 ACAATTAACATCGGGT
23 TTACGGATCCCGGAAGCAGGTGG
7 AATGCCG
15 GCTCATGCCTTTTTG
39 CCTATGCACGGATCGGGTGGGATATCATTGTCACCTAAT
46 CGGCATTGGCTCTTGACTAGTGAGGTTGTTAGAGTAGCGCAAAATG
71 AATTGAATTTACCATCCCCTAAGAAGAACACCAGCCGCGACGCAGGTTTGCTGTACAACCGAGGGTTTGAT
89 TGCATTTCTAGCCACAGTCTACAGTTGCGGCATAACTTACAGGCCTCTCACCCTAGCGATCCAGCATGAAAAGGCTAACTAGGCAGTCC
59 GGCCTCCGCCGCTCATCAGGACTCCACGTGTATGCCTATCCAACCGGGGCCCGGATCCA
88 GATGTATGAAGCCGCAATGGGATTGGTATCGACAGGGACGATTTGGTGGGCCGGGCCACGCTGAACGGTACTTGCACCGTTTGAGCCT
1 G
28 GACCAGTGATTTTACTCAGCTATTGCGG
10 CCGAAGGACG
58 TGGCGTCATTCCTGGGTCCATATGATCCTGTTCAGATTACCCACTGTTTGTTGCAGCC
22 TTACTCCTGCGAACCTTGCTCC
40 CTACACAAAATACCCAGACTACGCGATATGCGACTAGAAG
13 GCCACTAACACTC
49 TAGTTCGGCAACGATCACTCATAATACTCCGCCCGGATCCTTGATACAC
19 TGTTATGACTGAGAGTAAG
42 TTAATAAGACTCGAGAAGCATGCTTCACCGTGAAGAAGGAAA
63 AACGGAGAGTTAGTCAACGGCTGCACCATACTAAAGACGGGACTAATACAGATCCAGAAAGCT
71 GCATCCAATGCCGCGGGCTGGGAGCACCGACTTCCGACGTTTCACTCTGGATCAAGGCTCTGGCTTTTCGT
15 GCCAAGCGCGTCGAT
26 AACTGTGGTAAGGTCCAAAGACTGAA
3 GGC
42 GGAATTGACCATTACGACCGTAAAAAGCCTATAAATAGTCTA
79 AAAACCCGCCCCTTGGCGATCACCCCAGCCACCGCGTACCTAACAGTCTTGGAATCCTTACACAGAGAGACAATCAAGT
83 TAAAAATCCTCCGCAGTGTTCTCCTGAAGGTGGTGCAGACACGGAGCTCGTAAGCACCATTTAGCCTCTTGTCCACTCCCAGC
40 GAATATTTAACCTAGCGAATATTCGGCCTTAATAAATTTT
85 TGGCCCATCGTCACGGTTTCCTTCTTCCCGCGTTTGCTAAATTAGAGATATCTCACGCGTTTACCTTACAGTTATGAGGTGAGGC
2 TT
6 ACTTCG
17 GCAGTTATCGTTTTGTA
27 CCCGGGCAAGCCTATCAAGTAGGCAGG
55 AAACCGATTAAGCCACGCCGAGGGTTGAAGCGGCTTTTCTTCACAAAGTTCTAAA
80 TTGTACGGTTACTAGCTTCGACCGGGAAGAAGTCATACAAGGCAGTCATACTTAAAGAGCAGTATATACAATGCACCCCG
9 ACAACGGTA
96 GGTGATGAGGAGCTGAGTCCCTCATCTGTCGGTACAATAGAGCCATCGTGTGAGCTTGATTGATCCTCCTTCACGAGTGAAACAGAAGGAAACATA
82 CACGTCTATGTAGAGTACTATAGTGTTATCTGCGCGTCGCTGTAGAAGCTCCATGGCGGGTACGGATGCATGGCCCCCAGGC
99 TGGACTGAAAACCCCGTGGCCTGAGTCGAATTGAAATGATCAGACAGGGCATGGATACAGCAAAAAAACATAAGATGGACTAGGGGACAATCATCGACG
59 ACTGCCCTCACTCTATTCTAGCAGAGGTCTGTGAATCTCGTAAGAAGTTATACAGTGCC
87 AGTTCATGCCTTCATTAAATTGTTTTGCATAAGATTATGCGACTAGTAGTAAATAACGCCATTGTCGTGCGTCTCTGGTCGTTGCTG
80 ATATCCCATGCGCGTCTCTGCGCGATATGATGTAAGCCCGTACGGGTAACGCATTATTAAATGTTGGGTTCCTATACTAC
97 GCAGGTCATCATGGCGCTCGCGTGGTGTCCGTAGGGGTCAGCTCAGTCGCATTTGACCAAAGAATGCAAAAGCTTCATGGGGGAACATAATGCTGGA
14 ATGGCAGAAAGCGC
100 TGTGGCGCGCAGAGGTCCTTTGTAGTATGGGACAGACTCAGCGGTCGGAAAAGTACCGGACTAGTCGCGTCCGTAAGGGCGGCCACACTCCCGTTAGACC
13 AATAAGGGTCCGA
80 CTGATTTGACAATATGTTGTTCTATATCCACATTACCTTCGTTATCGCGTGAGAAAATCCTGCTATGTCGGAAAAACCCA
29 ACAGCGAGTACCTCGAGTGTTCTACCCAC
38 TACGGTTCAAGACTTGATCAGGTTGTGTGGGACTGTTG
6 GCTACC
10 GCGTCCGCGC
39 GTACTCGGGACCTTACTCAAGCATAGGCTTAACACGCTC
98 TAAGTACCTACAGAAGGGCTAGTATACGCGTCGATGAGTTCGTTCTATATCAAGAAGCGAAACGAGCATGAGTTAGTGATACAATAAGTGGTCTACAT
4 ATAT
44 CGAGCAGCCGCCGTTAAATCTAGTTATTTTTGATTCAAACGTAC
12 TCTCGCCCCGCG
19 GGAACGTGTTGACCTCGGC
4 GCAA
25 GCCCATTGTTAATGACTAAGTTCAG
89 CGACCCAATTAATTATCCTGGTGCCAGCGTCAACCCATTTCTAGCAGGCACTATCCATGGCTGTGAGGTAGGTGTCGATAAGTAAGTAA
91 ACTTTCATTGCACATTTGGTAGTGAACCTCCTAGCATCTTTCTCCCGGACAATTCATACCCAGTCTTGGCAGATTCCATCTTCCTACCAAG
22 CCTCGATTGAAATCCACATGTG
28 ATATAAATGCGAACGAGCAGCAAGACGT
73 AAAATAGTTCGATCCACTCCGACGGCTTGCTCCTCGTTACCCCGAAGCATAGTTCGGGATTTGCTTTCTAGGC
100 TCCATAACAGGTTCGACATCGGGAGTTGAATACGAGGATGGGGATCACCTATGGTCATTGTCGCTGTAGTGCACCTACGCGGGCCGATATATGGGACGAT
1 G
1 A
1 T
1 G
4 TCCG
62 GGCGACGAGCGTTTATCAGTACCTTTACGTTCAGAATGAGTGACAACCATGAGTTACATTTC
2 AC
43 TTTTACAAGAATCACTAACAAAATTTCGCCTGGCACGACCATG
37 TGATTAATATCTGAGTTCGCCTTCGGCACAAGGAGAA
55 GTAAGTCGAGGCCTAGCCTTATGATCGTTGTAATGGCTTCAAATTAAGCTACTGC
9 TCTAGTAGA
31 CTTGCAGCTATTGGTGACCCAGCCACAATGA
3 ACC
82 ATGTTACAGGGGTTAAACCGACGTTGAAGCCGGTAATTAGAGCAACAGACCGGTAAAGACTTTGCAGCTCTTTGTAATGACT
30 CCTCTAACTATGAGTTTCCCACCAGTATCC
46 CAACTTCTGGTGCTCCCGAGTATCAAGGAATCATATCCTTTCACCC
6 TAGTGA
37 GGGCCGCGTTAACCCGCCACACGACAAATGAATGTGC
8 CATCTCAA
54 ACACCCTCGATGTAGATTTGGAATGTGAGCAGAGATTTGATAGTGTTACCGTCG
4 GATC
4 CAAT
37 CATTGTACCGGGGTTTTGACGGCAAGAAAGACCTGTC
82 GGACTGACATGCTTTGCTGTAGTGGGTACCTAATCTGCGGGTTGCCCACTTCACTGTTGCGACGAAAGTCCAGCGTATACCT
13 CATGTGTAGGCGC
13 CCGAGGGTTGTCG
41 ACTCCTAGATCGGATTCGATCGAGAGGTCTATGTGACGGCG
43 TACTTGCAGGTCGATTGCGACACGCCATTCATCCCGTACAGGT
18 CCTATTCAGTCTTGTCCC
80 AAACAGAACGTGCGTGGTGTTCTGCCCGAATGGTTGATGTAGACCAAATGTCTCTGGGCGCGCTGGAGAGAACGTGGTGA
1 C
1 T
26 GACTGAGATCGTTCGACTGGACAGCA
40 CAAGGGGTACAGCTTATTCATATACACCGATTATAGAGAA
43 CCAGCTAATTGCTTCGGAGATGTACTGTAGTCATTCCATGTAA
49 TTCAACCGCTACCATGAGACGAGTCGCAGCAAGCACGCTTCTGATAGTG
66 CGTCAAAAGTAGACCCTAGCCGTCAATAGGGACACCGCCCGCACGCAACCTGTCTTCTTAAGACGC
74 GCATGCCGATTATGCCCGGCGTGATGGTTTGAGCACACTAGCAAATTCAAAGTGCTCTCCCACACCCCACCGAC
15 GGTCGTTAGGTTGCG
43 TCATACCCTAAAACCGATACATGGATAAACGTAGTAAGCTGCT
38 CCGGCTCCATCTTCTCATCGCTGTGAAAAGGCACTCGG
70 AGATGAGACGTATGTAAGGAGGCCTCACAGAGCAATAGACTTTCGCCGTTCAAACTCCCCTCTCCTGTGG
55 GACCTATCAGTAGGATACCTAGGCGTGCATCGTATCATGAAAGCGGGGTTGTGCG
66 CGTACCCTGCTACCGTCGAACGCAAGGTCTAAGTATGCCTAGTTTACCGCCTTATTCACAACGGCG
13 ACCAAGTTGGGCT
29 ACCAGGCCTTCCATAGTTGGCCGTGGGTC
7 CGGTTCG
12 GCATAACACGTT
13 GAGTGCCTGACTG
55 GCACTCTCCTACGGGGTTCTAGACTATACCGTAGGTTAGGAGTGCGCCAGGACCC
9 GCAATTAGA
35 AAGGCGTGCGCGTCCGCATACGCAGCAACGACGGA
67 TGGATCACAGAAAGTGTTCGTCTACCCACGCGCTGCGGAGCACCGGTAAGGATGACTCCGAACCATA
72 GGATTGGCCCGTCTACCGTAAGCGGTTATTAAAGTTCAGACTTGCATAGCGCATTGCTGGCCCCTGGGCTGA
26 GAGGACTGATGAGTTCGGATTTAAAC
39 TCTGTAGAGCCGTTAATGACAGTAACAACATCCCTGCGG
34 AGCTGTCTTATATTAGTATATGCGGAACGAGGGT
93 ACCCGGCAGGAGCTCCTGTCTACTCTTTGATGCGAATCAAAACCAAATGAGAATTTTCCACGGGTGGCAGCACACCATGCTTCTCCCGAGGTC
33 GAGTACCAACTCTCAGGTTAGGTTCAAGCTGAA
36 CTAAGGGAATTCTATCTTAGCTTCTAGTGGTTATTC
1 C
1 A
57 CTGGCAGCGTGACAATTGACAACACCAATAGGACTCTAAATGGGGGAGTATTGGTTA
73 AATAGAAATCTTCTTTAAGCGCGGGACTACTACCATCGTCTCGCCAGCGCACAGTCCCGCAACCCCGATGCTT
8 GACAGGAT
73 GCTTAGACGAATCCATCGGGGGCCCACTGTTTGCCGTTTATTTCGTGTGCACACACTTGACATTCCAGGTGAC
55 TATTGCTTCCTAGCGGACGTATTCACTAAATAACTGACACATCGCATCCACCTGA
85 TAATAACAAGTGGCGACACACCTGATTTCATGATAGTTGTAGAGTGGGCAGACAGTTACGGGCGGTCACAACGATACGGAGTATT
11 TCAATCTGTCT
11 TATTCAAGACC
1 T
19 GCTAAGTTCACATTTGTCG
7 TTCATAT
79 GCCCAGTGTCAGCCGGCACGCTTACCCTCCCTAACGCGCGTCCCATTCTCTGGTCAGATTTGTTGGATCCAGACTGGTT
52 TCCCACTAGTTCCTATTTGCACCCCTAGTACCCAACTTTACCTAGTTGCATC
97 TGGGGGCAGACAACCTGGAAATAGCACAAGTTTAAAGCACCCCTAGCGCCGCGCATCCACATCTTCTAGTCTGGCGCGCATATGCTAAGACGTAACT
7 ACGTTCC
12 AATTACTTTGCA
29 ATGAACCTGGTACCTAAAATTACCAGTCG
82 ACCTACTCACTGGTTATTATTACACAATTCGTGTCGGCTGACTCCCCGCCAGCCGACGAGAGAGACCGAGCGTGTGAGCCTC
3 AGC
4 CCCT
15 TTTCGACCTTCACTA
55 TCCTACGGTTTGCTAGCTGAGGTTACGGGGGATATTCAAGAACCTCTGCACTCGC
4 ATAG
15 GGAGATTGAAGACTT
19 ATTCCGTATTATTGAAGGG
74 GACGATGCCATAACTTAACGAGGTGTTGAACGAACATTCGTCCAAGTGCGCCTTGACAGTAAAAATAACCGCAT
27 GGCTCAGGTCGCCTGCTGCTACTTAGG
63 GATCGAAACAGATTGGGACTTAGTATCTATAGATTGTTCCTTCCTTAAACATCGCTGGCGATC
19 GCCAAATTCGCGGTGATGC
61 ATGGAACGTAGGGTTGTTATGCGTTAATTGCAGTGGTACCAAACTTTTTACACTTGAAGTG
44 CCGACGCAGCATCATGTTTTGCTCCTTCACGTGCTTTGTGAAAC
76 ATTTCCCTAGCTAGGGACAGGTAAATGATCCTGGCATGTACGTTTAATCAATTAATTGATTCCGAGGTCATACCTG
5 AGTAA
79 CAACTCCCGAGCACTAAATACCATATTGTTCGTCTCAGGCCCACAACAACACAAGAAACTTAACCAATGGGTTGCTGAT
1 A
6 TCAATA
72 TTGAGTACCGTTGTGTCCTCACCTACATTAACAGCGGCTTATTGCAAACTCCGACCTCGCCCACTTAAGTAG
85 CTCATCGGCTATACGTATGCGGGAAGGCAGTTACTTAAACAACACTTCCAGTGCACTGATCTCCGCGCCGACCCCACGTAGAATC
AC output:

Code: Select all

35
13
50
79
43
24
50
17
41
35
28
42
63
6
37
71
22
14
9
23
49
48
27
48
24
36
26
42
17
39
47
53
4
16
43
87
57
46
49
86
67
22
5
61
40
12
21
49
16
56
1
1
58
41
32
22
79
25
31
46
3
49
7
21
63
1
23
27
40
31
44
36
17
9
43
28
42
23
62
20
1
45
65
47
6
18
72
53
7
57
3
41
11
56
41
46
44
74
5
40
Check input and AC output for thousands of problems on uDebug!

gr81
New poster
Posts: 46
Joined: Wed Sep 26, 2012 7:52 pm

Re: 1207 - AGTC

Post by gr81 » Fri Sep 26, 2014 11:31 am

I have used dp[1005][1005] and it got accepted.
Just want to share.

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 1207 - AGTC

Post by brianfry713 » Sat Sep 27, 2014 12:34 am

you can assume the length of each string is less than 1000
Check input and AC output for thousands of problems on uDebug!

Post Reply

Return to “Volume 12 (1200-1299)”