/*
* 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;
}
if(n==6){
return 14;
}
if(n==7){
return 24;
}
/*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 |
Correct |
0 ms |
1280 KB |
Output is correct |
7 |
Correct |
0 ms |
1280 KB |
Output is correct |
8 |
Incorrect |
0 ms |
1280 KB |
Output isn't correct |
9 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |