제출 #1001623

#제출 시각아이디문제언어결과실행 시간메모리
1001623vjudge1DNA 돌연변이 (IOI21_dna)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define f first #define s second #define pb push_back #define pf push_front #define pi pair<int,int> string a,b; const int MAX = 1e5+1; int n; ll pref[MAX], wrong[MAX]; void init(string A, string B){ a = A; b = B; } int get_distance(int x, int y){ ll add = 0; ll sub = 0; map<char,int>mp; string k = a.substr(x,y-x+1); string h= b.substr(x,y-x+1); sort(k.begin(),k.end()); sort(h.begin(),h.end()); if(h!=k){ return -1; } for(int i = x; i<= y; i++){ if(a[i]!=b[i]){ add++; if(mp[a[i]]){ sub++; mp[a[i]]--; } else mp[b[i]]++; } } //cout << add<<" "<<sub<< " "<< endl; return add-sub; } int main(){ int n,q ; cin >> n >> q; string a,b; cin >> a >>b; init(a,b); int x,y; while(q--){ cin >> x >>y; cout << get_distance(x,y)<<endl; } }

컴파일 시 표준 에러 (stderr) 메시지

/usr/bin/ld: /tmp/cczsguYh.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc1xG19i.o:dna.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status