본문 바로가기

Programming

ACMICPC 1000 : A+B http://www.acmicpc.net/problem/1000 #include using namespace std; int main(){ int a, b; cin >> a >> b; cout 더보기
Algospot : LECTURE https://algospot.com/judge/problem/read/LECTURE #include #include #include #include using namespace std; int main(void) { int num_cases = 0; cin >> num_cases; for (int i = 0; i < num_cases; ++i) { vector vec_string; string in_str, str_result; cin >> in_str; int half_size = in_str.length() / 2; for (int j = 0; j < half_size; ++j) { vec_string.push_back(in_str.substr(j * 2, 2)); } sort(vec_string... 더보기
Algospot : DRAWRECT https://algospot.com/judge/problem/read/DRAWRECT #include using namespace std; int GetDifferent(int a, int b, int c) { return (a == b) ? c : (b == c) ? a : b; } int main() { int num_cases = 0; cin >> num_cases; for (int i = 0; i < num_cases; ++i) { int x[3] = { 0, }; int y[3] = { 0, }; for (int j = 0; j < 3; ++j) { cin >> x[j] >> y[j]; } cout 더보기
Algospot : ENDIANS https://algospot.com/judge/problem/read/ENDIANS #include #include using namespace std; int main() { int num_edian = 0; vector v; cin >> num_edian; for (int i = 0; i < num_edian; ++i) { unsigned int i_temp; cin >> i_temp; v.push_back(i_temp); } for (auto i = v.begin(); i != v.end(); ++i) { unsigned char uc_temp; uc_temp = *((unsigned char*)&(*i) + 3); *((unsigned char*)&(*i) + 3) = *((unsigned ch.. 더보기
Algospot : MERCY https://algospot.com/judge/problem/read/MERCY #include #include using namespace std; int main() { int cases; cin >> cases; if ((0 < cases) && (cases 더보기