θ§£ζ³δΈ
θ©εη΅ζ(εθ) οΌ AC (3ms, 332KB)
#include <bits/stdc++.h>
using namespace std;
int letter2num(char c){
switch(c){
case 'A': return 1+0*9; case 'N': return 2+2*9;
case 'B': return 1+1*9; case 'O': return 3+5*9;
case 'C': return 1+2*9; case 'P': return 2+3*9;
case 'D': return 1+3*9; case 'Q': return 2+4*9;
case 'E': return 1+4*9; case 'R': return 2+5*9;
case 'F': return 1+5*9; case 'S': return 2+6*9;
case 'G': return 1+6*9; case 'T': return 2+7*9;
case 'H': return 1+7*9; case 'U': return 2+8*9;
case 'I': return 3+4*9; case 'V': return 2+9*9;
case 'J': return 1+8*9; case 'W': return 3+2*9;
case 'K': return 1+9*9; case 'X': return 3+0*9;
case 'L': return 2+0*9; case 'Y': return 3+1*9;
case 'M': return 2+1*9; case 'Z': return 3+3*9;
}
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
char in[10] = {0};
cin >> in;
int x = 0;
for(int i=1; i<9; i++){
x += (in[i]-'0') * (9-i);
}
x += letter2num(in[0]);
x += in[9] - '0';
if(x%10 == 0) cout << "real";
else cout << "fake";
return 0;
}