Submission #100388

#TimeUsernameProblemLanguageResultExecution timeMemory
100388AKaan37Marko (COCI15_marko)C++17
50 / 50
232 ms40864 KiB
//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)

marko.cpp: In function 'int main()':
marko.cpp:53:15: warning: array subscript has type 'char' [-Wchar-subscripts]
    diz[s[i][j]]++;
               ^
marko.cpp:54:18: warning: array subscript has type 'char' [-Wchar-subscripts]
    if(diz[s[i][j]]>mpp[s[i][j]]){flag=1;break;}
                  ^
marko.cpp:33:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld",&n);
  ~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...