Submission #483985

#TimeUsernameProblemLanguageResultExecution timeMemory
483985ktkeremMobitel (COCI14_mobitel)C++17
50 / 50
1 ms312 KiB
#include<bits/stdc++.h> using namespace std; using ll = long long; ll _i=0; #define ffn(x) _i=x #define fora(y,x) for(ll y=_i;x>y;y++) #define pb push_back #define pf push_front #define debu cout << "hello\n" #define fi first #define sec second const ll limit =998244353; const ll ous=1000005; void solve(){ vector<vector<char>> kb = {{'a','b','c'} , {'d','e','f'} , {'g','h','i'} , {'j','k','l'} , {'m','n','o'} , {'p','q','r','s'} , {'t','u','v'} , {'w','x','y','z'}}; string h; ll ar[10] , x; fora(i , 9){ cin >> x; ar[x-1] = i+1; } cin >> h; ll n = h.length(); ll pre = -1; fora(i , n){ ll no ,ss , kd=0 , o=0; for(auto j:kb){ ss = 0; for(auto k:j){ ss++; if(k == h[i]){ no = o; kd=1; break; } } o++; if(kd==1){ break; } } if(pre == no){ cout << "#"; } fora(i,ss){ cout << ar[no+1]; } pre=no; } return; } int main(){ ios_base::sync_with_stdio(false);cin.tie(NULL); ll t=1; //cin >> t; while(t--){ solve(); } return 0; }

Compilation message (stderr)

mobitel.cpp: In function 'void solve()':
mobitel.cpp:6:32: warning: 'ss' may be used uninitialized in this function [-Wmaybe-uninitialized]
    6 | #define fora(y,x) for(ll y=_i;x>y;y++)
      |                                ^
mobitel.cpp:26:16: note: 'ss' was declared here
   26 |         ll no ,ss , kd=0 , o=0;
      |                ^~
mobitel.cpp:46:26: warning: 'no' may be used uninitialized in this function [-Wmaybe-uninitialized]
   46 |             cout << ar[no+1];
      |                        ~~^~
#Verdict Execution timeMemoryGrader output
Fetching results...