본문 바로가기

백준138

[2864] 5와 6의 차이 #include #include using namespace std;int main(){int i, j, minsum, maxsum;string s1, s2;cin >> s1 >> s2;for (i = 0; i 2018. 10. 6.
[11758]CCW #include using namespace std;int main(){int x1, y1, x2, y2, x3, y3; cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3; int temp = (x2 - x1)*(y3 - y1) - (y2 - y1)*(x3 - x1); if (temp > 0)cout 2018. 10. 6.
[1015] 수열 정렬 #include #include #include using namespace std;int main(){ int size, num; int arr[51]; cin >> size; vector v; for(int i = 0; i > num; v.push_back(make_pair(num, i)); } sort(v.begin(), v.end()); for(int i = 0; i 2018. 10. 3.
[10814] 나이순 정렬 #include #include #include #include using namespace std;bool cmp(pair v1, pair v2){if (v1.first > n;for (j = 0; j > age >> name;v.push_back(make_pair(age, name));}stable_sort(v.begin(), v.end(), cmp);for (j = 0; j 2018. 10. 3.
[10546] 배부른 마라토너/ [프로그래머스] 완주하지 못한 선수 #include #include #include #include using namespace std;map m;string str[100000];string str1;int main(){ int n,i; scanf("%d",&n); for(i = 0; i > str[i], m[str[i]]++; for (i = 0; i > str1, m[str1]--; for (i = 0; i 2018. 9. 14.
[12790] Mini Fantasy War #include using namespace std;int main(){int i, t;int arr[4], a;cin >> t;while (t--){for (i = 0; i > arr[i];for (i = 0; i > a;arr[i] += a;}if (arr[0] 2018. 9. 10.
[8741] 이진수 합 #include #include using namespace std;int main(){int n;cin >> n;string front(n, '1');string back(n - 1, '0');cout 2018. 9. 3.
[10995] 별 찍기 - 20 #include using namespace std;int main(){int n, i, j;cin >> n;for (i = 1; i 2018. 8. 29.
[15156] 과제 #include using namespace std;int main(){double K, N, M;cin >> K >> N >> M;if (K*N > M)cout 2018. 8. 27.
[15000] CAPS #include #include using namespace std;int main(){int i;string s1;cin >> s1;for (i = 0; i 2018. 8. 26.
[2386] 도비의 영어 공부 #include #include using namespace std;int main(){while (1){int sum = 0, i;string s1, s2;cin >> s1;getline(cin, s2);if (s1 == "#")break;for (i = 0; i = 65 && s2[i] 2018. 8. 26.
[2743] 단어 길이 재기 #include #include using namespace std;int main(){string s;cin >> s;cout 2018. 8. 25.
[15894] 수학은 체육과목입니다 #include using namespace std;int main(){unsigned int n;cin >> n;cout 2018. 8. 25.
[11370] Spawn of Ungoliant #include using namespace std;int main(){int i, j, k, w, h;while (1){scanf("%d %d", &w, &h);if (w == 0 || h == 0)break;char** arr = new char*[h + 2];for (i = 0; i 2018. 8. 25.
[11367] Report Card Time #include #include using namespace std;void result(int score);int main(){int testcase;cin >> testcase;while (testcase--){string name;int score;cin >> name >> score;if (score >= 0 && score 2018. 8. 24.
[11366] Tons of Orcs, no Fibbin’ #include using namespace std;int main(){int a, b, c;while (1){scanf("%d %d %d", &a, &b, &c);if (c 2018. 8. 24.
[11365] !밀비 급일 #include #include #include using namespace std;int main(){while (1){string s;getline(cin, s);if (s == "END")break;reverse(s.begin(), s.end());cout 2018. 8. 24.
[2635] 수 이어가기 #include #include #include using namespace std;int main(){int n, i, sub;vector arr;srand((int)time(NULL));cin >> n;arr.push_back(n);arr.push_back(rand() % n + 1);sub = n - (rand() % n + 1);while (sub >= 0){arr.push_back(sub);sub = arr[arr.size() - 2] - arr[arr.size() - 1];}cout 2018. 8. 24.
[4796] 캠핑 #include using namespace std;int main(){int count = 1;while (1){int l, p, v;cin >> l >> p >> v;if (!l && !p && !v)break;int sum = (v%p) > l ? l : (v%p);int result = v/p*l + sum;cout 2018. 8. 24.
[11895] 속이기 #include #include using namespace std;int xy = 0, sum = 0;int arr[1010];int main(){int n, i;cin >> n;for (i = 0; i > arr[i];xy ^= arr[i];sum += arr[i];}sort(arr, arr + n);if (xy)cout 2018. 8. 23.