Submission #716238

#TimeUsernameProblemLanguageResultExecution timeMemory
716238kidlinMutating DNA (IOI21_dna)C++17
Compilation error
0 ms0 KiB
#include "dna.h" #include<bits/stdc++.h> #define int long long #define endul endl using namespace std; const int val = 1e3+5; const int inf = 2*(1e9+5); const int mod = 1000000007; int a[val]; int b[val]; void solve() { int n,q; cin >> n >> q; string s,t; cin >> s >> t; for(int i=0;i<q;i++) { int x,y; cin >> x >> y; int T0=0,C0=0,A0=0,T1=0,A1=0,C1=0; int res=0; for(int j=x;j<=y;j++) { if(s[j]=='T') T0++; if(s[j]=='C') C0++; if(s[j]=='A') A0++; if(t[j]=='T') T1++; if(t[j]=='C') C1++; if(t[j]=='A') A1++; if(s[j]!=t[j]) res++; } if(T0!=T1 || C0!=C1 || A1!=A0) { cout << -1 << endl; } else { if(res%2==0) cout << res/2 << endl; else cout << res/2+1 << endl; } } } signed main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int t=1; //cin >> t; while(t--) { solve(); } }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccU1vD9c.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccLMA0ea.o:dna.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccU1vD9c.o: in function `main':
grader.cpp:(.text.startup+0x366): undefined reference to `init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
/usr/bin/ld: grader.cpp:(.text.startup+0x39d): undefined reference to `get_distance(int, int)'
collect2: error: ld returned 1 exit status