#include #define M 1000000 class Stack { //Stack을 클래스로 private: int top; char arr[M]; public: Stack() : top(0){} bool isEmpty() { return top == 0;} //스택 비었는가? void push(char e) {arr[top++] = e;} //스택 넣기 char pop() {return arr[--top];} //스택 꺼내기 int cnt() {return top;} //스택의 요소 개수 char peek() {return arr[top-1];} //가장 마지막에 들어간것 }; int main(void) { char c[M] = {0}; scanf("%s", c); //문자열 입력 Stack s;..
import java.util.Scanner; class Stack { private int top = 0; private int arr[]; public Stack() {top=0; arr = new int[80001];} publicboolean isEmpty() {return top == 0;} publicvoid push(int e) {arr[top++] = e;} publicvoid pop() { --top;} publicint peek() {return arr[top-1];} publicint cnt() {return top;} } public class Main { public static void main(String args[]) { Stack s = new Stack(); Scanner..
#include #define M 801 typedef struct Stack { int top; int arr[M]; }Stack; int isEmpty(Stack *s) {return s->top == 0;} void push(Stack *s, int e) {s->arr[s->top++] = e;} int pop(Stack *s) { return s->arr[--s->top];} int peek(Stack *s) {return s->arr[s->top-1];} int cnt(Stack *s) {return s->top;} int main(void) { int n; long long int ans = 0; Stack s; s.top = 0; scanf("%d", &n); while(n--) { stat..
#include #define M 80001 class Stack { //Stack 구현 private: int top; int arr[M]; public: Stack() : top(0) {} //생성자 top = 0 초기화 bool isEmpty() {return top == 0;} //비었는가? void push(int e) {arr[top++] = e;} //넣기 int pop() { return arr[--top];} //빼기 int peek() {return arr[top-1];} //가장 바깥에 있는거 int cnt() {return top;} //스택에 몇개의 요소가 있는가? }; int main(void) { int n; long long int ans = 0; //답은 long long ..
- Total
- Today
- Yesterday
- BFS
- C언어
- 누적 합
- union
- Lazy Propagation
- 브루트포스
- Segment Tree
- 1835번
- 스택
- 세그먼트 트리
- 그리디
- 누적합
- DFS
- 정렬
- 최소 스패닝 트리
- 플로이드
- 최대공약수
- 덱
- 그래프
- C++
- PASCAL
- DP
- Krustal
- 1835
- java
- 백준
- find
- XOR
- 기하학
- 오프라인 쿼리
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |