최근 글
[마인크래프트 에서 컴퓨터 만들기] Memory!

마인크래프트에서 컴퓨터 만들기의 첫걸음! 9.18에 만든 4byte 메모리이다. 디나상과 함게 만들었고 3시간 정도 걸린거 같다. 32bit 저장하겠다고 853776m^3를 사용해 버렸다. 힘들어서 더 크게는 안만들었다.

[정올] 1889 / N Queen

#include using namespace std; typedef long long ll; typedef pair pii; int ans = 0 , n;; // board[y] = x // y번째 줄에는 x번째 칸에 queen이 있다 int board[15]; bool ok(int step){ for(int i = 0;i < step;i++){ if(board[i] == board[step]) return false; // 위 아래 if(step - i == abs(board[step] - board[i])) return false; // 대각선 } return true; } void st(int step){ if(step == n){ ans++; return; } for(int i = 0;i < n;..

[정올] 1863 / 종교

#include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long ull; typedef pair pii; typedef signed char i8; typedef short i16; typedef int i32; typedef long long i64; int dx[] = {0, 0, 1, -1}; int dy[] = {1, -1, 0, 0}; // union find // max 50000 people // max 100000 joins int n, m; int unionPar..

[정올] 1856 / 숫자사각형2

#include int main(){ int n , m; scanf("%d %d" , &n , &m); for(int i = 0;i < n;i++){ if(i % 2 == 0){ for(int j = 1;j = 1;j--){ printf("%d " , i * m + j); } } printf("\n"); } }

[정올] 1841 / 월드컵

#include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair pii; typedef vector vi; int dx[] = {0 , 0 , 1 , -1}; int dy[] = {1 , -1 , 0 , 0}; // games[Country][Win | Same | Lose] int games[10][5]; int result_games[10][5]; int team1[] = { 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4 }; int team2[] = { 1, 2, 3, 4,..

[정올] 1840 / [백준] 2636 / 치즈

#include using namespace std; typedef pair pii; int n, m; int board[100][100]; bool visited[100][100]; bool air[100][100]; int dy[4] = { -1, 0, 1, 0 }; int dx[4] = { 0, 1, 0, -1 }; int main() { int cnt = 0; int ans = 0; cin >> n >> m; for (int i = 0; i > board[i][j]; visited[i][j] = false; air[i][j] = true; if (board[i][j] == 1) cnt++; } } int hour ..

[정올] 1828 / 냉장고

#include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair pi_i; pi_i arr[201]; bool cmp(pi_i a, pi_i b) { if (a.second == b.second) return a.first > n; for(int i = 0;i > arr[i].first >> arr[i].second; } sort(arr , arr ..

[정올] 1824 / 스도쿠

#include using namespace std; typedef long long ll; typedef pair pii; // board[y][x] = dt int board[10][10]; bool usedX[12][12]; bool usedY[12][12]; bool usedRec[5][5][12]; // emptys[idx] = {y , x}; vector emptys; bool able(int y , int x , int dt){ return ( usedX[y][dt] == false && usedY[x][dt] == false && usedRec[y / 3][x / 3][dt] == false ); } void doIt(int empIdx){ if(empIdx == emptys.size())..

[정올] 1816 / 외양간

#include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair pi_i; int arr[201]; int arrTwo[201]; int m, s, c, ans; int main() { cin >> m >> s >> c; for (int i = 0; i > arr[i]; } sort(arr, arr + c); for (int i = 0; i < c - 1; i++) { arrTwo[i] = arr[i + 1] - arr[i]; } sort(arrTwo, arrTwo + c); for (int i = 0; i < ..