Submission #167376

# Submission time Handle Problem Language Result Execution time Memory
167376 2019-12-07T18:54:20 Z 44442 Marko (COCI15_marko) C++11
0 / 50
9 ms 1528 KB
#include <bits/stdc++.h>
using namespace std;
long long n,b,a,ok,okk,d,c;
string s[1004];
int main (){
ios::sync_with_stdio(0);
cin>>n;
for(int i=0;i<n;i++){
	 cin>>s[i];
}
scanf("%lld",&d);
for(int i=0;i<n;i++){
	 ok=1;
	 a=0;
	 for(int j=s[i].size()-1;j>=0;j--){
	 	 c=(int)s[i][j]-96;
	 	 if(c<=3){
	 	 	 b=2;
		 }
		 else if(c<=6){
		 	 b=3;
		 }
		 else if(c<=9){
		 	 b=4;
		 }
		 else if(c<=12){
		 	 b=5;
		 }
		 else if(c<=15){
		 	 b=6;
		 }
		 else if(c<=18){
		 	 b=7;
		 }
		 else if(c<=21){
		 	 b=8;
		 }
		 else{
		 	 b=9;
		 }
	 	 a=a+b*ok;
	 	 ok=ok*10;
	 	 
	 }
	 if(a==d){
	 	 okk++;
	 }
}
printf("%lld",okk);
return 0;
}

Compilation message

marko.cpp: In function 'int main()':
marko.cpp:11:6: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
 scanf("%lld",&d);
 ~~~~~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Incorrect 2 ms 376 KB Output isn't correct
4 Incorrect 9 ms 1400 KB Output isn't correct
5 Incorrect 3 ms 504 KB Output isn't correct
6 Incorrect 3 ms 504 KB Output isn't correct
7 Incorrect 7 ms 1016 KB Output isn't correct
8 Incorrect 9 ms 1528 KB Output isn't correct
9 Incorrect 3 ms 504 KB Output isn't correct
10 Incorrect 7 ms 1144 KB Output isn't correct