코딩테스트
[브1] 16433 - 주디와 당근농장
int main(){ int n, r, c; cin >> n >> r >> c; bool isOdd = ((r + c) % 2) != 0; //char ch = isOdd ? '.' : 'v'; for (int i = 0; i
[HackerRank] New Year Chaos
void minimumBribes(vector q) { int p1=1,p2=2,p3=3; int total=0; for(int i=0;i
[HackerRank] The Bomberman Game
// 상하좌우IntPair dir[]{ { 1, 0 }, {-1, 0 }, { 0, -1 }, { 0, 1 }};vector bomberMan(int n, vector grid){ vector> pos; int r = grid.size(), c = grid[r - 1].size(); if (0 == n % 2) { for (int y = 0; y = 0 && ny = 0 && nx
[브3] 11908 - 카드
int main(){ int n; cin >> n; Vec v(n); for (int i = 0; i > v[i]; sort(v.begin(), v.end()); int res = 0; for (int i = 0; i
[브2] 13235 - 팰린드롬
int main(){ string str, rstr; cin >> str; rstr.assign(str.rbegin(), str.rend()); for (int i = 0; i
[브3] 29722 - 브실혜성
int main(){ // 문자열 생성 string str; int n; stringstream ss; cin >> str >> n; ss nums; while (ss >> num) nums.push_back(abs(num)); // 튜플 생성 auto t = make_tuple(nums[0], nums[1], nums[2]); int y, m, d; tie(y, m, d) = t; d += n; m += (d - 1) / 30; d = (d - 1) % 30 + 1; y += (m - 1) / 12; m = (m - 1) % 12 + 1; cout
[브3] 2476 - 주사위 게임
int main(){ int n, res = 0; cin >> n; while (n--) { int a, b, c, sum = 0; cin >> a >> b >> c; if (a == b && a == c && b == c) sum = 10000 + a * 1000; else if (a != b && a != c && b != c) { int biggest = max(a, max(b, c)); sum = biggest * 100; } else { int val = 0; if (a == b || a == c) val = a; //else if (b == c) else val = b; sum = 1000 + val * 100; } res = max(r..
[브2] 5622 - 다이얼
int main(){ string str; cin >> str; int res = 0, arr[]{3,3,3,4,4,4,5,5,5,6,6,6,7,7,7,8,8,8,8,9,9,9,10,10,10,10}; for (int i = 0; i
[실4] 1018 - 체스판 다시 칠하기
#pragma region 라이브러리#include //#include #include #include #include #include #include #include #include using namespace std;#pragma endregion#pragma region 최적화용#define FAST_IO() ios::sync_with_stdio(0); cin.tie(0);#define y first#define x second#define INIT 9876543210#define MAX_SIZE 8using IntPair = pair;using DoubleVec = vector>;using Vec = vector;// 상하좌우IntPair dir[]{ { 1, 0 }, {-1, 0 }, { 0, ..