[SWEA] 8016 홀수 피라미드

Time Lapse :6min 0sec

8016.c

1
2
3
4
5
6
7
8
9
10
11
12
#include <stdio.h> 
int main(int argc, char** argv)
{
int test_case, T;
long long n;
scanf("%d",&T);
for(test_case = 1; test_case <= T; ++test_case){
scanf("%ld",&n);
printf("#%d %ld %ld\n",test_case,(n-1)*(n-1)<<1^1,(n*n<<1)-1);
}
return 0;
}
Author: Song Hayoung
Link: https://songhayoung.github.io/2020/08/04/PS/SWEA/8016/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.