buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
change_count
int64
0
100
#include <algorithm> #include <iostream> #include <vector> const unsigned int NUM = 5; int main() { std::vector<int> nums(NUM); for (auto &num : nums) { std::cin >> num; } std::sort(nums.begin(), nums.end(), std::greater<int>()); std::cout << nums[0] << std::endl; std::cout << nums[1] << std::endl; std::cout << nums[2] << std::endl; }
#include <algorithm> #include <iostream> #include <vector> const unsigned int NUM = 10; int main() { std::vector<int> nums(NUM); for (auto &num : nums) { std::cin >> num; } std::sort(nums.begin(), nums.end(), std::greater<int>()); std::cout << nums[0] << std::endl; std::cout << nums[1] << std::endl; std::cout << nums[2] << std::endl; }
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13]]
1
111
2
#include <iostream> using namespace std; int main() { int h[10], one = 0, two = 0, three = 0; for (int i = 0; i < 10; i++) { cin >> h[i]; if (three < h[i]) { if (two < h[i]) { if (one < h[i]) { two = one; one = h[i]; } else { three = two; two = h[i]; } } else { three = h[i]; } } } cout << one << endl << two << endl << three << endl; return 0; }
#include <iostream> using namespace std; int main() { int h[10], one = 0, two = 0, three = 0; for (int i = 0; i < 10; i++) { cin >> h[i]; if (three < h[i]) { if (two <= h[i]) { if (one <= h[i]) { three = two; two = one; one = h[i]; } else { three = two; two = h[i]; } } else { three = h[i]; } } } cout << one << endl << two << endl << three << endl; return 0; }
[["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 64, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
1
138
8
#include <stdio.h> int main(void) { int i, mountain[10], x, y; int n = 0; int l = 0; int m = 0; for (i = 0; i < 10; i++) { scanf("%d", &mountain[i]); } for (i = 0; i < 10; i++) { if (mountain[i] > m) m = mountain[i]; x = i; } printf("%d\n", m); for (i = 0; i < 10; i++) { if (i == x) { } else { if (mountain[i] > n) { n = mountain[i]; } y = i; } } printf("%d\n", n); for (i = 0; i < 10; i++) { if (i == y || i == x) { } else { if (mountain[i] > l) { l = mountain[i]; } } } printf("%d\n", l); return 0; }
#include <stdio.h> int main(void) { int i, mountain[10], x, y; int n = 0; int l = 0; int m = 0; for (i = 0; i < 10; i++) { scanf("%d", &mountain[i]); } for (i = 0; i < 10; i++) { if (mountain[i] > m) { m = mountain[i]; x = i; } } printf("%d\n", m); for (i = 0; i < 10; i++) { if (i == x) { } else { if (mountain[i] > n) { n = mountain[i]; y = i; } } } printf("%d\n", n); for (i = 0; i < 10; i++) { if (i == y || i == x) { } else { if (mountain[i] > l) { l = mountain[i]; } } } printf("%d\n", l); return 0; }
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46], ["-", 75, 76, 0, 9, 0, 57, 64, 9, 0, 46], ["+", 75, 76, 0, 9, 0, 57, 64, 9, 0, 46]]
1
228
4
#include <algorithm> #include <cmath> #include <iostream> #include <string> using namespace std; int main() { int a[10] = {}; for (int i = 1; i <= 10; i++) { cin >> a[i]; } sort(a, a + 10); cout << a[9] << endl; cout << a[8] << endl; cout << a[7] << endl; return 0; }
#include <algorithm> #include <cmath> #include <iostream> #include <string> using namespace std; int main() { int a[10] = {}; for (int i = 0; i < 10; i++) { cin >> a[i]; } sort(a, a + 10); cout << a[9] << endl; cout << a[8] << endl; cout << a[7] << endl; return 0; }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
1
89
4
#include <algorithm> #include <cstdio> #include <functional> #define SIZE 10 #define MAX 10000 #define TOP 3 using namespace std; int main() { int i = 0; int buf; int height[SIZE]; while (i < SIZE) { scanf("%d", &buf); height[i] = buf; ++i; } sort(height, height + SIZE, greater<int>()); for (i = 0; i < TOP; ++i) { printf("%d/n", height[i]); } return 0; }
#include <algorithm> #include <cstdio> #include <functional> #define SIZE 10 #define MAX 10000 #define TOP 3 using namespace std; int main() { int i = 0; int buf; int height[SIZE]; while (i < SIZE) { scanf("%d", &buf); height[i] = buf; ++i; } sort(height, height + SIZE, greater<int>()); for (i = 0; i < TOP; ++i) { printf("%d\n", height[i]); } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
1
113
3
#include <bits/stdc++.h> #define ll long long int #define FOR(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) #define REP(i, n) FOR(i, 0, n) #define REP1(i, n) FOR(i, 1, n) using namespace std; /*temp*/ int main() { int a[10]; REP1(i, 10) { cin >> a[i]; } sort(a, a + 10); cout << a[9] << '\n' << a[8] << '\n' << a[7] << '\n'; }
#include <bits/stdc++.h> #define ll long long int #define FOR(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) #define REP(i, n) FOR(i, 0, n) #define REP1(i, n) FOR(i, 1, n) using namespace std; /*temp*/ int main() { int a[10]; REP(i, 10) { cin >> a[i]; } sort(a, a + 10); cout << a[9] << '\n' << a[8] << '\n' << a[7] << '\n'; }
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22]]
1
102
2
#include <stdio.h> int main(void) { int x[10], i, n, y; for (i = 0; i < 10; i++) { scanf("%d", &x[i]); } for (i = 0; i < 8; i++) { for (n = i + 1; n < 9; n++) { if (x[i] < x[n]) { y = x[i]; x[i] = x[n]; x[n] = y; } } } for (i = 0; i < 3; i++) { printf("%d\n", x[i]); } return 0; }
#include <stdio.h> int main(void) { int x[10], i, n, y; for (i = 0; i < 10; i++) { scanf("%d", &x[i]); } for (i = 0; i < 9; i++) { for (n = i + 1; n < 10; n++) { if (x[i] < x[n]) { y = x[i]; x[i] = x[n]; x[n] = y; } } } for (i = 0; i < 3; i++) { printf("%d\n", x[i]); } return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
150
4
// // main.cpp // sanpie // // Created by h3037178 on 2017/07/28. // Copyright ?? 2017??´ ?????£?????????. All rights reserved. // #include <algorithm> #include <iostream> using namespace std; int main() { int i[10]; for (int o = 1; o < 10; o++) { cin >> i[o]; } sort(i, i + 10); cout << i[9] << endl << i[8] << endl << i[7] << endl; }
// // main.cpp // sanpie // // Created by h3037178 on 2017/07/28. // Copyright ?? 2017??´ ?????£?????????. All rights reserved. // #include <algorithm> #include <iostream> using namespace std; int main() { int i[10]; for (int o = 0; o < 10; o++) { cin >> i[o]; } sort(i, i + 10); cout << i[9] << endl << i[8] << endl << i[7] << endl; }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
82
2
#include <stdio.h> int main(void) { int n, m[10], l, s; for (n = 0; n < 10; n++) { scanf("%d", &m[n]); } for (n = 0; n < 10; n++) { for (l = n + 1; l < 10; l++) { if (m[n] < m[l]) { s = m[n]; m[n] = m[l]; m[l] = s; } } } printf("%d %d %d\n", m[0], m[1], m[2]); return 0; }
#include <stdio.h> int main(void) { int n, m[10], l, s; for (n = 0; n < 10; n++) { scanf("%d", &m[n]); } for (n = 0; n < 10; n++) { for (l = n + 1; l < 10; l++) { if (m[n] < m[l]) { s = m[n]; m[n] = m[l]; m[l] = s; } } } printf("%d\n%d\n%d\n", m[0], m[1], m[2]); return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
1
145
6
#include <algorithm> #include <iostream> using namespace std; int main() { int a[10]; for (int i = 0; i < 10; i++) { cin >> a[i]; } sort(a, a + 5); for (int i = 9; i > 6; i--) cout << a[i] << endl; return 0; }
#include <algorithm> #include <iostream> using namespace std; int main() { int a[10]; for (int i = 0; i < 10; i++) { cin >> a[i]; } sort(a, a + 10); for (int i = 9; i > 6; i--) cout << a[i] << endl; return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
78
2
#include <algorithm> #include <cstdio> #include <functional> #include <vector> using namespace std; int main() { vector<int> mountains; for (int i = 0; i < 10; i++) { int mountain; scanf("%d", &mountain); mountains.push_back(mountain); } sort(mountains.begin(), mountains.end(), greater<int>()); for (int i = 0; i < 3; i++) { printf("%d", mountains[0]); mountains.erase(mountains.begin()); } }
#include <algorithm> #include <cstdio> #include <functional> #include <vector> using namespace std; int main() { vector<int> mountains; for (int i = 0; i < 10; i++) { int mountain; scanf("%d", &mountain); mountains.push_back(mountain); } sort(mountains.begin(), mountains.end(), greater<int>()); for (int i = 0; i < 3; i++) { printf("%d\n", mountains[0]); mountains.erase(mountains.begin()); } }
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
1
121
1
#include <algorithm> #include <iostream> #include <stdio.h> using namespace std; int main() { int N[10]; for (int i = 0; i < 10; i++) { cin >> N[i]; } sort(&N[0], &N[9], greater<int>()); cout << N[0] << endl; cout << N[1] << endl; cout << N[2] << endl; return 0; }
#include <algorithm> #include <iostream> #include <stdio.h> using namespace std; int main() { int N[10]; for (int i = 0; i < 10; i++) { cin >> N[i]; } sort(&N[0], &N[0] + 10, greater<int>()); cout << N[0] << endl; cout << N[1] << endl; cout << N[2] << endl; return 0; }
[["-", 3, 4, 0, 66, 28, 69, 341, 342, 0, 13], ["+", 0, 16, 31, 66, 28, 69, 341, 342, 0, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
97
4
#include <iostream> using namespace std; int main() { int mt[10], tmp; int g = 1; for (int i = 0; i < 10; ++i) { cin >> mt[i]; } while (g) { g = 0; for (int i = 1; i < 10; ++i) { if (mt[i - 1] < mt[i]) { tmp = mt[i - 1]; mt[i - 1] = mt[i]; mt[i] = tmp; g = 1; } } } for (int i = 0; i < 3; ++i) { cout << mt[i] << " "; } return 0; }
#include <iostream> using namespace std; int main() { int mt[10], tmp; int g = 1; for (int i = 0; i < 10; ++i) { cin >> mt[i]; } while (g) { g = 0; for (int i = 1; i < 10; ++i) { if (mt[i - 1] < mt[i]) { tmp = mt[i - 1]; mt[i - 1] = mt[i]; mt[i] = tmp; g = 1; } } } for (int i = 0; i < 3; ++i) { cout << mt[i] << endl; } return 0; }
[["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 62], ["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 7, 8, 9, 0, 1, 0, 16, 12, 22]]
1
152
4
#include <algorithm> #include <iostream> using namespace std; int main() { int m[10]; for (int i = 0; i < 10; ++i) cin >> m[i]; sort(m, m + 10); for (int i = 10; i > 7; --i) cout << m[i] << '\n'; return 0; }
#include <algorithm> #include <iostream> using namespace std; int main() { int m[10]; for (int i = 0; i < 10; ++i) cin >> m[i]; sort(m, m + 10); for (int i = 9; i > 6; --i) cout << m[i] << '\n'; return 0; }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
78
4
#include <stdio.h> int main(void) { int i, j, a = 0, b = 0, c = 0, yama; for (i = 0; i <= 9; i++) { scanf("%d", &yama); if (a < yama) { b = a; a = yama; } else if (b < yama) { c = b; b = yama; } else if (c < yama) { c = yama; } } printf("%d\n%d\n%d\n", a, b, c); return 0; }
#include <stdio.h> int main(void) { int i, j, a = 0, b = 0, c = 0, yama; for (i = 0; i <= 9; i++) { scanf("%d", &yama); if (a < yama) { c = b; b = a; a = yama; } else if (b < yama) { c = b; b = yama; } else if (c < yama) { c = yama; } } printf("%d\n%d\n%d\n", a, b, c); return 0; }
[["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
1
120
4
#include <algorithm> #include <iostream> using namespace std; int main() { int m[10]; for (int i = 0; i < 10; i++) cin >> m[11]; stable_sort(m, m + 10); for (int i = 9; i > 6; i--) cout << m[i] << endl; return 0; }
#include <algorithm> #include <iostream> using namespace std; int main() { int m[10]; for (int i = 0; i < 10; i++) cin >> m[i]; stable_sort(m, m + 10); for (int i = 9; i > 6; i--) cout << m[i] << endl; return 0; }
[["-", 8, 1, 0, 16, 12, 69, 341, 342, 0, 13], ["+", 8, 1, 0, 16, 12, 69, 341, 342, 0, 22]]
1
76
2
#include <algorithm> #include <stdio.h> using namespace std; int main() { int m[10]; for (int i = 0; i < 10; i++) scanf("%d", &m[i]); stable_sort(m, m + 10); for (int i = 9; i > 6; i--) printf("%d\n", m[9]); return 0; }
#include <algorithm> #include <stdio.h> using namespace std; int main() { int m[10]; for (int i = 0; i < 10; i++) scanf("%d", &m[i]); stable_sort(m, m + 10); for (int i = 9; i > 6; i--) printf("%d\n", m[i]); return 0; }
[["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 13], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22]]
1
86
2
#include <iostream> using namespace std; int main() { int h[10], max; for (int i = 0; i < 10; i++) { cin >> h[i]; } for (int j = 0; j < 3; j++) { max = 0; for (int i = 1; i < 10; i++) { if (max < h[i]) max = i; } cout << h[max] << "\n"; h[max] = -1; } return 0; }
#include <iostream> using namespace std; int main() { int h[10], max; for (int i = 0; i < 10; i++) { cin >> h[i]; } for (int j = 0; j < 3; j++) { max = 0; for (int i = 1; i < 10; i++) { if (h[max] < h[i]) max = i; } cout << h[max] << "\n"; h[max] = -1; } return 0; }
[["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73]]
1
113
3
#include <stdio.h> int main() { int i, j, yama[10], temp; for (i = 0; i < 10; i++) { scanf("%d", &yama[i]); } for (i = 0; i < 10; i++) { for (j = 0; j < 10; j++) { if (yama[i] > yama[j]) temp = yama[i]; yama[i] = yama[j]; yama[j] = temp; } } for (i = 0; i < 3; i++) { printf("%d\n", yama[i]); } return 0; }
#include <stdio.h> int main() { int i, j, yama[10], temp; for (i = 0; i < 10; i++) { scanf("%d", &yama[i]); } for (i = 0; i < 10; i++) { for (j = 0; j < 10; j++) { if (yama[i] > yama[j]) { temp = yama[i]; yama[i] = yama[j]; yama[j] = temp; } } } for (i = 0; i < 3; i++) { printf("%d\n", yama[i]); } return 0; }
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
145
2
#include <stdio.h> int main() { int talls[10], max, banme; for (int i = 0; i < 10; i++) scanf("%d", &talls[i]); for (int i = 0; i < 10; i++) { max = 0; for (int j = 0; j < 10; j++) { if (max < talls[j]) { max = talls[j]; banme = j; } } printf("%d\n", max); talls[banme] = 0; } return 0; }
#include <stdio.h> int main() { int talls[10], max, banme; for (int i = 0; i < 10; i++) scanf("%d", &talls[i]); for (int i = 0; i < 3; i++) { max = 0; for (int j = 0; j < 10; j++) { if (max < talls[j]) { max = talls[j]; banme = j; } } printf("%d\n", max); talls[banme] = 0; } return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
123
2
#include <iostream> using namespace std; int main() { bool completed, flag; int result[3], buf, temp[10]; for (int i = 0; i < 10; i++) { cin >> temp[i]; } for (int l = 0; l < 3; l++) { while (1) { for (int j = l; j < 9; j++) { if (temp[j] < temp[j + 1]) { buf = temp[j + 1]; temp[j + 1] = temp[j]; temp[j] = buf; } } flag = false; for (int k = 0; k < 9; k++) { if (temp[0] < temp[k]) flag = true; } if (flag != true) { result[l] = temp[l]; break; } } } cout << result[0] << endl; cout << result[1] << endl; cout << result[2] << endl; return 0; }
#include <iostream> using namespace std; int main() { bool flag; int result[3], buf, temp[10]; for (int i = 0; i < 10; i++) { cin >> temp[i]; } for (int l = 0; l < 3; l++) { while (1) { for (int j = l; j < 9; j++) { if (temp[j] < temp[j + 1]) { buf = temp[j + 1]; temp[j + 1] = temp[j]; temp[j] = buf; } } flag = false; for (int k = l; k < 9; k++) { if (temp[l] < temp[k]) flag = true; } if (flag != true) { result[l] = temp[l]; break; } } } cout << result[0] << endl; cout << result[1] << endl; cout << result[2] << endl; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 22], ["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22]]
1
221
6
#include <iostream> using namespace std; main() { int s = 0; int x[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int t[3] = {0, 0, 0}; for (int i = 0; i < 0; i++) { cin >> x[i]; } for (int k = 0; k < 3; k++) { for (int j = 0; j < 10; j++) { if (t[k] < x[j]) { s = t[k]; t[k] = x[j]; x[j] = s; } } } for (int e = 0; e < 3; e++) { cout << t[e] << endl; } return 0; }
#include <iostream> using namespace std; main() { int s = 0; int x[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int t[3] = {0, 0, 0}; for (int i = 0; i < 10; i++) { cin >> x[i]; } for (int k = 0; k < 3; k++) { for (int j = 0; j < 10; j++) { if (t[k] < x[j]) { s = t[k]; t[k] = x[j]; x[j] = s; } } } for (int e = 0; e < 3; e++) { cout << t[e] << endl; } return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
179
2
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main(void) { vector<int> a; int b; for (int i = 0; i < 10; i++) { cin >> b; a.push_back(b); } sort(a.begin(), a.end()); cout << a[7] << endl << a[8] << endl << a[9] << endl; return 0; }
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main(void) { vector<int> a; int b; for (int i = 0; i < 10; i++) { cin >> b; a.push_back(b); } sort(a.begin(), a.end()); cout << a[9] << endl << a[8] << endl << a[7] << endl; return 0; }
[["-", 31, 16, 31, 16, 12, 69, 341, 342, 0, 13], ["+", 31, 16, 31, 16, 12, 69, 341, 342, 0, 13], ["-", 0, 16, 31, 16, 12, 69, 341, 342, 0, 13], ["+", 0, 16, 31, 16, 12, 69, 341, 342, 0, 13]]
1
94
4
#include <algorithm> #include <iostream> using namespace std; int main() { int hill[10]; for (int i = 0; i < 10; i++) { cin >> hill[i]; } sort(hill, hill + 10); cout << hill[9] << endl << hill[8] << endl << hill[8] << endl; return 0; }
#include <algorithm> #include <iostream> using namespace std; int main() { int hill[10]; for (int i = 0; i < 10; i++) { cin >> hill[i]; } sort(hill, hill + 10); cout << hill[9] << endl << hill[8] << endl << hill[7] << endl; return 0; }
[["-", 0, 16, 31, 16, 12, 69, 341, 342, 0, 13], ["+", 0, 16, 31, 16, 12, 69, 341, 342, 0, 13]]
1
78
2
#include <algorithm> #include <functional> #include <iostream> #include <vector> int main() { std::vector<int> vec(10); for (int i = 0; i < 10; ++i) { std::cin >> vec[i]; } std::nth_element(vec.begin(), vec.begin() + 3, vec.end(), std::greater<int>()); for (int i = 0; i < 3; ++i) { std::cout << vec[i] << std::endl; } return 0; }
#include <algorithm> #include <functional> #include <iostream> #include <vector> int main() { std::vector<int> vec(10); for (int i = 0; i < 10; ++i) { std::cin >> vec[i]; } std::partial_sort(vec.begin(), vec.begin() + 3, vec.end(), std::greater<int>()); for (int i = 0; i < 3; ++i) { std::cout << vec[i] << std::endl; } return 0; }
[["-", 8, 9, 0, 1, 0, 2, 63, 343, 141, 22], ["+", 8, 9, 0, 1, 0, 2, 63, 343, 141, 22]]
1
116
2
#include <algorithm> #include <cstdio> using namespace std; int mountain[10]; int main() { for (int i = 0; i < 10; i++) { scanf("%d", &mountain[i]); } sort(mountain, mountain + 10); for (int i = 0; i < 3; i++) { printf("%d\n", mountain[i]); } return 0; }
#include <algorithm> #include <cstdio> using namespace std; int mountain[10]; int main() { for (int i = 0; i < 10; i++) { scanf("%d", &mountain[i]); } sort(mountain, mountain + 10); for (int i = 0; i < 3; i++) { printf("%d\n", mountain[9 - i]); } return 0; }
[["+", 3, 4, 0, 69, 341, 342, 0, 16, 31, 13], ["+", 3, 4, 0, 69, 341, 342, 0, 16, 17, 33]]
1
90
2
#include <stdio.h> int num[13]; int ans[3]; int main() { while (scanf("%d", &num[0]) == 1) { for (int i = 1; i < 10; i++) { scanf("%d", &num[i]); } ans[0] = num[0]; ans[1] = ans[2] = 0; for (int i = 1; i < 10; i++) { if (num[i] > ans[0]) { ans[2] = ans[1]; ans[1] = ans[0]; ans[0] = num[i]; } else if (num[i] > ans[1] && num[i] < ans[0]) { ans[2] = ans[1]; ans[1] = num[i]; } else if (num[i] > ans[2] && num[i] < ans[1]) { ans[2] = num[i]; } } for (int i = 0; i < 3; i++) { printf("%d\n", ans[i]); } } return 0; }
#include <stdio.h> int num[13]; int ans[3]; int main() { while (scanf("%d", &num[0]) == 1) { for (int i = 1; i < 10; i++) { scanf("%d", &num[i]); } ans[0] = num[0]; ans[1] = ans[2] = 0; for (int i = 1; i < 10; i++) { if (num[i] >= ans[0]) { ans[2] = ans[1]; ans[1] = ans[0]; ans[0] = num[i]; } else if (num[i] >= ans[1] && num[i] < ans[0]) { ans[2] = ans[1]; ans[1] = num[i]; } else if (num[i] >= ans[2] && num[i] < ans[1]) { ans[2] = num[i]; } } for (int i = 0; i < 3; i++) { printf("%d\n", ans[i]); } } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 47], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 20]]
1
262
6
#include <algorithm> #include <iostream> using namespace std; template <typename T> int array_max(T array[], int n) { int max; max = 0; for (int i = 1; i < n; i++) { if (array[i] > array[max]) max = i; } return max; } int main() { int mount[10]; for (int i = 0; i < 10; i++) { cin >> mount[i]; } for (int i = 0; i < 3; i++) { int max = array_max(mount, 10 - i); int t; cout << mount[max] << endl; swap(mount[max], mount[10 - i]); } return 0; }
#include <algorithm> #include <iostream> using namespace std; template <typename T> int array_max(T array[], int n) { int max; max = 0; for (int i = 1; i < n; i++) { if (array[i] > array[max]) max = i; } return max; } int main() { int mount[10]; for (int i = 0; i < 10; i++) { cin >> mount[i]; } for (int i = 0; i < 3; i++) { int max = array_max(mount, 10 - i); cout << mount[max] << endl; swap(mount[max], mount[9 - i]); } return 0; }
[["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 7, 8, 9, 0, 43, 49, 22], ["-", 8, 9, 0, 7, 8, 9, 0, 43, 0, 35], ["-", 3, 4, 0, 69, 341, 342, 0, 16, 31, 13], ["+", 3, 4, 0, 69, 341, 342, 0, 16, 31, 13]]
1
161
5
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; int main() { int a[11] = {0}; int i, j, maxa, maxb, maxc; for (i = 0; i < 10; i++) { scanf("%d", &a[i]); // maxa=max(maxa,a[i]); } for (i = 0; i < 10; i++) { for (j = 0; j < 10; j++) { if (a[i] < a[j]) { swap(a[i], a[j]); } } } maxa = a[0]; maxb = a[1]; maxb = a[2]; printf("%d\n%d\n%d\n", maxa, maxb, maxc); return 0; }
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; int main() { int a[11] = {0}; int i, j, maxa, maxb, maxc; for (i = 0; i < 10; i++) { scanf("%d", &a[i]); // maxa=max(maxa,a[i]); } for (i = 0; i < 10; i++) { for (j = 0; j < 10; j++) { if (a[i] > a[j]) { swap(a[i], a[j]); } } } maxa = a[0]; maxb = a[1]; maxc = a[2]; printf("%d\n%d\n%d\n", maxa, maxb, maxc); return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22]]
1
165
4
#include <algorithm> #include <iostream> using namespace std; int main() { int n[10], i = 0; while (cin >> n[i]) i++; sort(n, n + i - 1, greater<int>()); for (int j = 0; j < 3; j++) { cout << n[j] << endl; } return 0; }
#include <algorithm> #include <iostream> using namespace std; int main() { int n[10], i = 0; while (cin >> n[i]) i++; sort(n, n + i, greater<int>()); for (int j = 0; j < 3; j++) { cout << n[j] << endl; } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
82
2
#include <iostream> using namespace std; int height[10]; int main(void) { for (int i = 0; i < 10; i++) { cin >> height[i]; } for (int i = 0; i < 10; i++) { int max = i; for (int j = i + 1; j < 10; j++) { if (height[max] < height[i]) { max = j; } } int tmp = height[i]; height[i] = height[max]; height[max] = tmp; } for (int i = 0; i < 3; i++) { cout << height[i] << endl; } }
#include <iostream> using namespace std; int height[10]; int main(void) { for (int i = 0; i < 10; i++) { cin >> height[i]; } for (int i = 0; i < 10; i++) { int max = i; for (int j = i + 1; j < 10; j++) { if (height[max] < height[j]) { max = j; } } int tmp = height[i]; height[i] = height[max]; height[max] = tmp; } for (int i = 0; i < 3; i++) { cout << height[i] << endl; } }
[["-", 15, 339, 51, 16, 12, 69, 341, 342, 0, 22], ["+", 15, 339, 51, 16, 12, 69, 341, 342, 0, 22]]
1
149
2
#include <iostream> #include <stdio.h> using namespace std; int main() { int mountain[10]; for (int i = 0; i < 10; i++) // scanf("%d",&mountain[i]); cin >> mountain[i]; for (int i = 0; i < 10; i++) { for (int j = 9; j > i; j--) { if (mountain[j] > mountain[j - 1]) { int temp = 0; temp = mountain[j]; mountain[j] = mountain[j - 1]; mountain[j - 1] = temp; } } } //結果出力 for (int i = 0; i < 10; i++) cout << mountain[i] << '\n'; return 0; }
#include <iostream> #include <stdio.h> using namespace std; int main() { int mountain[10]; for (int i = 0; i < 10; i++) // scanf("%d",&mountain[i]); cin >> mountain[i]; for (int i = 0; i < 10; i++) { for (int j = 9; j > i; j--) { if (mountain[j] > mountain[j - 1]) { int temp = 0; temp = mountain[j]; mountain[j] = mountain[j - 1]; mountain[j - 1] = temp; } } } //結果出力 for (int i = 0; i < 3; i++) cout << mountain[i] << '\n'; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
152
2
#include <algorithm> #include <deque> #include <functional> #include <iostream> using namespace std; int main() { int hills[10]; for (int i = 0; i < 10; i++) { cin >> hills[i]; } partial_sort(hills, hills + 3, hills + 9, greater<int>()); for (int i = 0; i < 3; i++) { cout << hills[i] << endl; } return 0; }
#include <algorithm> #include <deque> #include <functional> #include <iostream> using namespace std; int main() { int hills[10]; for (int i = 0; i < 10; i++) { cin >> hills[i]; } partial_sort(hills, hills + 3, hills + 10, greater<int>()); for (int i = 0; i < 3; i++) { cout << hills[i] << endl; } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
95
6
#include <algorithm> #include <deque> #include <functional> #include <iostream> using namespace std; int main() { int hills[10]; for (int i = 0; i < 10; i++) { cin >> hills[i]; } partial_sort(hills, hills + 3, hills + 9, greater<int>()); for (int i = 0; i < 3; i++) { cout << hills[i] << endl; } return 0; }
#include <algorithm> #include <deque> #include <functional> #include <iostream> using namespace std; int main() { int hills[10]; for (int i = 0; i < 10; i++) cin >> hills[i]; partial_sort(hills, hills + 3, hills + 10, greater<int>()); for (int i = 0; i < 3; i++) cout << hills[i] << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 45], ["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
95
6
#include <iostream> using namespace std; int main(void) { int val[10]; for (int i = 0; i < 10; i++) cin >> val[10]; for (int i = 0; i < 9; i++) for (int j = 0; j < 9; j++) if (val[j] < val[j + 1]) { int tmp = val[j]; val[j] = val[j + 1]; val[j + 1] = tmp; } for (int i = 0; i < 3; i++) cout << val[i] << endl; return 0; }
#include <iostream> using namespace std; int main(void) { int val[10]; for (int i = 0; i < 10; i++) cin >> val[i]; for (int i = 0; i < 9; i++) for (int j = 0; j < 9; j++) if (val[j] < val[j + 1]) { int tmp = val[j]; val[j] = val[j + 1]; val[j + 1] = tmp; } for (int i = 0; i < 3; i++) cout << val[i] << endl; return 0; }
[["-", 8, 1, 0, 16, 12, 69, 341, 342, 0, 13], ["+", 8, 1, 0, 16, 12, 69, 341, 342, 0, 22]]
1
139
2
#include <iostream> using namespace std; int main() { int top[3] = {0, 0, 0}, cur; for (int i = 0; i < 10; i++) { cin >> cur; if (cur > top[0]) { top[2] = top[1]; top[1] = top[0]; top[0] = cur; } else if (cur > top[1]) { top[2] = top[1]; top[1] = cur; } else if (cur > top[3]) { top[2] = cur; } } cout << top[0] << endl; cout << top[1] << endl; cout << top[2] << endl; return 0; }
#include <iostream> using namespace std; int main() { int top[3] = {0, 0, 0}, cur; for (int i = 0; i < 10; i++) { cin >> cur; if (cur > top[0]) { top[2] = top[1]; top[1] = top[0]; top[0] = cur; } else if (cur > top[1]) { top[2] = top[1]; top[1] = cur; } else if (cur > top[2]) { top[2] = cur; } } cout << top[0] << endl; cout << top[1] << endl; cout << top[2] << endl; return 0; }
[["-", 15, 339, 51, 16, 12, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 12, 69, 341, 342, 0, 13]]
1
164
2
#include <algorithm> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<string> vs; typedef pair<int, int> pii; typedef long long ll; #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define EXIST(s, e) ((s).find(e) != (s).end()) #define EXIST2(s, e) (find(ALL(s), (e)) != (s).end()) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define EACH(t, i, c) for (t::iterator i = (c).begin(); i != (c).end(); ++i) const double EPS = 1e-10; const double PI = acos(-1.0); int main() { vi a; REP(i, 10) { cin >> a[i]; } sort(RALL(a)); cout << a[0] << endl; cout << a[1] << endl; cout << a[2] << endl; }
#include <algorithm> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<string> vs; typedef pair<int, int> pii; typedef long long ll; #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define EXIST(s, e) ((s).find(e) != (s).end()) #define EXIST2(s, e) (find(ALL(s), (e)) != (s).end()) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define EACH(t, i, c) for (t::iterator i = (c).begin(); i != (c).end(); ++i) const double EPS = 1e-10; const double PI = acos(-1.0); int main() { vi a(10); REP(i, 10) { cin >> a[i]; } sort(RALL(a)); cout << a[0] << endl; cout << a[1] << endl; cout << a[2] << endl; }
[["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 24], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 25]]
1
265
3
#include <iostream> #include <stdio.h> #include <stdlib.h> #define N 10 int main(int argc, const char *argv[]) { int x = 0; int max1 = -1; int max2 = -2; int max3 = -3; for (int j = 0; j < N; j++) { scanf("%d\n", &x); if (max1 <= x) { max3 = max2; max2 = max1; max1 = x; } else if (max2 <= x) { max3 = max2; max2 = x; } else if (max3 <= x) { max3 = x; } printf("%d\n", max1); printf("%d\n", max2); printf("%d\n", max3); } }
#include <iostream> #include <stdio.h> #include <stdlib.h> #define N 10 int main(int argc, const char *argv[]) { int x = 0; int max1 = -1; int max2 = -2; int max3 = -3; for (int j = 0; j < N; j++) { scanf("%d\n", &x); if (max1 <= x) { max3 = max2; max2 = max1; max1 = x; } else if (max2 <= x) { max3 = max2; max2 = x; } else if (max3 <= x) { max3 = x; } } printf("%d\n", max1); printf("%d\n", max2); printf("%d\n", max3); }
[["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46]]
1
151
2
#include <iostream> #include <set> int main() { std::set<int, std::greater<int>> s; for (int i = 0; i < 10; ++i) { int h; std::cin >> h; s.insert(h); } std::set<int, std::greater<int>>::iterator it = s.begin(); for (int i = 0; i < 3; ++i) std::cout << *it++ << std::endl; }
#include <iostream> #include <set> int main() { std::multiset<int, std::greater<int>> s; for (int i = 0; i < 10; ++i) { int h; std::cin >> h; s.insert(h); } std::multiset<int, std::greater<int>>::iterator it = s.begin(); for (int i = 0; i < 3; ++i) std::cout << *it++ << std::endl; }
[["-", 8, 9, 0, 43, 39, 343, 141, 344, 141, 78], ["+", 8, 9, 0, 43, 39, 343, 141, 344, 141, 78], ["-", 0, 43, 39, 343, 141, 343, 345, 344, 141, 78], ["+", 0, 43, 39, 343, 141, 343, 345, 344, 141, 78]]
1
106
4
#include <stdio.h> int main(void) { int a = 0, b = 0, c = 0, n; while (scanf("%d", &n) > 0) { if (n > c) c = n; if (c > b) n = b, b = c, c = b; if (b > a) n = a, a = b, b = a; } printf("%d\n%d\n%d\n", a, b, c); return 0; }
#include <stdio.h> int main(void) { int a = 0, b = 0, c = 0, n; while (scanf("%d", &n) > 0) { if (n > c) c = n; if (c > b) n = b, b = c, c = n; if (b > a) n = a, a = b, b = n; } printf("%d\n%d\n%d\n", a, b, c); return 0; }
[["-", 64, 1, 0, 34, 12, 34, 12, 11, 12, 22], ["+", 64, 1, 0, 34, 12, 34, 12, 11, 12, 22]]
1
107
4
#include <iostream> using namespace std; int main() { int i = 10, m[10]; while (i > 0) { cin >> m[i]; i--; } int max, index, j; for (j = 0; j < 3; j++) { max = m[0]; index = 0; for (i = 0; i < 10; i++) { if (max < m[i]) { max = m[i]; index = i; } } cout << m[index] << endl; m[index] = 0; } }
#include <iostream> using namespace std; int main() { int i = 0, m[10]; while (i < 10) { cin >> m[i]; i++; } int max, index, j; for (j = 0; j < 3; j++) { max = m[0]; index = 0; for (i = 0; i < 10; i++) { if (max < m[i]) { max = m[i]; index = i; } } cout << m[index] << endl; m[index] = 0; } }
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["-", 0, 52, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 29]]
1
126
8
#include <bits/stdc++.h> using namespace std; int main() { vector<int> v(10, 0); for (int i = 0; i < 10; i++) cin >> v[i]; sort(v.begin(), v.end()); for (int i = 0; i < 3; i++) cout << v[8 - i] << endl; }
#include <bits/stdc++.h> using namespace std; int main() { vector<int> v(10, 0); for (int i = 0; i < 10; i++) cin >> v[i]; sort(v.begin(), v.end()); for (int i = 0; i < 3; i++) cout << v[9 - i] << endl; }
[["-", 31, 16, 12, 69, 341, 342, 0, 16, 31, 13], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 31, 13]]
1
84
2
#include <stdio.h> int main(void) { int i, j, wk; int data[10]; for (i = 0; i < 10; i++) { scanf("%d", &data[i]); } for (i = 0; i < 9; i++) { for (j = i + 1; j < 9; j++) { if (data[i] < data[j]) { wk = data[i]; data[i] = data[j]; data[j] = wk; } } } printf("%d\n", data[0]); printf("%d\n", data[1]); printf("%d\n", data[2]); return 0; }
#include <stdio.h> int main(void) { int i, j, wk; int data[10]; for (i = 0; i < 10; i++) { scanf("%d", &data[i]); } for (i = 0; i < 9; i++) { for (j = i + 1; j < 10; j++) { if (data[i] < data[j]) { wk = data[i]; data[i] = data[j]; data[j] = wk; } } } printf("%d\n", data[0]); printf("%d\n", data[1]); printf("%d\n", data[2]); return 0; }
[["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
162
2
#include <algorithm> #include <functional> #include <iostream> #include <vector> using namespace std; int main() { vector<int> data; int temp; for (int ix = 0; ix != 4; ++ix) { cin >> temp; data.push_back(temp); } sort(data.begin(), data.end(), greater<int>()); for (int ix = 0; ix != 3; ++ix) cout << data[ix] << endl; return 0; }
#include <algorithm> #include <functional> #include <iostream> #include <vector> using namespace std; int main() { vector<int> data; int temp; for (int ix = 0; ix != 10; ++ix) { cin >> temp; data.push_back(temp); } sort(data.begin(), data.end(), greater<int>()); for (int ix = 0; ix != 3; ++ix) cout << data[ix] << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
102
2
#include <stdio.h> int main() { int a[10], max, maxidx; for (int i = 0; i <= 9; i++) { scanf("%d", &a[i]); } for (int j = 0; j < 3; j++) { max = -1; for (int i = 0; i <= 9; i++) { if (a[i] > max) { max = a[i]; maxidx = i; } } printf("%d", max); a[maxidx] = -1; } }
#include <stdio.h> int main() { int a[10], max, maxidx; for (int i = 0; i <= 9; i++) { scanf("%d", &a[i]); } for (int j = 0; j < 3; j++) { max = -1; for (int i = 0; i <= 9; i++) { if (a[i] > max) { max = a[i]; maxidx = i; } } printf("%d\n", max); a[maxidx] = -1; } }
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
1
121
1
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <set> #include <sstream> #include <stack> #include <utility> #include <vector> using namespace std; int main() { int mountain[10]; for (int i = 0; i < 10; i++) { cin >> mountain[i]; } sort(mountain, mountain + 10, greater<int>()); for (int i = 0; i < 3; i++) { cout << mountain[i]; } return 0; }
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <set> #include <sstream> #include <stack> #include <utility> #include <vector> using namespace std; int main() { int mountain[10]; for (int i = 0; i < 10; i++) { cin >> mountain[i]; } sort(mountain, mountain + 10, greater<int>()); for (int i = 0; i < 3; i++) { cout << mountain[i] << endl; } return 0; }
[["+", 0, 7, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 7, 8, 9, 0, 1, 0, 16, 12, 22]]
1
119
2
#include <iostream> int main() { int first = 0, second = 0, third = 0, height; for (int i = 0; i < 10; ++i) { std::cin >> height; if (height > first) { second = first; first = height; } else if (height > second) { third = second; second = height; } else if (height > third) { third = height; } } std::cout << first << '\n' << second << '\n' << third << '\n'; return 0; }
#include <iostream> int main() { int first = 0, second = 0, third = 0, height; for (int i = 0; i < 10; ++i) { std::cin >> height; if (height > first) { third = second; second = first; first = height; } else if (height > second) { third = second; second = height; } else if (height > third) { third = height; } } std::cout << first << '\n' << second << '\n' << third << '\n'; return 0; }
[["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
1
116
4
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n, a; vector<int> v; for (n = 0; n < 10; n++) { cin >> a; v.push_back(a); } sort(v.begin(), v.end()); cout << v[7] << endl << v[8] << endl << v[9] << endl; }
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n, a; vector<int> v; for (n = 0; n < 10; n++) { cin >> a; v.push_back(a); } sort(v.begin(), v.end()); cout << v[9] << endl << v[8] << endl << v[7] << endl; }
[["-", 31, 16, 31, 16, 12, 69, 341, 342, 0, 13], ["+", 31, 16, 31, 16, 12, 69, 341, 342, 0, 13], ["-", 0, 16, 31, 16, 12, 69, 341, 342, 0, 13], ["+", 0, 16, 31, 16, 12, 69, 341, 342, 0, 13]]
1
91
4
#include <algorithm> #include <iostream> using namespace std; void q_sort(int array[], int begin, int end); void q_sort(int array[], int begin, int end) { int i = begin; int k = end; int pivot; int temp; pivot = array[(begin + end) / 2]; while (1) { while (array[i] < pivot) { ++i; } while (pivot < array[k]) { k--; } if (i >= k) { break; } temp = array[i]; array[i] = array[k]; array[k] = temp; i++; k++; } if (begin < i - 1) { q_sort(array, begin, i - 1); } if (k + 1 < end) { q_sort(array, k + 1, end); } } int main(int argc, const char *argv[]) { int mt[10]; for (int i = 0; i < 10; i++) { cin >> mt[i]; } q_sort(mt, 0, 10); for (int i = 9; 6 < i; i--) { cout << mt[i] << endl; } return 0; }
#include <algorithm> #include <iostream> using namespace std; void q_sort(int array[], int begin, int end); void q_sort(int array[], int begin, int end) { int i = begin; int k = end; int pivot; int temp; pivot = array[(begin + end) / 2]; while (1) { while (array[i] < pivot) { ++i; } while (pivot < array[k]) { k--; } if (i >= k) { break; } temp = array[i]; array[i] = array[k]; array[k] = temp; i++; k--; // check } if (begin < i - 1) { q_sort(array, begin, i - 1); } if (k + 1 < end) { q_sort(array, k + 1, end); } } int main(int argc, const char *argv[]) { int mt[10]; for (int i = 0; i < 10; i++) { cin >> mt[i]; } q_sort(mt, 0, 9); for (int i = 9; 6 < i; i--) { cout << mt[i] << endl; } return 0; }
[["-", 0, 52, 8, 9, 0, 1, 0, 27, 17, 29], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 68], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
265
4
#include <iostream> using namespace std; int main() { int mountains[9] = {}; for (int i = 0; i < 10; i++) { cin >> mountains[i]; } for (int i = 0; i < 10; i++) { int maxIndex = 0; for (int j = 0; j < 10; j++) { if (mountains[maxIndex] < mountains[j]) { maxIndex = j; } } cout << mountains[maxIndex] << endl; mountains[maxIndex] = -1; } return 0; }
#include <iostream> using namespace std; int main() { int mountains[9] = {}; for (int i = 0; i < 10; i++) { cin >> mountains[i]; } for (int i = 0; i < 3; i++) { int maxIndex = 0; for (int j = 0; j < 10; j++) { if (mountains[maxIndex] < mountains[j]) { maxIndex = j; } } cout << mountains[maxIndex] << endl; mountains[maxIndex] = -1; } return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
118
2
#include <stdio.h> int main(void) { int m_Higher[10]; for (int i = 0; i < 10; i++) scanf("%d", &m_Higher[i]); bool Flg = false; while (true) { for (int i = 0; i < 10 - 1; i++) { if (m_Higher[i] < m_Higher[i + 1]) { int buf = m_Higher[i]; m_Higher[i] = m_Higher[i + 1]; m_Higher[i + 1] = buf; Flg = true; } } if (!Flg) break; Flg = false; } for (int i = 0; i < 3; i++) printf("%d", m_Higher[i]); return 0; }
#include <stdio.h> int main(void) { int m_Higher[10]; for (int i = 0; i < 10; i++) scanf("%d", &m_Higher[i]); bool Flg = false; while (true) { for (int i = 0; i < 10 - 1; i++) { if (m_Higher[i] < m_Higher[i + 1]) { int buf = m_Higher[i]; m_Higher[i] = m_Higher[i + 1]; m_Higher[i + 1] = buf; Flg = true; } } if (!Flg) break; Flg = false; } for (int i = 0; i < 3; i++) printf("%d\n", m_Higher[i]); return 0; }
[["+", 8, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
1
160
1
#include <stdio.h> int main() { int a[10] = {}, i, g, n; for (i = 0; i < 10; i++) { scanf("%d", &a[i]); } for (n = 0; n < 9; n++) { for (i = 0; i < 9; i++) { if (a[i] > a[i + 1]) { g = a[i]; a[i] = a[i + 1]; a[i + 1] = g; } } } for (i = 0; i < 3; i++) { printf("%d\n", a[i]); } return 0; }
#include <stdio.h> int main() { int a[10] = {}, i, g, n; for (i = 0; i < 10; i++) { scanf("%d", &a[i]); } for (n = 0; n < 9; n++) { for (i = 0; i < 9; i++) { if (a[i] < a[i + 1]) { g = a[i]; a[i] = a[i + 1]; a[i + 1] = g; } } } for (i = 0; i < 3; i++) { printf("%d\n", a[i]); } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
156
2
#include <algorithm> #include <functional> #include <iostream> using namespace std; int main() { int h[10] = {}; for (short int i = 1; i <= 10; i++) { cin >> h[i]; } sort(h, h + 10, greater<int>()); for (short int i = 0; i < 3; i++) { cout << h[i] << endl; } return 0; }
#include <algorithm> #include <functional> #include <iostream> using namespace std; int main() { int h[10] = {}; for (short int i = 0; i < 10; i++) { cin >> h[i]; } sort(h, h + 10, greater<int>()); for (short int i = 0; i < 3; i++) { cout << h[i] << endl; } return 0; }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
1
94
4
#include <algorithm> #include <iostream> using namespace std; int main() { int i, h[10]; for (i = 0; i < 10; i++) { cin >> h[i]; } sort(h, h + 10); for (i = 0; i < 3; i++) { cout << h[7 + i] << endl; } return 0; }
#include <algorithm> #include <iostream> using namespace std; int main() { int i, h[10]; for (i = 0; i < 10; i++) { cin >> h[i]; } sort(h, h + 10); for (i = 0; i < 3; i++) { cout << h[9 - i] << endl; } return 0; }
[["-", 31, 16, 12, 69, 341, 342, 0, 16, 31, 13], ["-", 31, 16, 12, 69, 341, 342, 0, 16, 17, 72], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 31, 13], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 17, 33]]
1
82
4
#include <iostream> using namespace std; int main() { int d[10], i, j, tmp; for (i = 0; i < 10; i++) cin >> d[10]; for (i = 0; i < 9; i++) { for (j = i + 1; j < 10; j++) { if (d[i] < d[j]) { tmp = d[i]; d[i] = d[j]; d[j] = tmp; } } } for (i = 0; i < 3; i++) cout << d[i] << endl; return 0; }
#include <iostream> using namespace std; int main() { int d[10], i, j, tmp; for (i = 0; i < 10; i++) cin >> d[i]; for (i = 0; i < 9; i++) { for (j = i + 1; j < 10; j++) { if (d[i] < d[j]) { tmp = d[i]; d[i] = d[j]; d[j] = tmp; } } } for (i = 0; i < 3; i++) cout << d[i] << endl; return 0; }
[["-", 8, 1, 0, 16, 12, 69, 341, 342, 0, 13], ["+", 8, 1, 0, 16, 12, 69, 341, 342, 0, 22]]
1
139
2
#include <stdio.h> int main(void) { int i, n, f, s, t; f = 0, s = 0, t = 0; for (i = 0; i < 10; i++) { scanf("%d", &n); if (f < n || f == n) { s = f; f = n; continue; } else if (s < n || s == n) { t = s; s = n; continue; } else if (t < n || t == n) { t = n; continue; } else continue; } printf("%d\n%d\n%d\n", f, s, t); return 0; }
#include <stdio.h> int main(void) { int i, n, f, s, t; f = 0, s = 0, t = 0; for (i = 0; i < 10; i++) { scanf("%d", &n); if (f < n || f == n) { t = s; s = f; f = n; continue; } else if (s < n || s == n) { t = s; s = n; continue; } else if (t < n || t == n) { t = n; continue; } else continue; } printf("%d\n%d\n%d\n", f, s, t); return 0; }
[["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
0
145
4
#include <stdio.h> #define LENGTH 10 int main() { int i, j, temp; int data[LENGTH]; for (i = 0; i < LENGTH; i++) { scanf("%d", &data[i]); } for (i = 0; i < LENGTH - 1; i++) { for (j = 0; j < LENGTH - i - 1; j++) { if (data[i] > data[i + 1]) { temp = data[i + 1]; data[i + 1] = data[i]; data[i] = temp; } } } printf("%d\n%d\n%d\n", data[LENGTH - 1], data[LENGTH - 2], data[LENGTH - 3]); return 0; }
#include <stdio.h> #define LENGTH 10 int main() { int i, j, temp; int data[LENGTH]; for (i = 0; i < LENGTH; i++) { scanf("%d", &data[i]); } for (i = 0; i < LENGTH - 1; i++) { for (j = 0; j < LENGTH - i - 1; j++) { if (data[j] > data[j + 1]) { temp = data[j + 1]; data[j + 1] = data[j]; data[j] = temp; } } } printf("%d\n%d\n%d\n", data[LENGTH - 1], data[LENGTH - 2], data[LENGTH - 3]); return 0; }
[["-", 0, 57, 15, 23, 0, 16, 31, 69, 71, 22], ["+", 0, 57, 15, 23, 0, 16, 31, 69, 71, 22], ["-", 15, 23, 0, 16, 12, 69, 71, 16, 31, 22], ["+", 15, 23, 0, 16, 12, 69, 71, 16, 31, 22], ["-", 0, 1, 0, 11, 12, 69, 71, 16, 31, 22], ["+", 0, 1, 0, 11, 12, 69, 71, 16, 31, 22], ["-", 0, 1, 0, 11, 31, 69, 71, 16, 31, 22], ["+", 0, 1, 0, 11, 31, 69, 71, 16, 31, 22], ["-", 64, 9, 0, 1, 0, 11, 12, 69, 71, 22], ["+", 64, 9, 0, 1, 0, 11, 12, 69, 71, 22], ["-", 64, 9, 0, 1, 0, 11, 31, 69, 71, 22], ["+", 64, 9, 0, 1, 0, 11, 31, 69, 71, 22]]
0
168
12
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <math.h> #include <queue> #include <sstream> #include <stack> #include <string.h> #include <string> #include <vector> #define inf 1 << 30 #define qu queue<int> #define vc vector<int> #define pii pair<int, int> #define mci map<string, int> #define at for (int f = 1; f <= 10; f++) #define mm(o) memset(o, 0, sizeof(o)) #define op freopen("in.txt", "r", stdin) #define op1 freopen("out.txt", "w", stdout) using namespace std; int main() { int a[10]; at { scanf("%d", &a[f]); } sort(a, a + 10); cout << a[9] << endl; cout << a[8] << endl; cout << a[7] << endl; return 0; }
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <math.h> #include <queue> #include <sstream> #include <stack> #include <string.h> #include <string> #include <vector> #define inf 1 << 30 #define qu queue<int> #define vc vector<int> #define pii pair<int, int> #define mci map<string, int> #define at for (int f = 0; f < 10; f++) #define mm(o) memset(o, 0, sizeof(o)) #define op freopen("in.txt", "r", stdin) #define op1 freopen("out.txt", "w", stdout) using namespace std; int main() { int a[10]; at { scanf("%d", &a[f]); } sort(a, a + 10); cout << a[9] << endl; cout << a[8] << endl; cout << a[7] << endl; return 0; }
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59]]
1
127
2
#include <bits/stdc++.h> using namespace std; int main(void) { vector<int> x(10); int i = 0; for (; i < 10; i++) cin >> x[i]; sort(x.begin(), x.end()); for (i = 9; i > 6; i--) cout << x[i]; }
#include <bits/stdc++.h> using namespace std; int main(void) { vector<int> x(10); int i = 0; for (; i < 10; i++) cin >> x[i]; sort(x.begin(), x.end()); for (i = 9; i > 6; i--) cout << x[i] << endl; }
[["+", 8, 9, 0, 7, 8, 1, 0, 16, 17, 151], ["+", 8, 9, 0, 7, 8, 1, 0, 16, 12, 22]]
1
79
2
#include <bits/stdc++.h> using namespace std; int main() { vector<int> mountain; for (int i = 0; i < 10; i++) { cin >> mountain.at(i); } sort(mountain.begin(), mountain.end()); reverse(mountain.begin(), mountain.end()); for (int i = 0; i < 3; i++) { cout << mountain.at(i) << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { vector<int> mountain(10); for (int i = 0; i < 10; i++) { cin >> mountain.at(i); } sort(mountain.begin(), mountain.end()); reverse(mountain.begin(), mountain.end()); for (int i = 0; i < 3; i++) { cout << mountain.at(i) << endl; } }
[["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 24], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 25]]
1
100
3
// // main.cpp // kyougi // // Created by 寺林 一旭 on 2018/08/27. // Copyright © 2018年 寺林 一旭. All rights reserved. // #include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int num; vector<int> list; while (cin) { cin >> num; list.push_back(num); } sort(list.begin(), list.end(), greater<int>()); for (int i = 0; i < 3; i++) { cout << list[i] << endl; } return 0; }
// // main.cpp // kyougi // // Created by 寺林 一旭 on 2018/08/27. // Copyright © 2018年 寺林 一旭. All rights reserved. // #include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int num; vector<int> list; while (cin >> num) { list.push_back(num); } sort(list.begin(), list.end(), greater<int>()); for (int i = 0; i < 3; i++) { cout << list[i] << endl; } return 0; }
[["-", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["-", 0, 52, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45]]
1
99
6
// include---------------------------------------------------------------------------------------------------------------------- #include <bits/stdc++.h> // using // namespace-------------------------------------------------------------------------------------------------------------- using namespace std; // define----------------------------------------------------------------------------------------------------------------------- #define rep(i, n) for (int i = 0; i < (int)n; i++) #define FOR(i, s, n) for (int i = s; i < (int)n; i++) #define per(i, n) for (int i = n; i >= 0; i--) #define ROF(i, s, n) for (int i = s; i >= (int)n; i--) #define FORIT(i, A) for (auto i : A) #define PRINT(x) cout << (x) << "\n" #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define PB push_back #define MP make_pair #define EACH(i, n) \ for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i) #define SZ(a) int((a).size()) #define EXIST(s, e) ((s).find(e) != (s).end()) #define SORT(c) sort((c).begin(), (c).end()) #define INF 1 << 25 #define CLR(a) memset((a), 0, sizeof(a)) #define dump(x) cerr << #x << " = " << (x) << "\n"; #define debug(x) \ cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \ << " " << __FILE__ << "\n"; #define sq(n) (n) * (n) // typedef---------------------------------------------------------------------------------------------------------------------- typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef long long LL; typedef unsigned int uint; typedef unsigned long long ull; // const------------------------------------------------------------------------------------------------------------------------ const double EPS = 1e-10; const double PI = acos(-1.0); // global----------------------------------------------------------------------------------------------------------------------- vector<int> a(10); // function--------------------------------------------------------------------------------------------------------------------- int main() { rep(i, 10) { scanf("%d", &a[i]); } sort(a.begin(), a.end()); ROF(i, 9, 7) { printf("%d\n", a[i - 1]); } return 0; }
// include---------------------------------------------------------------------------------------------------------------------- #include <bits/stdc++.h> // using // namespace-------------------------------------------------------------------------------------------------------------- using namespace std; // define----------------------------------------------------------------------------------------------------------------------- #define rep(i, n) for (int i = 0; i < (int)n; i++) #define FOR(i, s, n) for (int i = s; i < (int)n; i++) #define per(i, n) for (int i = n; i >= 0; i--) #define ROF(i, s, n) for (int i = s; i >= (int)n; i--) #define FORIT(i, A) for (auto i : A) #define PRINT(x) cout << (x) << "\n" #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define PB push_back #define MP make_pair #define EACH(i, n) \ for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i) #define SZ(a) int((a).size()) #define EXIST(s, e) ((s).find(e) != (s).end()) #define SORT(c) sort((c).begin(), (c).end()) #define INF 1 << 25 #define CLR(a) memset((a), 0, sizeof(a)) #define dump(x) cerr << #x << " = " << (x) << "\n"; #define debug(x) \ cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \ << " " << __FILE__ << "\n"; #define sq(n) (n) * (n) // typedef---------------------------------------------------------------------------------------------------------------------- typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef long long LL; typedef unsigned int uint; typedef unsigned long long ull; // const------------------------------------------------------------------------------------------------------------------------ const double EPS = 1e-10; const double PI = acos(-1.0); // global----------------------------------------------------------------------------------------------------------------------- vector<int> a(10); // function--------------------------------------------------------------------------------------------------------------------- int main() { rep(i, 10) { scanf("%d", &a[i]); } sort(a.begin(), a.end()); ROF(i, 9, 7) { printf("%d\n", a[i]); } return 0; }
[["-", 3, 4, 0, 69, 341, 342, 0, 16, 17, 33], ["-", 3, 4, 0, 69, 341, 342, 0, 16, 12, 13]]
1
279
2
#include <iostream> using namespace std; int main() { int h[10]; for (int i = 0; i < 10; i++) cin >> h[i]; for (int i = 0; i < 3; i++) { int n = h[0]; int m = -1; for (int j = 1; j < 10; j++) if (n < h[j]) { n = h[j]; m = j; } cout << n << '\n'; h[m] = -1; } return 0; }
#include <iostream> using namespace std; int main() { int h[10]; for (int i = 0; i < 10; i++) cin >> h[i]; for (int i = 0; i < 3; i++) { int n = h[0]; int m = 0; for (int j = 1; j < 10; j++) if (n < h[j]) { n = h[j]; m = j; } cout << n << '\n'; h[m] = -1; } return 0; }
[["-", 0, 7, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 7, 8, 9, 0, 43, 49, 50, 51, 13]]
1
122
2
#include <algorithm> #include <iostream> using namespace std; int main() { int a[10]; for (int i = 0; i < 10; i++) cin >> a[i]; sort(a, a + 10); for (int i = 0; i < 3; i++) cout << a[i] << endl; }
#include <algorithm> #include <iostream> using namespace std; int main() { int a[10]; for (int i = 0; i < 10; i++) cin >> a[i]; sort(a, a + 10); for (int i = 9; 6 < i; i--) cout << a[i] << endl; }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 31, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 7, 26, 27, 17, 29], ["+", 0, 14, 8, 9, 0, 7, 26, 27, 17, 68]]
1
73
8
#include <algorithm> #include <iostream> using namespace std; int main() { int h[10]; for (int i = 0; i < 10; i++) { cin >> h[i]; } sort(h, h + 10); cout << h[7] << endl << h[8] << endl << h[9] << endl; }
#include <algorithm> #include <iostream> using namespace std; int main() { int h[10]; for (int i = 0; i < 10; i++) { cin >> h[i]; } sort(h, h + 10); cout << h[9] << endl << h[8] << endl << h[7] << endl; }
[["-", 31, 16, 31, 16, 12, 69, 341, 342, 0, 13], ["+", 31, 16, 31, 16, 12, 69, 341, 342, 0, 13], ["-", 0, 16, 31, 16, 12, 69, 341, 342, 0, 13], ["+", 0, 16, 31, 16, 12, 69, 341, 342, 0, 13]]
1
75
4
#include <algorithm> #include <iostream> using namespace std; int main() { int x[10]; int i, j, tmp; for (i = 0; i < 10; i++) { cin >> x[i]; } sort(x, x + 9); cout << x[9] << endl; cout << x[8] << endl; cout << x[7] << endl; return 0; }
#include <algorithm> #include <iostream> using namespace std; int main() { int x[10]; int i, j, tmp; for (i = 0; i < 10; i++) { cin >> x[i]; } sort(x, x + 10); cout << x[9] << endl; cout << x[8] << endl; cout << x[7] << endl; return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
88
2
#include <algorithm> #include <functional> #include <stdio.h> using namespace std; int main() { int i, height[10]; for (i = 0; i < 10; i++) { scanf("%d", &height[i]); } sort(height, height + 10, greater<int>()); for (i = 0; i < 2; i++) { printf("%d\n", height[i]); } return 0; }
#include <algorithm> #include <functional> #include <stdio.h> using namespace std; int main() { int i, height[10]; for (i = 0; i < 10; i++) { scanf("%d", &height[i]); } sort(height, height + 10, greater<int>()); for (i = 0; i < 3; i++) { printf("%d\n", height[i]); } return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
99
2
#include <iostream> using namespace std; int main() { int height[10] = {0}; for (int i = 0; i < 10; i++) { cin >> height[i]; } int temp = 0; for (int i = 0; i < 3; i++) { for (int j = 0; j < 10 - i; j++) { if (height[j] > height[j + 1]) { temp = height[j]; height[j] = height[j + 1]; height[j + 1] = temp; } } } cout << height[9] << endl; cout << height[8] << endl; cout << height[7] << endl; return 0; }
#include <iostream> using namespace std; int main() { int height[10] = {0}; for (int i = 0; i < 10; i++) { cin >> height[i]; } int temp = 0; for (int i = 0; i < 3; i++) { for (int j = 0; j < 9 - i; j++) { if (height[j] > height[j + 1]) { temp = height[j]; height[j] = height[j + 1]; height[j + 1] = temp; } } } cout << height[9] << endl; cout << height[8] << endl; cout << height[7] << endl; return 0; }
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 31, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 31, 13]]
1
158
2
#include <stdio.h> int main() { int h[3] = {0, 0, 0}; int c, i; for (i = 0; i < 10; i++) { scanf("%d", &c); if (c > h[0]) { h[2] = h[1]; h[1] = h[0]; h[0] = c; } else if (c > h[1]) { h[2] = h[1]; h[1] = c; } else if (c > h[0]) { h[2] = c; } } for (i = 0; i < 3; i++) { printf("%d\n", h[i]); } }
#include <stdio.h> int main() { int h[3] = {0, 0, 0}; int c, i; for (i = 0; i < 10; i++) { scanf("%d", &c); if (c > h[0]) { h[2] = h[1]; h[1] = h[0]; h[0] = c; } else if (c > h[1]) { h[2] = h[1]; h[1] = c; } else if (c > h[2]) { h[2] = c; } } for (i = 0; i < 3; i++) { printf("%d\n", h[i]); } }
[["-", 15, 339, 51, 16, 12, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 12, 69, 341, 342, 0, 13]]
1
166
2
#include <algorithm> #include <iostream> using namespace std; int main() { int a[10], i, judge; for (i = 0; i < 10; i++) cin >> a[i]; judge = 0; do { judge = 1; for (i = 0; i < 10; i++) { if (a[i] < a[i + 1]) { swap(a[i], a[i + 1]); judge = 0; } } } while (!judge); for (i = 0; i < 3; i++) cout << a[i] << endl; return 0; }
#include <algorithm> #include <iostream> using namespace std; int main() { int a[10], i, judge; for (i = 0; i < 10; i++) cin >> a[i]; judge = 0; do { judge = 1; for (i = 0; i < 9; i++) { if (a[i] < a[i + 1]) { swap(a[i], a[i + 1]); judge = 0; } } } while (!judge); for (i = 0; i < 3; i++) cout << a[i] << endl; return 0; }
[["-", 0, 82, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 82, 8, 9, 0, 7, 15, 16, 12, 13]]
1
136
2
#include <iostream> using namespace std; int main() { int first = 0; int second = 0; int third = 0; for (int i = 0; i < 10; ++i) { int number; cin >> number; if (number <= third) continue; third = number; if (third <= second) continue; swap(second, third); if (second <= third) continue; swap(first, second); } cout << first << endl << second << endl << third << endl; return 0; }
#include <iostream> using namespace std; int main() { int first = 0; int second = 0; int third = 0; for (int i = 0; i < 10; ++i) { int number; cin >> number; if (number <= third) continue; third = number; if (third <= second) continue; swap(second, third); if (second <= first) continue; swap(first, second); } cout << first << endl << second << endl << third << endl; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
109
2
#include <algorithm> #include <cstdio> #include <functional> using namespace std; int main() { int iHigh[10]; for (int i = 0; i < 10; i++) { scanf("%d", &iHigh[i]); } sort(iHigh, iHigh + 9, greater<int>()); for (int i = 0; i < 3; i++) { printf("%d\n", iHigh[i]); } return 0; }
#include <algorithm> #include <cstdio> #include <functional> using namespace std; int main() { int iHigh[10]; for (int i = 0; i < 10; i++) { scanf("%d", &iHigh[i]); } sort(iHigh, iHigh + 10, greater<int>()); for (int i = 0; i < 3; i++) { printf("%d\n", iHigh[i]); } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
99
2
#include <iostream> using namespace std; int main() { int m, max = 0, cen = -1, min = -2; cin >> m; max = m; cen = m; min = m; for (int i = 1; i < 10; i++) { cin >> m; if (max < m) { min = cen; cen = max; max = m; } else if (cen <= m) { min = cen; cen = m; } else if (min <= m) min = m; } cout << max << endl; cout << cen << endl; cout << min << endl; return 0; }
#include <iostream> using namespace std; int main() { int m, max = 0, cen = -1, min = -2; cin >> m; max = m; cen = -1; min = -2; for (int i = 1; i < 10; i++) { cin >> m; if (max < m) { min = cen; cen = max; max = m; } else if (cen <= m) { min = cen; cen = m; } else if (min <= m) min = m; } cout << max << endl; cout << cen << endl; cout << min << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13]]
1
132
4
#define _USE_MATH_DEFINES #include <algorithm> #include <functional> #include <iostream> #include <math.h> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <vector> using namespace std; //??°?????????????????° void function() { //??¢??° } int main() { int max1 = 0; int max2 = 0; int max3 = 0; for (int i = 0; i < 9; i++) { int a; cin >> a; if (a >= max1) { max3 = max2; max2 = max1; max1 = a; } else if (a >= max2) { max3 = max2; max2 = a; } else if (a >= max3) { max3 = a; } } cout << max1 << endl << max2 << endl << max3 << endl; return 0; }
#define _USE_MATH_DEFINES #include <algorithm> #include <functional> #include <iostream> #include <math.h> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <vector> using namespace std; //??°?????????????????° void function() { //??¢??° } int main() { int max1 = 0; int max2 = 0; int max3 = 0; for (int i = 0; i < 10; i++) { int a; cin >> a; if (a >= max1) { max3 = max2; max2 = max1; max1 = a; } else if (a >= max2) { max3 = max2; max2 = a; } else if (a >= max3) { max3 = a; } } cout << max1 << endl << max2 << endl << max3 << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
143
2
#include <iostream> int main() { int a[10], i, j, n; for (i = 0; i < 10; i++) { std::cin >> a[i]; } for (i = 0; i < 9; i++) { for (j = i + 1; j < 9; j++) { if (a[i] < a[j]) { n = a[i]; a[i] = a[j]; a[j] = n; } } } for (i = 0; i < 3; i++) { std::cout << a[i] << std::endl; } return 0; }
#include <iostream> int main() { int a[10], i, j, n; for (i = 0; i < 10; i++) { std::cin >> a[i]; } for (i = 0; i < 9; i++) { for (j = i + 1; j < 10; j++) { if (a[i] < a[j]) { n = a[i]; a[i] = a[j]; a[j] = n; } } } for (i = 0; i < 3; i++) { std::cout << a[i] << std::endl; } return 0; }
[["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
145
2
#include <algorithm> #include <iostream> using namespace std; int main() { int a[10]; for (int i = 0; i < 10; i++) { cin >> a[i]; } sort(a, a + 10); for (int i = 9; i > 6; i++) { cout << a[i] << endl; } return 0; }
#include <algorithm> #include <iostream> using namespace std; int main() { int a[10]; for (int i = 0; i < 10; i++) { cin >> a[i]; } sort(a, a + 10); for (int i = 9; i > 6; i--) { cout << a[i] << endl; } return 0; }
[["-", 0, 14, 8, 9, 0, 7, 26, 27, 17, 29], ["+", 0, 14, 8, 9, 0, 7, 26, 27, 17, 68]]
1
80
2
#include <iostream> using namespace std; //??\????????? void swap(int *a, int *b) { int temp = *a; *a = *b; *b = temp; } int main() { int str, mt[10]; int i; for (i = 0; i < 10; i++) { cin >> str; mt[i] = str; } // ???????????? int num = 1; while (num <= 3) { str = mt[num - 1]; for (i = num; i <= 10; i++) { if (str < mt[i]) { str = mt[i]; swap(mt[num - 1], mt[i]); } } num++; } cout << mt[0] << "\n"; cout << mt[1] << "\n"; cout << mt[2] << "\n"; return 0; }
#include <iostream> using namespace std; //??\????????? void swap(int *a, int *b) { int temp = *a; *a = *b; *b = temp; } int main() { int str, mt[10]; int i; for (i = 0; i < 10; i++) { cin >> str; mt[i] = str; } // ???????????? int num = 1; while (num <= 3) { str = mt[num - 1]; for (i = num; i < 10; i++) { if (str < mt[i]) { str = mt[i]; swap(mt[num - 1], mt[i]); } } num++; } cout << mt[0] << "\n"; cout << mt[1] << "\n"; cout << mt[2] << "\n"; return 0; }
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18]]
1
190
2
#include <iostream> using namespace std; //??\????????? void swap(int *a, int *b) { int temp = *a; *a = *b; *b = temp; } int main() { int str, mt[10]; int i; for (i = 0; i < 10; i++) { cin >> str; mt[i] = str; } // ???????????? int num = 1; while (num <= 3) { str = mt[num - 1]; for (i = num; i <= 10; i++) { if (str < mt[i]) { str = mt[i]; swap(mt[num - 1], mt[i]); } } cout << mt[num - 1] << "\n"; num++; } return 0; }
#include <iostream> using namespace std; //??\????????? void swap(int *a, int *b) { int temp = *a; *a = *b; *b = temp; } int main() { int str, mt[10]; int i; for (i = 0; i < 10; i++) { cin >> str; mt[i] = str; } // sort int num = 1; while (num <= 3) { str = mt[num - 1]; for (i = num; i < 10; i++) { if (str < mt[i]) { str = mt[i]; swap(mt[num - 1], mt[i]); } } cout << mt[num - 1] << "\n"; num++; } return 0; }
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18]]
1
170
2
#include <iostream> using namespace std; int main() { int x, buf, i, j; int top[3]; for (i = 0; i < 3; i++) top[i] = 0; for (i = 0; i < 10; i++) { cin >> x; if (x > top[2]) { top[2] = x; j = 2; while (j > 0) { if (top[j - 1] < top[j]) { top[j - 1] = buf; top[j - 1] = top[j]; top[j] = buf; j--; } else { break; } } } } for (i = 0; i < 3; i++) cout << top[i] << '\n'; return 0; }
#include <iostream> using namespace std; int main() { int x, buf, i, j; int top[3]; for (i = 0; i < 3; i++) top[i] = 0; for (i = 0; i < 10; i++) { cin >> x; if (x > top[2]) { top[2] = x; j = 2; while (j > 0) { if (top[j - 1] < top[j]) { buf = top[j - 1]; top[j - 1] = top[j]; top[j] = buf; j--; } else { break; } } } } for (i = 0; i < 3; i++) cout << top[i] << '\n'; return 0; }
[["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22]]
1
175
4
#include <algorithm> #include <iostream> using namespace std; int main() { int a[10]; for (int i = 0; i < 10; i++) cin >> a[i]; sort(a, a + 10); cout << a[7] << endl << a[8] << endl << a[9] << endl; return 0; }
#include <algorithm> #include <iostream> using namespace std; int main() { int a[10]; for (int i = 0; i < 10; i++) cin >> a[i]; sort(a, a + 10); cout << a[9] << endl << a[8] << endl << a[7] << endl; return 0; }
[["-", 31, 16, 31, 16, 12, 69, 341, 342, 0, 13], ["+", 31, 16, 31, 16, 12, 69, 341, 342, 0, 13], ["-", 0, 16, 31, 16, 12, 69, 341, 342, 0, 13], ["+", 0, 16, 31, 16, 12, 69, 341, 342, 0, 13]]
1
76
4
#include <iostream> int main(void) { int i, j, max, tmp, high[10]; for (i = 0; i < 10; i++) { std::cin >> high[i]; } for (i = 0; i < 3; i++) { for (j = 1, tmp = 1, max = high[0]; j < 10; j++) { if (max < high[j]) { max = high[j]; tmp = j; } } high[tmp] = 0; std::cout << max << std::endl; } return 0; }
#include <iostream> int main(void) { int i, j, max, tmp, high[10]; for (i = 0; i < 10; i++) { std::cin >> high[i]; } for (i = 0; i < 3; i++) { for (j = 1, tmp = 0, max = high[0]; j < 10; j++) { if (max < high[j]) { max = high[j]; tmp = j; } } high[tmp] = 0; std::cout << max << std::endl; } return 0; }
[["-", 0, 7, 10, 34, 12, 34, 31, 11, 12, 13], ["+", 0, 7, 10, 34, 12, 34, 31, 11, 12, 13]]
1
130
2
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <stdlib.h> #include <string> #include <utility> #include <vector> #define INF 100000 using namespace std; int main() { vector<int> yama; for (int i = 1; i < 10; i++) { int hi; cin >> hi; yama.push_back(hi); } sort(yama.begin(), yama.end()); for (int i = 0; i < 3; i++) { cout << yama[8 - i] << endl; } }
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <stdlib.h> #include <string> #include <utility> #include <vector> #define INF 100000 using namespace std; int main() { vector<int> yama; for (int i = 0; i < 10; i++) { int hi; cin >> hi; yama.push_back(hi); } sort(yama.begin(), yama.end()); for (int i = 0; i < 3; i++) { cout << yama[9 - i] << endl; } }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 31, 16, 12, 69, 341, 342, 0, 16, 31, 13], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 31, 13]]
1
113
4
#include <algorithm> #include <functional> #include <iostream> #include <vector> using namespace std; int main() { vector<int> m; int n; for (int i = 0; i < 10; i++) { cin >> n; m.push_back(n); } sort(m.begin(), m.end(), std::greater<int>()); for (int i = 0; i <= 3; i++) cout << m[i] << endl; return 0; }
#include <algorithm> #include <functional> #include <iostream> #include <vector> using namespace std; int main() { vector<int> m; int n; for (int i = 0; i < 10; i++) { cin >> n; m.push_back(n); } sort(m.begin(), m.end(), std::greater<int>()); for (int i = 0; i < 3; i++) cout << m[i] << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
1
104
2
#include <bits/stdc++.h> using namespace std; int main() { int h = 0, m = 0, l = 0, tmp, i; for (i = 0; i < 9; i++) { cin >> tmp; if (tmp >= h) { l = m; m = h; h = tmp; } else if (tmp >= m) { l = m; m = tmp; } else if (tmp >= l) { l = tmp; } } cout << h << endl; cout << m << endl; cout << l << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int h = 0, m = 0, l = 0, tmp, i; for (i = 0; i < 10; i++) { cin >> tmp; if (tmp >= h) { l = m; m = h; h = tmp; } else if (tmp >= m) { l = m; m = tmp; } else if (tmp >= l) { l = tmp; } } cout << h << endl; cout << m << endl; cout << l << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
119
2
#include <iostream> int main() { int a[10]; int b; for (int i = 0; i < 10; i++) { std::cin >> a[i]; } for (int i = 0; i < 10; i++) { for (int j = i + 1; j < 11; j++) { if (a[i] < a[j]) { b = a[i]; a[i] = a[j]; a[j] = b; } } } for (int i = 0; i < 3; i++) { std::cout << a[i] << std::endl; } return 0; }
#include <iostream> int main() { int a[10]; int b; for (int i = 0; i < 10; i++) { std::cin >> a[i]; } for (int i = 0; i < 9; i++) { for (int j = i + 1; j < 10; j++) { if (a[i] < a[j]) { b = a[i]; a[i] = a[j]; a[j] = b; } } } for (int i = 0; i < 3; i++) { std::cout << a[i] << std::endl; } return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
146
4
#include <algorithm> #include <stdio.h> using namespace std; int main() { const int N = 10; int height[N]; for (int i = 0; i < 10; i++) { scanf("%d", &height[i]); } sort(height, height + N); reverse(height, height + N); for (int j = 0; j < 3; j++) { printf("%d", height[j]); } return 0; }
#include <algorithm> #include <stdio.h> using namespace std; int main() { const int N = 10; int height[N]; for (int i = 0; i < 10; i++) { scanf("%d", &height[i]); } sort(height, height + N); reverse(height, height + N); for (int j = 0; j < 3; j++) { printf("%d\n", height[j]); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
1
104
1
#include <iostream> using namespace std; int main() { int top[5] = {0, 0, 0, 0, 0}; int yama; cin >> top[0]; for (int i = 0; i < 9; i++) { cin >> yama; for (int j = 0; j < 3; j++) { if (yama > top[j]) { top[j + 2] = top[j + 1]; top[j + 1] = top[j]; top[j] = yama; break; } } } for (int i = 0; i < 3; i++) cout << top[0] << endl; return 0; }
#include <iostream> using namespace std; int main() { int top[5] = {0, 0, 0, 0, 0}; int yama; cin >> top[0]; for (int i = 0; i < 9; i++) { cin >> yama; for (int j = 0; j < 3; j++) { if (yama > top[j]) { top[j + 2] = top[j + 1]; top[j + 1] = top[j]; top[j] = yama; break; } } } for (int i = 0; i < 3; i++) cout << top[i] << endl; return 0; }
[["-", 0, 16, 31, 16, 12, 69, 341, 342, 0, 13], ["+", 0, 16, 31, 16, 12, 69, 341, 342, 0, 22]]
1
148
2
#include <iostream> using namespace std; int main() { const int N = 10; int A[N]; const int M = 3; int top[M] = {0}; for (int i = 0; i < N; i++) cin >> A[i]; for (int i = 0; i < N; i++) { if (top[0] < A[i]) { top[2] = top[1]; top[1] = top[0]; top[0] = A[i]; } else if (top[1] < A[i]) { top[2] = top[1]; top[1] = A[i]; } else if (top[2] < A[i]) top[2] = A[i]; } for (int i = 0; i < M; i++) cout << ' ' << top[i]; cout << endl; return 0; }
#include <iostream> using namespace std; int main() { const int N = 10; int A[N]; const int M = 3; int top[M] = {0}; for (int i = 0; i < N; i++) cin >> A[i]; for (int i = 0; i < N; i++) { if (top[0] < A[i]) { top[2] = top[1]; top[1] = top[0]; top[0] = A[i]; } else if (top[1] < A[i]) { top[2] = top[1]; top[1] = A[i]; } else if (top[2] < A[i]) top[2] = A[i]; } for (int i = 0; i < M; i++) cout << top[i] << endl; return 0; }
[["-", 8, 1, 0, 16, 31, 16, 12, 103, 0, 104], ["-", 8, 1, 0, 16, 31, 16, 12, 103, 0, 125], ["-", 8, 9, 0, 7, 8, 1, 0, 16, 17, 151], ["-", 0, 14, 8, 9, 0, 7, 8, 1, 0, 35], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22]]
1
211
6
#include <iostream> using namespace std; int main() { int height[10], i, a = 0, b = 0, c = 0; for (i = 0; i < 10; i++) { cin >> height[i]; } for (i = 0; i < 10; i++) { if (height[i] >= a) { b = a; a = height[i]; } else if (height[i] >= b) { c = b; b = height[i]; } else if (height[i] >= c) { c = height[i]; } } cout << a << endl << b << endl << c << endl; return 0; }
#include <iostream> using namespace std; int main() { int height[10], i, a = 0, b = 0, c = 0; for (i = 0; i < 10; i++) { cin >> height[i]; } for (i = 0; i < 10; i++) { if (height[i] >= a) { c = b; b = a; a = height[i]; } else if (height[i] >= b) { c = b; b = height[i]; } else if (height[i] >= c) { c = height[i]; } } cout << a << endl << b << endl << c << endl; return 0; }
[["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
1
150
4
#include <iostream> using namespace std; int main() { int a[100]; int list[4] = {0, 0, 0, 0}; for (int i = 1; i < 10; i++) { cin >> a[i]; if (list[1] < a[i]) { list[3] = list[2]; list[2] = list[1]; list[1] = a[i]; } else if (list[2] < a[i]) { list[3] = list[2]; list[2] = a[i]; } else if (list[3] < a[i]) { list[3] = a[i]; } } for (int j = 1; j <= 3; j++) { cout << list[j] << endl; } return 0; }
#include <iostream> using namespace std; int main() { int a[100]; int list[4] = {0, 0, 0, 0}; for (int i = 1; i <= 10; i++) { cin >> a[i]; if (list[1] < a[i]) { list[3] = list[2]; list[2] = list[1]; list[1] = a[i]; } else if (list[2] < a[i]) { list[3] = list[2]; list[2] = a[i]; } else if (list[3] < a[i]) { list[3] = a[i]; } } for (int j = 1; j <= 3; j++) { cout << list[j] << endl; } return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
189
2
#include <iostream> using namespace std; int main(int argc, char *argv[]) { int h1 = 0, h2 = 0, h3 = 0, h; for (int i = 1; i < 10; i++) { cin >> h; if (h > h3) { h3 = h; if (h3 > h2) { swap(h3, h2); if (h2 > h1) { swap(h2, h1); } } } } cout << h1 << endl; cout << h2 << endl; cout << h3 << endl; return 0; }
#include <iostream> using namespace std; int main(int argc, char *argv[]) { int h1 = 0, h2 = 0, h3 = 0, h; for (int i = 1; i < 11; i++) { cin >> h; if (h > h3) { h3 = h; if (h3 > h2) { swap(h3, h2); if (h2 > h1) { swap(h2, h1); } } } } cout << h1 << endl; cout << h2 << endl; cout << h3 << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
118
2
process.stdin .on('data', function(c) { c.trim().split('\n').forEach(function(e) { i = e.split(' '); console.log((+i[0] + (+i[1]) + '').length) }) }) .resume()
process.stdin .on('data', function(c) { (c + '').trim().split('\n').forEach(function(e) { i = e.split(' '); console.log((+i[0] + (+i[1]) + '').length) }) }) .resume()
[["+", 63, 558, 500, 2, 63, 558, 500, 23, 0, 24], ["+", 500, 2, 63, 558, 500, 23, 0, 16, 17, 72], ["+", 63, 558, 500, 23, 0, 16, 12, 557, 0, 104], ["+", 63, 558, 500, 2, 63, 558, 500, 23, 0, 25]]
2
79
5
require("fs") .readFileSync("/dev/stdin", "utf8") .trim() .split('\n') .forEach(function(e) { i = e.split(' '); console.log((+i[0] + i[1]).length) })
require("fs") .readFileSync("/dev/stdin", "utf8") .trim() .split('\n') .map(function(e) { i = e.split(' '); console.log((+i[0] + (+i[1]) + '').length) })
[["-", 0, 493, 0, 1, 0, 2, 63, 558, 559, 560], ["+", 0, 493, 0, 1, 0, 2, 63, 558, 559, 560], ["+", 0, 558, 500, 23, 0, 16, 31, 16, 17, 72], ["+", 500, 23, 0, 16, 31, 16, 12, 23, 0, 24], ["+", 500, 23, 0, 16, 31, 16, 12, 23, 0, 25], ["+", 3, 3, 0, 558, 500, 23, 0, 16, 17, 72], ["+", 0, 558, 500, 23, 0, 16, 12, 557, 0, 104]]
2
68
8
x = require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\n\s]/); for (i = 0; console.log(String(x[i++] * 1 + x[i++] * 1).length), i < 199;) { };
x = require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\n\s]/); for (i = 0; console.log(String(x[i++] * 1 + x[i++] * 1).length), i < x.length - 2;) { };
[["-", 0, 7, 15, 1, 0, 563, 12, 16, 12, 555], ["+", 0, 563, 12, 16, 12, 16, 31, 558, 500, 22], ["+", 0, 563, 12, 16, 12, 16, 31, 558, 0, 131], ["+", 0, 563, 12, 16, 12, 16, 31, 558, 559, 560], ["+", 15, 1, 0, 563, 12, 16, 12, 16, 17, 33], ["+", 15, 1, 0, 563, 12, 16, 12, 16, 12, 555]]
2
67
6
function main(input) { var lines = input.split("\n").slice(0, 200); for (var i = 0; i < lines.length; i++) { var digits = lines[i].split(" ").map(function(value) { return parseInt(value); }); var digit = digits[0] + digits[1]; if (!isNaN(digit)) { console.log((digitString + '').length); } } } main(require('fs').readFileSync('/dev/stdin', 'utf8'));
function main(input) { var lines = input.split("\n").slice(0, 200); for (var i = 0; i < lines.length; i++) { var digits = lines[i].split(" ").map(function(value) { return parseInt(value); }); var digit = digits[0] + digits[1]; if (!isNaN(digit)) { console.log((digit + '').length); } } } main(require('fs').readFileSync('/dev/stdin', 'utf8'));
[["-", 3, 3, 0, 558, 500, 23, 0, 16, 31, 22], ["+", 3, 3, 0, 558, 500, 23, 0, 16, 31, 22]]
2
133
2
function main(input) { input = input.split("\n"); for (var i = 0; i < input.length; ++i) { var ln = input[i].split(" "); var a = parseInt(ln.shift()); var b = parseInt(ln.shift()); console.log((a + b).toString().length); } } main(require("fs").readFileSync("/dev/stdin", "utf8"));
function main(input) { input = input.trim().split("\n"); for (var i = 0; i < input.length; ++i) { var ln = input[i].split(" "); var a = parseInt(ln.shift()); var b = parseInt(ln.shift()); console.log((a + b).toString().length); } } main(require("fs").readFileSync("/dev/stdin", "utf8"));
[["+", 12, 2, 63, 558, 500, 2, 63, 558, 559, 560], ["+", 12, 2, 63, 558, 500, 2, 3, 3, 0, 24], ["+", 12, 2, 63, 558, 500, 2, 3, 3, 0, 25], ["+", 0, 1, 0, 11, 12, 2, 63, 558, 0, 131]]
2
113
4
<?php fgets(STDIN); while($line=fgets(STDIN)){ $num[]=$line; } foreach($num as $ele){ $ele2=explode(" ",$ele); echo strlen($ele2[0]+$ele2[1])."\n"; }
<?php while($line=fgets(STDIN)){ $num[]=$line; } foreach($num as $ele){ $ele2=explode(" ",$ele); echo strlen($ele2[0]+$ele2[1])."\n"; }
[["-", 36, 36, 0, 493, 0, 1, 0, 613, 63, 141], ["-", 0, 493, 0, 1, 0, 613, 3, 3, 0, 24], ["-", 0, 1, 0, 613, 3, 3, 0, 28, 0, 141], ["-", 0, 493, 0, 1, 0, 613, 3, 3, 0, 25], ["-", 36, 36, 36, 36, 0, 493, 0, 1, 0, 35]]
6
69
5
<?php while($l=fgets(STDIN)){ if(!$l) break; list($a,$b)=explode(' ',$l); $c=$a+$b; $d=0; while(9<$c){++$d;$c=floor($c/10);} echo $d,PHP_EOL; } ?>
<?php while($l=fgets(STDIN)){ if(!$l) break; list($a,$b)=explode(' ',$l); $c=$a+$b; $d=1; while(9<$c){++$d;$c=floor($c/10);} echo $d,PHP_EOL; }
[["-", 0, 52, 8, 9, 0, 1, 0, 11, 12, 612], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 612], ["-", 36, 36, 36, 36, 36, 36, 0, 493, 0, 611]]
6
85
3
for(;fscanf(STDIN,"%d %d",$a,$b);)print strlen($a+$b)."\n";
<?php for(;fscanf(STDIN,"%d %d",$a,$b);)print strlen($a+$b)."\n";
[["+", 36, 36, 36, 36, 36, 36, 0, 493, 0, 605]]
6
33
1
<?php for ( ; fscanf ( STDIN , "%d %d", $a,$b) ; ){ echo mb_strlen($a+$b)."\n"; } ?>
<?php for ( ; fscanf ( STDIN , "%d %d", $a,$b) ; ){ echo strlen($a+$b)."\n"; } ?>
[["-", 0, 9, 0, 608, 0, 16, 31, 613, 63, 141], ["+", 0, 9, 0, 608, 0, 16, 31, 613, 63, 141]]
6
37
2