# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
100388 | AKaan37 | Marko (COCI15_marko) | C++17 | 232 ms | 40864 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//Sani buyuk Osman Pasa Plevneden cikmam diyor.
//Bismillahirrahmanirrahim
#include <bits/stdc++.h>
using namespace std;
typedef long long int lo;
typedef pair< int,int > PII;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(int i=1;i<=n;i++)
#define mid (bas+son)/2
const lo MAX = -1000000000000000000;
const lo MIN = 1000000000000000000;
const lo inf = 1000000000;
const lo KOK = 100000;
const lo LOG = 30;
const lo li = 1000005;
const lo mod = 1000000007;
lo n,m,cev,b,a[li],k,diz[li];
string s[li];
string ss;
vector<lo> v;
map<lo,lo> mpp;
int main(){
scanf("%lld",&n);
FOR{
cin>>s[i];
}
cin>>ss;
for(lo i=0;i<(lo)ss.size();i++) mpp[ss[i]-'0']++;
FOR{
if(ss.size()!=s[i].size())continue;
lo flag=0;
memset(diz,0,sizeof(diz));
for(lo j=0;j<(lo)s[i].size();j++){
if(s[i][j]=='a' || s[i][j]=='b' || s[i][j]=='c') s[i][j]=2;
if(s[i][j]=='d' || s[i][j]=='e' || s[i][j]=='f') s[i][j]=3;
if(s[i][j]=='g' || s[i][j]=='h' || s[i][j]=='i') s[i][j]=4;
if(s[i][j]=='j' || s[i][j]=='k' || s[i][j]=='l') s[i][j]=5;
if(s[i][j]=='m' || s[i][j]=='n' || s[i][j]=='o') s[i][j]=6;
if(s[i][j]=='p' || s[i][j]=='q' || s[i][j]=='r' || s[i][j]=='s') s[i][j]=7;
if(s[i][j]=='w' || s[i][j]=='x' || s[i][j]=='y' || s[i][j]=='z') s[i][j]=9;
if(s[i][j]=='t' || s[i][j]=='u' || s[i][j]=='v') s[i][j]=8;
if(s[i][j]==' ') s[i][j]=1;
diz[s[i][j]]++;
if(diz[s[i][j]]>mpp[s[i][j]]){flag=1;break;}
}
if(flag==0) cev++;
}
printf("%lld\n",cev);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |