Submission #84380

# Submission time Handle Problem Language Result Execution time Memory
84380 2018-11-14T20:50:04 Z l_zg Mobitel (COCI14_mobitel) C++14
0 / 50
3 ms 380 KB
#include <bits/stdc++.h>
using namespace std;
long long x,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,y,z,stari, novi;
string word;
int main (){
ios::sync_with_stdio(0);
cin.tie(0);
	for (int I=1;I<10;I++){
		cin >> x;
		if (x==1) continue;
		else if (x==2){
			a = I;
			b = I*11;
			c = I*111;
		}
		else if (x==3){
			d = I;
			e = I*11;
			f = I * 111;
		}
		else if (x==4){
			g = I;
			h = I * 11;
			i = I * 111;
		}
		else if (x==5){
			j = I;
			k = I * 11;
			l = I * 111;
		}
		else if (x==6){
			m = I;
			n = I * 11;
			o = I * 111;
		}
		else if (x==7){
			p = I;
			q = I * 11;
			r = I * 111;
			s = I * 1111;
		}
		else if (x==8){
			t = I;
			u = I * 11;
			v = I * 111;
		}
		else if (x==9){
			w = I;
			y = I * 111;
			z = I * 1111;
			x = I * 11;
		}
	}
	cin >> word;
	for (int i=0; i< word.size();i++){
		if (word.at(i) == 'a') stari = a;
		else if (word.at(i) == 'b') stari = b;
		else if (word.at(i) == 'c') stari = c;
		else if (word.at(i) == 'd') stari = d;
		else if (word.at(i) == 'e') stari = e;
		else if (word.at(i) == 'f') stari = f;
		else if (word.at(i) == 'g') stari = g;
		else if (word.at(i) == 'i') stari = i;
		else if (word.at(i) == 'j') stari = j;
		else if (word.at(i) == 'k') stari = k;
		else if (word.at(i) == 'l') stari = l;
		else if (word.at(i) == 'm') stari = m;
		else if (word.at(i) == 'n') stari = n;
		else if (word.at(i) == 'o') stari = o;
		else if (word.at(i) == 'p') stari = p;
		else if (word.at(i) == 'q') stari = q;
		else if (word.at(i) == 'r') stari = r;
		else if (word.at(i) == 's') stari = s;
		else if (word.at(i) == 't') stari = t;
		else if (word.at(i) == 'u') stari = u;
		else if (word.at(i) == 'v') stari = v;
		else if (word.at(i) == 'w') stari = w;
		else if (word.at(i) == 'x') stari = x;
		else if (word.at(i) == 'y') stari = y;
		else if (word.at(i) == 'z') stari = z;
		if (i>0 && stari % 10 == novi % 10) cout << "#";
		cout << stari;
		novi = stari;
	}
return 0;
}

Compilation message

mobitel.cpp: In function 'int main()':
mobitel.cpp:55:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i=0; i< word.size();i++){
                ~^~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 380 KB Output isn't correct
2 Halted 0 ms 0 KB -