/*
* coin.cpp
*
* Created on: 2016. 2. 25.
* Author: SeoYoungHak
*/
#include <stdio.h>
#include <math.h>
int ans;
int coin(int n){
if(n<=2){
return 1;
}
/*for(int i=0; i<n;i++)
{
if(i%2){
//홀수
ans++;
}else{
ans++;
}
}*/
return pow(2,n-2);
}
int main()
{
int n;
scanf("%d",&n);
printf("%d",coin(n));
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1280 KB |
Output is correct |
2 |
Correct |
0 ms |
1280 KB |
Output is correct |
3 |
Correct |
0 ms |
1280 KB |
Output is correct |
4 |
Correct |
0 ms |
1280 KB |
Output is correct |
5 |
Correct |
0 ms |
1280 KB |
Output is correct |
6 |
Incorrect |
0 ms |
1280 KB |
Output isn't correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |