This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define FT(i,a,b) for(int i=a; i<=b; ++i)
#define FB(i,a,b) for(int i=a; i>=b; --i)
#define ll long long
#define pii pair<int,int>
#define vi vector<int>
#define vvi vector<vector<int>>
#define vll vector<long long>
#define IO(NAME) \
cin.tie(nullptr)->sync_with_stdio(false); \
if(fopen(NAME ".inp","r")) freopen(NAME ".inp","r",stdin), \
freopen(NAME ".out","w",stdout);
using namespace std;
const long long MOD = 1e9+7;
const int INF = 1e9+1;
const int maxN = 1e5+1;
int toNum(string s){
int l=s.length(),res=0;
if(l==1) return s[0]-'A'+1;
else return (s[0]-'A'+1)*26 + s[l-1]-'A'+1;
return res;
}
void sol() {
string start,stop;
cin>>start>>stop;
cout<<toNum(stop) - toNum(start)+1;
}
int main() {
sol();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |