제출 #636334

#제출 시각아이디문제언어결과실행 시간메모리
636334hy_1DNA 돌연변이 (IOI21_dna)C++17
0 / 100
34 ms2388 KiB
#include "dna.h" #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <cmath> #include <locale> #include <map> #include <memory> #include <new> #include <numeric> #include <ostream> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdexcept> #include <streambuf> #include <string> #include <typeinfo> #include <utility> #include <valarray> #include <vector> #include <unordered_map> using namespace std; #define MOD 1000000007 #define all(x) x.begin(),x.end() #define ios ios_base::sync_with_stdio(0);cin.tie(0); string s1 , s2; void init(string a, string b) { s1 = a; s2 = b; } int get_distance(int x, int y) { string a,b; a= b = ""; for(int i =x; i<=y; i++){ a += s1[i]; b += s2[i]; } string e = a; string h = b; sort(all(e)); sort(all(h)); if(e != h){ return -1; } if(a.size() == 2){ return 1; }else{ for(int i =0; i <a.size(); i++){ if(a[i] == b[i]){ return 1; } } return 2; } } // int main(){ // string a,b; cin >> a >> b; // init(a,b); // int l,r; cin >> l >> r; // cout << get_distance(l,r) << endl; // return 0; // }

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

dna.cpp: In function 'int get_distance(int, int)':
dna.cpp:67:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   67 |         for(int i =0; i <a.size();  i++){
      |                       ~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...