dna.cpp:12:17: warning: overflow in conversion from 'long long int' to 'int' changes value from '9223372036854775807' to '-1' [-Woverflow]
12 | int const INF = LONG_LONG_MAX;
| ^~~~~~~~~~~~~
dna.cpp:16:1: error: 'vector' does not name a type
16 | vector<int> cna(100005, 0), cnt(100005, 0), cnc(100005, 0);
| ^~~~~~
dna.cpp:17:1: error: 'vector' does not name a type
17 | vector<int> ac(100005, 0), att(100005, 0), ta(100005, 0), tc(100005, 0), ca(100005, 0), ct(100005, 0);
| ^~~~~~
dna.cpp: In function 'void init(std::string, std::string)':
dna.cpp:24:23: error: 'cna' was not declared in this scope
24 | if(a[i]=='A'){cna[i]=cna[i-1]+1;}else{cna[i]=cna[i-1];}
| ^~~
dna.cpp:24:47: error: 'cna' was not declared in this scope
24 | if(a[i]=='A'){cna[i]=cna[i-1]+1;}else{cna[i]=cna[i-1];}
| ^~~
dna.cpp:25:23: error: 'cna' was not declared in this scope
25 | if(b[i]=='A'){cna[i]--;}
| ^~~
dna.cpp:27:23: error: 'cnt' was not declared in this scope; did you mean 'int'?
27 | if(a[i]=='T'){cnt[i]=cnt[i-1]+1;}else{cnt[i]=cnt[i-1];}
| ^~~
| int
dna.cpp:27:47: error: 'cnt' was not declared in this scope; did you mean 'int'?
27 | if(a[i]=='T'){cnt[i]=cnt[i-1]+1;}else{cnt[i]=cnt[i-1];}
| ^~~
| int
dna.cpp:28:23: error: 'cnt' was not declared in this scope; did you mean 'int'?
28 | if(b[i]=='T'){cnt[i]--;}
| ^~~
| int
dna.cpp:30:23: error: 'cnc' was not declared in this scope
30 | if(a[i]=='C'){cnc[i]=cnc[i-1]+1;}else{cnc[i]=cnc[i-1];}
| ^~~
dna.cpp:30:47: error: 'cnc' was not declared in this scope
30 | if(a[i]=='C'){cnc[i]=cnc[i-1]+1;}else{cnc[i]=cnc[i-1];}
| ^~~
dna.cpp:31:23: error: 'cnc' was not declared in this scope
31 | if(b[i]=='C'){cnc[i]--;}
| ^~~
dna.cpp:33:36: error: 'ac' was not declared in this scope; did you mean 'a'?
33 | if(a[i]=='A' && b[i]=='C'){ac[i]=ac[i-1]+1;}else{ac[i]=ac[i-1];}
| ^~
| a
dna.cpp:33:58: error: 'ac' was not declared in this scope; did you mean 'a'?
33 | if(a[i]=='A' && b[i]=='C'){ac[i]=ac[i-1]+1;}else{ac[i]=ac[i-1];}
| ^~
| a
dna.cpp:34:36: error: 'att' was not declared in this scope
34 | if(a[i]=='A' && b[i]=='T'){att[i]=att[i-1]+1;}else{att[i]=att[i-1];}
| ^~~
dna.cpp:34:60: error: 'att' was not declared in this scope
34 | if(a[i]=='A' && b[i]=='T'){att[i]=att[i-1]+1;}else{att[i]=att[i-1];}
| ^~~
dna.cpp:36:36: error: 'ta' was not declared in this scope; did you mean 'a'?
36 | if(a[i]=='T' && b[i]=='A'){ta[i]=ta[i-1]+1;}else{ta[i]=ta[i-1];}
| ^~
| a
dna.cpp:36:58: error: 'ta' was not declared in this scope; did you mean 'a'?
36 | if(a[i]=='T' && b[i]=='A'){ta[i]=ta[i-1]+1;}else{ta[i]=ta[i-1];}
| ^~
| a
dna.cpp:37:36: error: 'tc' was not declared in this scope; did you mean 'tm'?
37 | if(a[i]=='T' && b[i]=='C'){tc[i]=tc[i-1]+1;}else{tc[i]=tc[i-1];}
| ^~
| tm
dna.cpp:37:58: error: 'tc' was not declared in this scope; did you mean 'tm'?
37 | if(a[i]=='T' && b[i]=='C'){tc[i]=tc[i-1]+1;}else{tc[i]=tc[i-1];}
| ^~
| tm
dna.cpp:39:36: error: 'ca' was not declared in this scope; did you mean 'a'?
39 | if(a[i]=='C' && b[i]=='A'){ca[i]=ca[i-1]+1;}else{ca[i]=ca[i-1];}
| ^~
| a
dna.cpp:39:58: error: 'ca' was not declared in this scope; did you mean 'a'?
39 | if(a[i]=='C' && b[i]=='A'){ca[i]=ca[i-1]+1;}else{ca[i]=ca[i-1];}
| ^~
| a
dna.cpp:40:36: error: 'ct' was not declared in this scope
40 | if(a[i]=='C' && b[i]=='T'){ct[i]=ct[i-1]+1;}else{ct[i]=ct[i-1];}
| ^~
dna.cpp:40:58: error: 'ct' was not declared in this scope
40 | if(a[i]=='C' && b[i]=='T'){ct[i]=ct[i-1]+1;}else{ct[i]=ct[i-1];}
| ^~
dna.cpp: In function 'int get_distance(int, int)':
dna.cpp:48:12: error: 'cna' was not declared in this scope
48 | if(cna[y]!=0 || cnt[y]!=0 || cnc[y]!=0){return -1;}
| ^~~
dna.cpp:48:25: error: 'cnt' was not declared in this scope; did you mean 'int'?
48 | if(cna[y]!=0 || cnt[y]!=0 || cnc[y]!=0){return -1;}
| ^~~
| int
dna.cpp:48:38: error: 'cnc' was not declared in this scope
48 | if(cna[y]!=0 || cnt[y]!=0 || cnc[y]!=0){return -1;}
| ^~~
dna.cpp:49:12: error: 'cna' was not declared in this scope
49 | if(cna[y]-cna[x-1]!=0 || cnt[y]-cnt[x-1]!=0 || cnc[y]-cnc[x-1]!=0){return -1;}
| ^~~
dna.cpp:49:34: error: 'cnt' was not declared in this scope; did you mean 'int'?
49 | if(cna[y]-cna[x-1]!=0 || cnt[y]-cnt[x-1]!=0 || cnc[y]-cnc[x-1]!=0){return -1;}
| ^~~
| int
dna.cpp:49:56: error: 'cnc' was not declared in this scope
49 | if(cna[y]-cna[x-1]!=0 || cnt[y]-cnt[x-1]!=0 || cnc[y]-cnc[x-1]!=0){return -1;}
| ^~~
dna.cpp:50:18: error: 'ca' was not declared in this scope
50 | ans+=min(ca[y], ac[y]);
| ^~
dna.cpp:50:25: error: 'ac' was not declared in this scope; did you mean 'sc'?
50 | ans+=min(ca[y], ac[y]);
| ^~
| sc
dna.cpp:50:14: error: 'min' was not declared in this scope; did you mean 'std::min'?
50 | ans+=min(ca[y], ac[y]);
| ^~~
| std::min
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from dna.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: 'std::min' declared here
3474 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
dna.cpp:51:18: error: 'ta' was not declared in this scope; did you mean 'tm'?
51 | ans+=min(ta[y], att[y]);
| ^~
| tm
dna.cpp:51:25: error: 'att' was not declared in this scope
51 | ans+=min(ta[y], att[y]);
| ^~~
dna.cpp:52:18: error: 'tc' was not declared in this scope; did you mean 'tm'?
52 | ans+=min(tc[y], ct[y]);
| ^~
| tm
dna.cpp:52:25: error: 'ct' was not declared in this scope
52 | ans+=min(tc[y], ct[y]);
| ^~
dna.cpp:53:9: error: 'vector' was not declared in this scope
53 | vector<int> v(3);
| ^~~~~~
dna.cpp:53:9: note: suggested alternatives:
In file included from /usr/include/c++/10/vector:67,
from /usr/include/c++/10/functional:62,
from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
from /usr/include/c++/10/algorithm:74,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from dna.cpp:2:
/usr/include/c++/10/bits/stl_vector.h:389:11: note: 'std::vector'
389 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
In file included from /usr/include/c++/10/functional:62,
from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
from /usr/include/c++/10/algorithm:74,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from dna.cpp:2:
/usr/include/c++/10/vector:86:13: note: 'std::pmr::vector'
86 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
| ^~~~~~
dna.cpp:53:16: error: expected primary-expression before 'int'
53 | vector<int> v(3);
| ^~~
dna.cpp:54:9: error: 'v' was not declared in this scope
54 | v[0]=max(ca[y], ac[y])-min(ca[y], ac[y]);
| ^
dna.cpp:54:14: error: 'max' was not declared in this scope; did you mean 'std::max'?
54 | v[0]=max(ca[y], ac[y])-min(ca[y], ac[y]);
| ^~~
| std::max
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from dna.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: 'std::max' declared here
3486 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
dna.cpp:57:9: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
57 | sort(all(v));
| ^~~~
| std::sort
In file included from /usr/include/c++/10/algorithm:74,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from dna.cpp:2:
/usr/include/c++/10/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
dna.cpp:62:12: error: 'cna' was not declared in this scope
62 | if(cna[y]-cna[x-1]!=0 || cnt[y]-cnt[x-1]!=0 || cnc[y]-cnc[x-1]!=0){return -1;}
| ^~~
dna.cpp:62:34: error: 'cnt' was not declared in this scope; did you mean 'int'?
62 | if(cna[y]-cna[x-1]!=0 || cnt[y]-cnt[x-1]!=0 || cnc[y]-cnc[x-1]!=0){return -1;}
| ^~~
| int
dna.cpp:62:56: error: 'cnc' was not declared in this scope
62 | if(cna[y]-cna[x-1]!=0 || cnt[y]-cnt[x-1]!=0 || cnc[y]-cnc[x-1]!=0){return -1;}
| ^~~
dna.cpp:63:18: error: 'ca' was not declared in this scope
63 | ans+=min(ca[y]-ca[x-1], ac[y]-ac[x-1]);
| ^~
dna.cpp:63:33: error: 'ac' was not declared in this scope; did you mean 'sc'?
63 | ans+=min(ca[y]-ca[x-1], ac[y]-ac[x-1]);
| ^~
| sc
dna.cpp:63:14: error: 'min' was not declared in this scope; did you mean 'std::min'?
63 | ans+=min(ca[y]-ca[x-1], ac[y]-ac[x-1]);
| ^~~
| std::min
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from dna.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: 'std::min' declared here
3474 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
dna.cpp:64:18: error: 'ta' was not declared in this scope; did you mean 'tm'?
64 | ans+=min(ta[y]-ta[x-1], att[y]-att[x-1]);
| ^~
| tm
dna.cpp:64:33: error: 'att' was not declared in this scope
64 | ans+=min(ta[y]-ta[x-1], att[y]-att[x-1]);
| ^~~
dna.cpp:65:18: error: 'tc' was not declared in this scope; did you mean 'tm'?
65 | ans+=min(tc[y]-tc[x-1], ct[y]-ct[x-1]);
| ^~
| tm
dna.cpp:65:33: error: 'ct' was not declared in this scope
65 | ans+=min(tc[y]-tc[x-1], ct[y]-ct[x-1]);
| ^~
dna.cpp:66:9: error: 'vector' was not declared in this scope
66 | vector<int> v(3);
| ^~~~~~
dna.cpp:66:9: note: suggested alternatives:
In file included from /usr/include/c++/10/vector:67,
from /usr/include/c++/10/functional:62,
from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
from /usr/include/c++/10/algorithm:74,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from dna.cpp:2:
/usr/include/c++/10/bits/stl_vector.h:389:11: note: 'std::vector'
389 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
In file included from /usr/include/c++/10/functional:62,
from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
from /usr/include/c++/10/algorithm:74,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from dna.cpp:2:
/usr/include/c++/10/vector:86:13: note: 'std::pmr::vector'
86 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
| ^~~~~~
dna.cpp:66:16: error: expected primary-expression before 'int'
66 | vector<int> v(3);
| ^~~
dna.cpp:67:9: error: 'v' was not declared in this scope
67 | v[0]=max(ca[y]-ca[x-1], ac[y]-ac[x-1])-min(ca[y]-ca[x-1], ac[y]-ac[x-1]);
| ^
dna.cpp:67:14: error: 'max' was not declared in this scope; did you mean 'std::max'?
67 | v[0]=max(ca[y]-ca[x-1], ac[y]-ac[x-1])-min(ca[y]-ca[x-1], ac[y]-ac[x-1]);
| ^~~
| std::max
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from dna.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: 'std::max' declared here
3486 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
dna.cpp:70:9: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
70 | sort(all(v));
| ^~~~
| std::sort
In file included from /usr/include/c++/10/algorithm:74,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from dna.cpp:2:
/usr/include/c++/10/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~