Submission #201303

#TimeUsernameProblemLanguageResultExecution timeMemory
201303ArKCaMobitel (COCI14_mobitel)C++17
50 / 50
6 ms504 KiB
#include<bits/stdc++.h> #define f1 first #define s2 second #define pb push_back #define pob pop_back #define int ll #define ll long long #define PII pair<int,int> #define N 11 using namespace std; int n,a,last,b; int dizi[N]; string s; int calc(char c){ if( c=='a' || c=='b' || c=='c' )return 2; if( c=='d' || c=='e' || c=='f' )return 3; if( c=='g' || c=='h' || c=='i' )return 4; if( c=='j' || c=='k' || c=='l' )return 5; if( c=='m' || c=='n' || c=='o' )return 6; if( c=='t' || c=='u' || c=='v' )return 8; if( c=='p' || c=='q' || c=='r' || c=='s' )return 7; if( c=='w' || c=='x' || c=='y' || c=='z' )return 9; } int calc1(char c){ if( c=='a' || c=='d' || c=='g' || c=='j' || c=='m' || c=='t' || c=='p' || c=='w' )return 1; if( c=='b' || c=='e' || c=='h' || c=='k' || c=='n' || c=='u' || c=='q' || c=='x' )return 2; if( c=='c' || c=='f' || c=='i' || c=='l' || c=='o' || c=='v' || c=='r' || c=='y' )return 3; if( c=='s' || c=='z' )return 4; } int32_t main(){ // freopen("a.gir","r",stdin); // freopen("a.cik","w",stdout); for(int i=1;i<=9;i++){ scanf("%lld",&a); dizi[a]=i; } cin>>s; for(int i=0;i<s.size();i++){ a=calc(s[i]); b=calc1(s[i]); if(a==last) printf("#"); while(b--) printf("%lld",dizi[a] ); last=a; } }

Compilation message (stderr)

mobitel.cpp: In function 'int32_t main()':
mobitel.cpp:43:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<s.size();i++){
              ~^~~~~~~~~
mobitel.cpp: In function 'long long int calc(char)':
mobitel.cpp:27:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
mobitel.cpp: In function 'long long int calc1(char)':
mobitel.cpp:33:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
mobitel.cpp: In function 'int32_t main()':
mobitel.cpp:39:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld",&a);
   ~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...