Algorithm

[BOJ] 15894번 : 수학은 체육과목 입니다

rudgh99_algo 2024. 9. 26. 16:59

1. problem : 

https://www.acmicpc.net/problem/15894

 

 

2. solution 1 :

#include <bits/stdc++.h>
using namespace std;
long long n;

int main(void) {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n; 
	cout << 4 * n;
}

옆면을 옆으로 밀어버리고, 밑면은 밑으로 밀어버리고, 윗면은 위로 밀어버리면, 정사각형이라고 생각할 수 있다. 

설명참조 : https://github.com/encrypted-def/basic-algo-lecture/blob/master/0x12/solutions/15894.cpp

 

basic-algo-lecture/0x12/solutions/15894.cpp at master · encrypted-def/basic-algo-lecture

바킹독의 실전 알고리즘 강의 자료. Contribute to encrypted-def/basic-algo-lecture development by creating an account on GitHub.

github.com