Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

A Multiplication Game/김태진: Difference between revisions

From ZeroWiki
imported>jereneal20
No edit summary
 
imported>jereneal20
No edit summary
 
Line 42: Line 42:
     return 0;
     return 0;
  }
  }
* 별 ㅈㄹ을 다해도 accept가 뜨지 않아서 포기하고 영기가 푼걸 봤는데, 얼핏보니까 풀이가 똑같잖아?
* 별 ㅈㄹ을 다해도 accept가 뜨지 않아서 포기하고 영기가 푼걸 봤는데, 얼핏보니까 풀이가 같은 방식이잖아? 뭐가 문제지??
 
----
[[ACM_ICPC/2012년스터디]]



Latest revision as of 19:07, 20 August 2012

코드

#include <stdio.h>

int main()
{
	int i,j;
	long long int n=0,p,count=0;

	for(;!feof(stdin);){
		count=0;
		if(n!=0){
			printf("\n");
		}
		scanf("%lld",&n);
		p=n;
		for(i=0;p>1;i++){
			if(count%2==0){
				if(p%9!=0){
					p=p/9+1;
				}else{
					p/=9;
				}
			}else{
				if(p%2!=0){
					p=p/2+1;
				}else{
					p/=2;
				}
			}
			count++;
		}
		if(count%2!=0){
			printf("Stan wins.");
		}else{
			printf("Ollie wins.");
		}
		
		
	}
	
	
    return 0;
}
  • 별 ㅈㄹ을 다해도 accept가 뜨지 않아서 포기하고 영기가 푼걸 봤는데, 얼핏보니까 풀이가 같은 방식이잖아? 뭐가 문제지??

ACM_ICPC/2012년스터디