Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
myfirst.cpp
//g++ 5.4.0 hursh29 #include <bits/stdc++.h> #define forn(i,a,b) for( i = a ; i < b ; i++ ) #define debug(x) cout << #x << " " << x << "\n" #define speedup ios::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL) #define ll long long int #define MOD 998244353 using namespace std ; #define endl cout << "\n" int i,c ; void solve(){ string s,t ; cin >> s >> t ; forn(i,0,s.size()) if(s[i] != t[i]) c++ ; if(c%2) { cout << "impossible"; return ; } c /= 2 ; forn(i,0,s.size()) if(s[i] != t[i]) { if(c) {cout << s[i] ; c-- ; } else { cout << t[i] ; } } else cout << s[i] ; } int main() { speedup ; int query =1 ; // cin >> query ; while(query--) solve() ; return 0 ; }
run
|
edit
|
history
|
help
0
pm zn moer 2.0
LIS
Graph Theory
temp_new
Listas enlazadas - k-esimo elemento
pi with cmath
A string-integer comparison trick
Get smallest dividers
Dar
Maximum product subarray