최근 글
[정올] 1370 / [백준] 1931 / 회의실 배정

#include using namespace std; struct Meet { int st; int ed; int id; }; bool sort_func(Meet a, Meet b) { if (a.ed == b.ed) { return a.st > n; vector meets; for (int i = 0; i > a.id >> a.st >> a.ed; meets.push_back(a); } sort(meets.begin(), meets..

[정올] 1341 / 구구단2

#include int main(){ while(1){ int a , b; scanf("%d %d" , &a , &b); if(a 9 || b 9) { printf("INPUT ERROR!\n"); continue; } if(a < b){ for(int i = a;i

[정올] 1335 / [백준] 2630 / 색종이 만들기(영역구분)

#include using namespace std; typedef long long ll; typedef pair pii; const int NOTHING = 0; const int ALLWHIT = 1; const int ALLBLUE = 2; const int WHITEPA = 0; const int BLUEPAI = 1; int n; // board[y][x] int board[130][130]; int ansWhite = 0; int ansBlue = 0; int allSomeThing(int stX , int stY , int edX , int edY){ bool allWhite = true; bool allBlue = true; for(int i = stY;i

[정올] 1328 / 빌딩

#include using namespace std; typedef long long ll; typedef pair pii; int n; stack st; int outs[100005]; int main(){ cin >> n; for(int i = 0;i > nowHei; while(!st.empty() && st.top().first < nowHei){ outs[st.top().second] = i + 1; st.pop(); } st.push({nowHei , i}); } while(!st.empty()){ outs[st.top().second] = 0; st.pop(); } for(int i = 0;i < n;i++) cout

[정올] 1318 / [poj] 1338 / 못생긴 수

#include #include #include #include #include using namespace std; typedef long long ll; ll arr[1505]; int main(){ cin.tie(0); cout.tie(0); priority_queue pq; pq.push(1); int ah = 1; set ins; while(ins.size() < 1500) { // cout

[정올] 1309 / 팩토리얼

#include using namespace std; long long n; long long factory(long long num){ if(num == 0) return 1ll; if(num == 1) { cout

[정올] 1303 / 숫자사각형1

#include int main(){ int n , m; scanf("%d %d" , &n , &m); for(int i = 0;i < n;i++){ for(int j = 1;j

[정올] 1235 / 악수

#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}; int p; int likeBeer[1005]; int dp[1005][1005]; bool used[1005]; int main() {..

[정올] 1291 / 구구단

#include int main(){ while(1){ int a , b; scanf("%d %d" , &a , &b); if(a 9 || b 9) { printf("INPUT ERROR!\n"); continue; } if(a < b){ for(int i = 1;i