Submission #1112487

#TimeUsernameProblemLanguageResultExecution timeMemory
1112487vjudge1Bliskost (COI23_bliskost)C++17
0 / 100
1 ms336 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define F first #define S second #define all(v) v.begin(),v.end() typedef pair<int,int> ii; typedef pair<int,ii> iii; typedef vector<int> vi; typedef vector<char> vc; typedef vector<bool> vb; typedef vector<ii> vii; typedef set<int> si; typedef map<int,int> mii; const int INF = 2e5 + 100; int n,q; string a,b; int32_t main(){ //freopen("input.txt","r",stdin); //freopen("output.txt","w",stdout); cin >> n >> q >> a >> b; vi differ; for (int i = 0; i < n; i++){ int tmp = b[i] - a[i]; if (tmp < 0) tmp += 26; differ.pb(tmp); //cout << tmp << " "; } bool c = true; for (int i = 0; i < n; i++){ if (differ[i] > differ[i+1]){ c = false; break; } else { differ[i+1] -= differ[i]; } } if (c) cout << "da" << endl; else cout << "ne" << endl; return 0; }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...