제출 #1290873

#제출 시각아이디문제언어결과실행 시간메모리
1290873qweqerBliskost (COI23_bliskost)C++20
28 / 100
41 ms8408 KiB
#include <bits/stdc++.h> #define FOR(i, beg, ed, etr) for(ll i = beg;i <= ed;i += etr) #define all(x) x.begin(), x.end() #define F first #define pb push_back #define S second #define con continue using namespace std; typedef long long ll; typedef pair<ll,ll> pii; typedef pair<ll,ll> pll; typedef double db; typedef long double ld; const ll inf = 1e9; const ll INF = 1e18; const ll N = 3e6; const ll MOD = 1e9 + 7; int a[N],b[N]; void solve(){ int n,q ;cin >> n >> q; FOR(i, 1, n , 1){ char c;cin >> c; a[i] = (c - 'a' + 1); } FOR(i, 1, n, 1){ char c;cin >> c; b[i] = (c - 'a' + 1); } if(q == 0){ int ans = 0; FOR(i, 1, n-1, 1){ int dif = (b[i] - a[i]); while(dif != 0){ if(dif < 0){ a[i]--; a[i+1]--; if(a[i+1] == 0)a[i+1] = 26; dif++; } else{ a[i]++; a[i+1]++; if(a[i+1] == 27)a[i+1] = 1; dif--; } } } FOR(i, 1, n, 1){ if(a[i] != b[i]){ cout << "ne"; return; } } cout << "da"; } else{ } } main(){ ios_base::sync_with_stdio(0); cin.tie(0); ll abd = 1; // cin >> abd; FOR(i, 1, abd, 1){ solve(); } }

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

Main.cpp:61:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   61 | main(){
      | ^~~~
#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...