일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
31 |
- 정처기
- AMBA BUS
- linux
- Beakjoon
- 자격증
- HDLBits
- FPGA
- chip2chip
- 코딩테스트
- verilog
- Vivado
- UNIX
- baekjoon
- 정보처리기사
- java
- Zynq
- amba
- C++
- 백준
- Bus
- vitis
- hdl
- verilog HDL
- Xilinx
- 실기
- Backjoon
- boj
- SQL
- 리눅스
- axi
- Today
- Total
목록PS/programmers (6)
Hueestory

접근1. 시계방향으로 이동 중 배열의 끝에 닿거나 다음으로 이동할 칸에 이미 0이 아닌 값이 들어가 있으면 방향 전환2. 방향 전환은 x(행), y(열)로 접근3. (dx, dy)에서 →(0, 1), ↓(1, 0), ←(0,-1), ↑(-1, 0)4. 이를 dx와 dy로 나누면 dx = [0, 1, 0, -1], dy = [1, 0, -1, 0] 코드def solution(n): answer = [[0] * n for _ in range(n)] x, y = 0, 0 dir = 0 # 0(→), 1(↓), 2(←), 3(↑) dx = [0, 1, 0, -1] dy = [1, 0, -1, 0] for i in range(1, n**2+1): answ..

#include #include #include using namespace std;vector solution(vector record) { vector answer; map m1; vector> tmp; for (auto x : record){ int a = x.find(" "); int b = x.find(" ", a + 1); string ioc = x.substr(0, a); string uid = x.substr(a + 1, b - a - 1); if (ioc == "Enter"){ string name = x.substr(b + 1); m1[uid..

#include #include #include #include using namespace std;vector solution(vector fees, vector records) { vector answer; map tmp, cnt; for (auto s : records){ int time = stoi(s.substr(0, 2)) * 60 + stoi(s.substr(3, 2)); int car_num = stoi(s.substr(6, 4)); if (s.substr(11) == "IN") tmp[car_num] = time; else{ cnt[car_num] += time - tmp[car_num]; ..

#include #include #include #include using namespace std;string solution(string new_id) { // 1단계 transform (new_id.begin(), new_id.end(), new_id.begin(), ::tolower); // 2단계 string tmp = ""; for (auto x : new_id){ if (isalpha(x) || isdigit(x) || x == '-' || x == '_' || x == '.') tmp += x; } new_id = tmp; tmp = ""; // 3단계 for (auto x : new..

#include #include #include #include #include using namespace std;bool isPrime(long long num){ if (num 0){ s += to_string(n % k); n /= k; } reverse(s.begin(), s.end()); string tmp = ""; for(char x : s){ if(x == '0'){ if(!tmp.empty() && isPrime(stoll(tmp))) answer++; tmp = ""; } else tmp += x; } i..