목록전체 글 (251)
정화 코딩

가장 긴 증가하는 부분 수열 (백준 11053번) https://www.acmicpc.net/problem/11053 import sysinput = sys.stdin.readlinen = int(input())a = list(map(int, input().split()))dp = [0 for _ in range(n)]maxa = 0for i in range(n): maxt = 0 for j in range(i): if a[i] > a[j]: maxt = max(maxt, dp[j]) dp[i] = maxt + 1 maxa = max(maxa, dp[i])print(maxa)dp[i] : 0부터 i까지 i를 포함하는 가장 길게 증가하는 수열의 길이앞의..

https://www.acmicpc.net/problem/21919 #include #include #include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; vector a = vector(n); for (int i = 0; i > a[i]; } int cnt = 0; long long ans = 1; for (int x: a) { //! bool isPrime = true; double tmp = sqrt(x); if (tmp * tmp == x) { ..
객체와 프로퍼티// 객체 (Object){// key value brandName: '코드잇'; // 속성 (Property) bornYear: '2017';}// 자료형: object 객체에서 데이터 접근하기// 점 표기법objectName.propertyName// 대괄호 표기법objectName['propertyName'] 실습 - 영어 단어장 1let myVoca = { function: '함수', variable: '변수', constant: '상수', local: '지역의', global: '전반적인',};console.log(myVoca);console.log(myVoca.local);console.log(myVoca.constant);console.log(myVoc..

https://www.acmicpc.net/problem/11723 #include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int m, n; string op; cin >> m; int now = 0; for (int i = 0; i > op; if (op == "add") { cin >> n; now = now | (1 > n; if ((now & (1 > n; if ((now & (1 > n; now = now ^ (1 (정답) 비트..
문자열 실습 1console.log("한국 영화 역사상 아카데미상을 받은 것은 '기생충'이 처음이다.");console.log('아리스토텔레스는 "인간은 사회적 동물이다."라고 말했다.'); 문자열 실습 2console.log(`영화 '베테랑'에서 "어이가 없네~"라는 대사가 유명했다.`); 불린형console.log(3 === 3); // 일치 (형변환 X)console.log(3 !== 3); // 불일치 (형변환 X)console.log(3 == 3); // 동등 (형변환 O)console.log(3 != 3); // 부등 (형변환 O)console.log(2 === '2'); // false (=== : 엄격한 비교)console.log(2 == '2'); // true (== ..
출력console.log(10) // 출력 결과: 10 변수 선언 및 초기화let x; // 변수 선언x = 10; // 변수 초기화let x = 10; // 변수 선언 + 초기화 실습 - 커피 메뉴별 칼로리 출력// 재료별 칼로리let espresso = 10;let milk = 170;let chocolateSyrup = 50;let whippedCream = 60;// 메뉴별 칼로리 테스트console.log(espresso); // 에스프레소 칼로리console.log(espresso + milk); // 라떼 칼로리console.log(espresso + chocolateSyrup + milk); // 모카 칼로리console.log(espresso + chocolateSyrup + milk +..

AtCoder Beginner Contest 354 (https://atcoder.jp/contests/abc354) A. Exponential Plant https://atcoder.jp/contests/abc354/tasks/abc354_a //C++#include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int h; cin >> h; int curh = 0; int day = 0; int growth = 1; while (curh (정답) B. AtCoder Janken 2 https://atcoder.jp/contests/abc35..

093. Dance Dance Revolution (백준 2342번) https://www.acmicpc.net/problem/2342 import sysinput = sys.stdin.readlinedata = list(map(int, input().split()))n = len(data) - 1l = [0 for _ in range(n + 1)]r = [0 for _ in range(n + 1)]p = [0 for _ in range(n + 1)]for i in range(n): if l[i] == data[i] or r[i] == data[i]: l[i + 1] = l[i] r[i + 1] = r[i] p[i + 1] = p[i] + 1 elif l[..