Q

@qazsxc2

2447 별

C++
2 months ago
#include <bits/stdc++.h> using namespace std; void star(int x, int y, int n){ if((x/n)%3==1 && (y/n)%3==1) cout <<' '; else { if(n/3==0) cout << '*'; else { star(x,y,n/3); }

1992 쿼드트리

C++
2 months ago
#include <bits/stdc++.h> using namespace std; string board[70]; bool check(int x, int y,int n) { for(int i=x; i<x+n; i++) { for(int j=y; j<y+n; j++){ if(board[x][y]!=board[i][j]) return false; } } return true;

색종이 만들기

C++
2 months ago
#include <bits/stdc++.h> using namespace std; int n; int res[2]; int board[150][150]; bool check(int x,int y,int n) { for(int i=x;i<x+n; i++){ for(int j=y; j<y+n;j++) {

1780 종이의 개수

C++
2 months ago
#include <bits/stdc++.h> using namespace std; int n; int res[4]; int board[2200][2200]; bool check(int x,int y,int n) { for(int i=x; i<x+n; i++) { for(int j=y; j<y+n; j++) { if(board[x][y]!=board[i][j]) return false;

17478 재귀함수가 뭔가요?

C++
2 months ago
#include <bits/stdc++.h> using namespace std; int n; void print(const char *str,int n) { for(int i=0; i<n; i++) cout <<"____"; cout << str; return; } void fun(int cnt) { print("\"재귀함수가 뭔가요?\"\n",cnt);

1074 Z

C++
2 months ago
#include <bits/stdc++.h> using namespace std; int Z(int n,int r,int c) { if(n==0) return 0; int half=1<<(n-1); if(r<half && c<half) return Z(n-1,r,c); else if(r<half && c>=half) return half*half + Z(n-1,r,c-half); else if(r

11729 하노이 타워

C++
2 months ago
#include <bits/stdc++.h> using namespace std; using ll=long long; void hanoi(int st,int en, int n){ if(n==1) { cout << st << ' ' << en << '\n'; return; } hanoi(st,6-st-en,n-1);

1629 곱셈

C++
2 months ago
#include <bits/stdc++.h> using namespace std; using ll=long long; //f(1)=a,,f(k)=x -> f(k**2)=x*x,,f(k**2+1)=x*x*a; ll func1(ll a,ll b, ll c){ if(b==1) return a%c; ll res=func1(a,b/2,c); res=res*res%c; if(b%2==0) return res;

16920 확장게임

C++
2 months ago
#include <bits/stdc++.h> using namespace std; #define X first #define Y second int dx[]={1,0,-1,0}; int dy[]={0,1,0,-1}; string board[1005];

16920 확장 게임

C++
2 months ago
#include <bits/stdc++.h> using namespace std; #define X first #define Y second int dx[]={1,0,-1,0}; int dy[]={0,1,0,-1}; string board[1005];

14442 벽 부수고 이동하기 2

C++
2 months ago
#include <bits/stdc++.h> using namespace std; #define X first #define Y second int dx[]={1,0,-1,0}; int dy[]={0,1,0,-1}; int n;

1600 말이 되고픈 원숭이

C++
2 months ago
#include <bits/stdc++.h> using namespace std; #define X first #define Y second int dx[]={1,0,-1,0}; int dy[]={0,1,0,-1}; int hx[]={-2, -1, 1, 2, 2, 1, -1, -2}; int hy[]={1, 2, 2, 1, -1, -2, -2, -1};

13913 숨바꼭질 4

C++
2 months ago
#include <bits/stdc++.h> using namespace std; #define X first #define Y second int dx[]={-1,1}; int n,k; int board[100005]; int pre[100005];

13549 숨바꼭질 3

C++
2 months ago
#include <bits/stdc++.h> using namespace std; #define X first #define Y second int dx[]={-1,1}; int n,k; int board[200005];

2146 다리 만들기

C++
3 months ago
#include <bits/stdc++.h> using namespace std; #define X first #define Y second int dx[]={1,0,-1,0}; int dy[]={0,1,0,-1}; int n; int board[105][105];

9466 텀 프로젝트

C++
3 months ago
#include <bits/stdc++.h> using namespace std; #define X first #define Y second int state[100005]={0}; int num[100005]={0}; const int IN=-1;

2206 벽 부수고 이동하기

C++
3 months ago
#include <bits/stdc++.h> using namespace std; #define X first #define Y second int dx[]={1,0,-1,0}; int dy[]={0,1,0,-1}; int n,m; string board[1003];

5014 스타트링크

C++
3 months ago
#include <iostream> #include <queue> #include <algorithm> #include <vector> using namespace std; #define X first #define Y second int board[1000001];

2573 빙산

C++
3 months ago
#include <bits/stdc++.h> using namespace std; #define X first #define Y second int n, m, year=0; int area[303][303]; int vis[303][303]; int dx[] = {1, 0, -1, 0};

ㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗ

C++
3 months ago
#include <iostream> #include <string> #include <queue> #include <algorithm> using namespace std; #define X first #define Y second int board[302][302]={0};