problem_id
stringlengths
6
6
language
stringclasses
2 values
original_status
stringclasses
3 values
original_src
stringlengths
19
243k
changed_src
stringlengths
19
243k
change
stringclasses
3 values
i1
int64
0
8.44k
i2
int64
0
8.44k
j1
int64
0
8.44k
j2
int64
0
8.44k
error
stringclasses
270 values
stderr
stringlengths
0
226k
p03075
Python
Runtime Error
a = [] for i in range(5): a.append(int(input())) k = input() if a[4] - a[0] <= k: print("Yay!") else: print(":(")
a = [] for i in range(5): a.append(int(input())) k = int(input()) if a[4] - a[0] <= k: print("Yay!") else: print(":(")
replace
3
4
3
4
TypeError: '<=' not supported between instances of 'int' and 'str'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03075/Python/s717045330.py", line 6, in <module> if a[4] - a[0] <= k: TypeError: '<=' not supported between instances of 'int' and 'str'
p03075
Python
Runtime Error
num_list = [] while True: element = input() if element is None: break if element == "": break num_list.append(int(element)) limit = num_list[-1] ans_string = "Yay!" # for i in range(len(num_list) - 1): # print(num_list[i + 1] - num_list[i]) # if num_list[i + 1] - num_list[i] > limit: # ans_string = ":(" for i in range(len(num_list) - 1): for j in range(i, len(num_list) - 1): if num_list[j] - num_list[i] > limit: ans_string = ":(" print(ans_string)
num_list = [] while True: try: element = input() except EOFError: break num_list.append(int(element)) limit = num_list[-1] ans_string = "Yay!" # for i in range(len(num_list) - 1): # print(num_list[i + 1] - num_list[i]) # if num_list[i + 1] - num_list[i] > limit: # ans_string = ":(" for i in range(len(num_list) - 1): for j in range(i, len(num_list) - 1): if num_list[j] - num_list[i] > limit: ans_string = ":(" print(ans_string)
replace
2
7
2
5
EOFError: EOF when reading a line
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03075/Python/s458326376.py", line 3, in <module> element = input() EOFError: EOF when reading a line
p03076
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1e9 + 7; int main() { vector<pair<ll, ll>> V; ll ans = 0; for (int i = 0; i < 5; i++) { ll x; cin >> x; if (x % 10 == 0) ans += x; else V.push_back(make_pair(x % 10, x)); } sort(V.begin(), V.end()); for (int i = V.size() - 1; i >= 1; i--) { ll x = V[i].second; if (x % 10 == 0) ans += x; else ans += (x / 10 + 1) * 10; } cout << ans + V[0].second << endl; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1e9 + 7; int main() { vector<pair<ll, ll>> V; ll ans = 0; for (int i = 0; i < 5; i++) { ll x; cin >> x; if (x % 10 == 0) ans += x; else V.push_back(make_pair(x % 10, x)); } if (V.size() == 0) { cout << ans << endl; return 0; } sort(V.begin(), V.end()); for (int i = V.size() - 1; i >= 1; i--) { ll x = V[i].second; if (x % 10 == 0) ans += x; else ans += (x / 10 + 1) * 10; } cout << ans + V[0].second << endl; }
insert
16
16
16
20
0
p03076
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int tmp; int ans = 0; vector<int> rems; for (int i = 0; i < 5; i++) { cin >> tmp; if (tmp % 10 == 0) ans += tmp; else { ans += ((tmp / 10) + 1) * 10; rems.push_back(10 - tmp % 10); } } int maxi = *max_element(rems.begin(), rems.end()); cout << ans - maxi << '\n'; return 0; }
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int tmp; int ans = 0; vector<int> rems; for (int i = 0; i < 5; i++) { cin >> tmp; if (tmp % 10 == 0) ans += tmp; else { ans += ((tmp / 10) + 1) * 10; rems.push_back(10 - tmp % 10); } } if (rems.empty()) cout << ans << '\n'; else { int maxi = *max_element(rems.begin(), rems.end()); cout << ans - maxi << '\n'; } return 0; }
replace
21
24
21
27
0
p03076
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define rep3(i, m, n) for (int(i) = m; (i) <= (n); (i)++) #define rep3rev(i, m, n) for (int(i) = m; (i) >= (n); (i)--) #define all(a) (a.begin()), (a.end()) #define rall(a) (a.rbegin()), (a.rend()) #define fi first #define se second #define pb push_back #define eb emplace_back using ll = long long; using vll = vector<ll>; using vi = vector<int>; using vvi = vector<vector<int>>; using P = pair<int, int>; void Main() { vi a(5); int tot = 0; multiset<int> r; rep(i, 5) { cin >> a[i]; if (a[i] % 10 != 0) r.insert(10 - a[i] % 10); a[i] = (a[i] + 9) / 10; a[i] *= 10; tot += a[i]; } // cout << tot << endl; // cout << *r.rbegin() << endl; cout << tot - *r.rbegin() << endl; return; } int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); cout << fixed << setprecision(15); Main(); return 0; }
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define rep3(i, m, n) for (int(i) = m; (i) <= (n); (i)++) #define rep3rev(i, m, n) for (int(i) = m; (i) >= (n); (i)--) #define all(a) (a.begin()), (a.end()) #define rall(a) (a.rbegin()), (a.rend()) #define fi first #define se second #define pb push_back #define eb emplace_back using ll = long long; using vll = vector<ll>; using vi = vector<int>; using vvi = vector<vector<int>>; using P = pair<int, int>; void Main() { vi a(5); int tot = 0; multiset<int> r; rep(i, 5) { cin >> a[i]; if (a[i] % 10 != 0) r.insert(10 - a[i] % 10); a[i] = (a[i] + 9) / 10; a[i] *= 10; tot += a[i]; } // cout << tot << endl; // cout << *r.rbegin() << endl; if (r.empty()) cout << tot << endl; else cout << tot - *r.rbegin() << endl; return; } int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); cout << fixed << setprecision(15); Main(); return 0; }
replace
35
37
35
39
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { vector<pair<int, int>> v; int sum = 0; for (int i = 0; i < 5; i++) { int x; cin >> x; if (x % 10 == 0) { sum += x; } else { v.push_back(make_pair(x % 10, x)); } } sort(v.begin(), v.end()); sum += v[0].second; for (int i = 1; i < v.size(); i++) { sum += round(v[i].second / 10.0) * 10; } cout << sum; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { vector<pair<int, int>> v; int sum = 0; for (int i = 0; i < 5; i++) { int x; cin >> x; if (x % 10 == 0) { sum += x; } else { v.push_back(make_pair(x % 10, x)); } } if (!v.empty()) { sort(v.begin(), v.end()); sum += v[0].second; for (int i = 1; i < v.size(); i++) { sum += ceil(v[i].second / 10.0) * 10; } } cout << sum; return 0; }
replace
14
18
14
20
0
p03076
C++
Runtime Error
#include <iostream> using namespace std; int a[6]; int main() { int i, min = 9, f, c = -10000, s = 0; for (i = 1; i <= 5; i++) { cin >> a[i]; } for (i = 1; i <= 5; i++) { f = a[i] % 10; if (f != 0 && f < min) { min = f; c = i; } } for (i = 1; i <= 5; i++) { if (i != c) { s = s + (a[i] + 9) / 10 * 10; } } cout << s + a[c]; return 0; }
#include <iostream> using namespace std; int a[6]; int main() { int i, min = 9, f, c = 1, s = 0; for (i = 1; i <= 5; i++) { cin >> a[i]; } for (i = 1; i <= 5; i++) { f = a[i] % 10; if (f != 0 && f < min) { min = f; c = i; } } for (i = 1; i <= 5; i++) { if (i != c) { s = s + (a[i] + 9) / 10 * 10; } } cout << s + a[c]; return 0; }
replace
4
5
4
5
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define MOD 1000000007 #define PI 3.141592653589793 const int INF = 100000000; int dx[] = {0, 1, -1, 0, 1, -1, 1, -1}; int dy[] = {1, 0, 0, -1, 1, -1, -1, 1}; int main() { vector<int> v(5); int maxw = 0, idx; for (int i = 0; i < 5; i++) { int a; cin >> a; v[i] = a; int wait = (130 - a) % 10; if (wait > maxw) { maxw = wait; idx = i; } } int ans = 0; for (int i = 0; i < 5; i++) { if (i == idx) continue; ans += v[i] + (130 - v[i]) % 10; } ans += v[idx]; cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define MOD 1000000007 #define PI 3.141592653589793 const int INF = 100000000; int dx[] = {0, 1, -1, 0, 1, -1, 1, -1}; int dy[] = {1, 0, 0, -1, 1, -1, -1, 1}; int main() { vector<int> v(5); int maxw = 0, idx = 0; for (int i = 0; i < 5; i++) { int a; cin >> a; v[i] = a; int wait = (130 - a) % 10; if (wait > maxw) { maxw = wait; idx = i; } } int ans = 0; for (int i = 0; i < 5; i++) { if (i == idx) continue; ans += v[i] + (130 - v[i]) % 10; } ans += v[idx]; cout << ans << endl; }
replace
12
13
12
13
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long int #define ull unsigned long long int int main() { vector<ll> a(5); for (ll i = 0; i < 5; i++) { cin >> a[i]; } ll m = INT_MAX, pos, c; for (ll i = 0; i < 5; i++) { ll k = a[i] % 10; if (k == 0) continue; else { if (k < m) { m = k; pos = a[i]; c = i; } } } ll sum = pos; a.erase(a.begin() + c); for (ll i = 0; i < 4; i++) { if (a[i] % 10 == 0) { sum = sum + a[i]; } else { sum = sum + (((a[i] / 10) + 1) * 10); } } cout << sum << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #define ll long long int #define ull unsigned long long int int main() { vector<ll> a(5); for (ll i = 0; i < 5; i++) { cin >> a[i]; } ll m = INT_MAX, pos, c; for (ll i = 0; i < 5; i++) { ll k = a[i] % 10; if (k == 0) continue; else { if (k < m) { m = k; pos = a[i]; c = i; } } } if (m == INT_MAX) { pos = a[0]; c = 0; } ll sum = pos; a.erase(a.begin() + c); for (ll i = 0; i < 4; i++) { if (a[i] % 10 == 0) { sum = sum + a[i]; } else { sum = sum + (((a[i] / 10) + 1) * 10); } } cout << sum << endl; return 0; }
replace
24
25
24
28
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; signed main(void) { vector<int> v(5), s(5); pair<int, int> tmp; int now; tmp.first = tmp.second = 10; rep(i, 5) { cin >> v.at(i); if (v[i] % 10 != 0) { if (tmp.first > v[i] % 10) { tmp.first = v[i] % 10; tmp.second = i; } } } swap(v.at(tmp.second), v.at(4)); now = v.at(0); rep(i, 4) { if (now % 10 != 0) now += (10 - now % 10); now += v.at(i + 1); } cout << now << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; signed main(void) { vector<int> v(5), s(5); pair<int, int> tmp; int now; tmp.first = 9; tmp.second = 4; rep(i, 5) { cin >> v.at(i); if (v[i] % 10 != 0) { if (tmp.first > v[i] % 10) { tmp.first = v[i] % 10; tmp.second = i; } } } swap(v.at(tmp.second), v.at(4)); now = v.at(0); rep(i, 4) { if (now % 10 != 0) now += (10 - now % 10); now += v.at(i + 1); } cout << now << endl; return 0; }
replace
9
10
9
11
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> #include <map> // pair using namespace std; int main() { vector<int> A(5); int min_num = 130; int min_ind; for (int i = 0; i < 5; i++) { cin >> A.at(i); if (min_num > A.at(i) % 10 && A.at(i) % 10 != 0) { min_num = A.at(i) % 10; min_ind = i; } } int time = 0; for (int i = 0; i < 5; i++) { int add_time; if (A.at(i) % 10 == 0) add_time = A.at(i); else add_time = 10 * (A.at(i) / 10) + 10; if (i != min_ind) time += add_time; } time += A.at(min_ind); cout << time << endl; }
#include <bits/stdc++.h> #include <map> // pair using namespace std; int main() { vector<int> A(5); int min_num = 130; int min_ind = 0; for (int i = 0; i < 5; i++) { cin >> A.at(i); if (min_num > A.at(i) % 10 && A.at(i) % 10 != 0) { min_num = A.at(i) % 10; min_ind = i; } } int time = 0; for (int i = 0; i < 5; i++) { int add_time; if (A.at(i) % 10 == 0) add_time = A.at(i); else add_time = 10 * (A.at(i) / 10) + 10; if (i != min_ind) time += add_time; } time += A.at(min_ind); cout << time << endl; }
replace
6
7
6
7
0
p03076
C++
Runtime Error
#include <cstdio> #include <string> using namespace std; #define COUNT 5 int main(void) { int a, b, c, d, e; int duration[COUNT]; int i; for (i = 0; i < COUNT; i++) scanf("%d", duration[i]); int idxMinMod = 0; int minMod = duration[0] % 10; for (i = 1; i < COUNT; i++) { int mod = duration[i] % 10; if (mod > 0 && mod < minMod) { idxMinMod = i; minMod = mod; } } int totalDuration = 0; for (i = 0; i < COUNT; i++) { if (i == idxMinMod) { totalDuration += duration[i]; } else { totalDuration += (duration[i] / 10) * 10; if (duration[i] % 10 != 0) { totalDuration += 10; } } } printf("%d\n", totalDuration); fflush(stdout); return 0; }
#include <cstdio> #include <string> using namespace std; #define COUNT 5 int main(void) { int a, b, c, d, e; int duration[COUNT]; int i; for (i = 0; i < COUNT; i++) scanf("%d", &duration[i]); int idxMinMod = 0; int minMod = duration[0] % 10; for (i = 1; i < COUNT; i++) { int mod = duration[i] % 10; if (mod > 0 && mod < minMod) { idxMinMod = i; minMod = mod; } } int totalDuration = 0; for (i = 0; i < COUNT; i++) { if (i == idxMinMod) { totalDuration += duration[i]; } else { totalDuration += (duration[i] / 10) * 10; if (duration[i] % 10 != 0) { totalDuration += 10; } } } printf("%d\n", totalDuration); fflush(stdout); return 0; }
replace
12
13
12
13
-11
p03076
Python
Runtime Error
a = int(input()) b = int(input()) c = int(input()) d = int(input()) e = int(input()) li = [a, b, c, d, e] li_2 = [] d = 10 count = 0 adr = 0 for i in li: li_2.append(i % 10) for i in li_2: if i < d and i != 0: d = i ans = adr adr += 1 if d == 10: d = 0 for i in range(5): if i != ans and li_2[i] != 0: count += li[i] - li_2[i] + 10 elif i != ans and li_2[i] == 0: count += li[i] count += li[ans] print(count)
a = int(input()) b = int(input()) c = int(input()) d = int(input()) e = int(input()) li = [a, b, c, d, e] li_2 = [] d = 10 count = 0 adr = 0 for i in li: li_2.append(i % 10) for i in li_2: if i < d and i != 0: d = i ans = adr adr += 1 if d == 10: d = 0 ans = 0 for i in range(5): if i != ans and li_2[i] != 0: count += li[i] - li_2[i] + 10 elif i != ans and li_2[i] == 0: count += li[i] count += li[ans] print(count)
insert
19
19
19
20
0
p03076
Python
Runtime Error
import math def solve(): abcde = [int(input()) for _ in range(5)] last = min( [i for i in abcde if not str(i)[-1] == "0"], key=lambda x: abs(int(str(x)[-1])) ) hoge = sum([math.ceil(i / 10) * 10 for i in abcde]) - (math.ceil(last / 10) * 10) print(hoge + last) if __name__ == "__main__": solve()
import math def solve(): abcde = [int(input()) for _ in range(5)] if any([str(i)[-1] != "0" for i in abcde]): last = min( [i for i in abcde if not str(i)[-1] == "0"], key=lambda x: abs(int(str(x)[-1])), ) else: last = min(abcde) hoge = sum([math.ceil(i / 10) * 10 for i in abcde]) - (math.ceil(last / 10) * 10) print(hoge + last) if __name__ == "__main__": solve()
replace
5
8
5
12
0
p03076
Python
Runtime Error
times = [] ones = [] for i in range(5): t = int(input()) times.append((t + 9) // 10 * 10) ones.append(t % 10) ones.sort() print(sum(times) - 10 + min(filter(lambda x: x, ones)))
times = [] ones = [10] for i in range(5): t = int(input()) times.append((t + 9) // 10 * 10) ones.append(t % 10) ones.sort() print(sum(times) - 10 + min(filter(lambda x: x, ones)))
replace
1
2
1
2
0
p03076
Python
Runtime Error
A = int(input()) B = int(input()) C = int(input()) D = int(input()) E = int(input()) answer = 0 cooking_time_order = sorted([A, B, C, D, E], key=lambda x: 10 - (x % 10)) for _ in range(5): if cooking_time_order[-1] % 10 == 0: answer += cooking_time_order[-1] cooking_time_order.pop() else: break for cooking_time in cooking_time_order[:-1]: answer += cooking_time + (10 - (cooking_time % 10)) answer += cooking_time_order[-1] print(answer)
A = int(input()) B = int(input()) C = int(input()) D = int(input()) E = int(input()) answer = 0 cooking_time_order = sorted([A, B, C, D, E], key=lambda x: 10 - (x % 10)) for _ in range(5): if cooking_time_order[-1] % 10 == 0: answer += cooking_time_order[-1] cooking_time_order.pop() else: break if len(cooking_time_order) == 0: pass else: for cooking_time in cooking_time_order[:-1]: answer += cooking_time + (10 - (cooking_time % 10)) answer += cooking_time_order[-1] print(answer)
replace
13
16
13
19
0
p03076
Python
Runtime Error
import math def main(): ans = 0 t = [] for _ in range(5): x = input() if x[-1] == "0": ans += int(x) else: t.append(int(x)) t.sort(key=lambda x: str(x)[-1]) for i in range(1, len(t)): ans += math.ceil(t[i] / 10) * 10 ans += t[0] print(ans) main()
import math def main(): ans = 0 t = [] for _ in range(5): x = input() if x[-1] == "0": ans += int(x) else: t.append(int(x)) if len(t) > 0: t.sort(key=lambda x: str(x)[-1]) for i in range(1, len(t)): ans += math.ceil(t[i] / 10) * 10 ans += t[0] print(ans) main()
replace
12
16
12
17
0
p03076
Python
Runtime Error
menu = [int(input()) for _ in range(5)] ans = 0 mod = [] for time in menu: if time % 10 == 0: ans += time else: ans += time mod.append(10 - time % 10) mod.remove(max(mod)) ans += sum(mod) print(ans)
menu = [int(input()) for _ in range(5)] ans = 0 mod = [] for time in menu: if time % 10 == 0: ans += time else: ans += time mod.append(10 - time % 10) try: mod.remove(max(mod)) ans += sum(mod) except: pass print(ans)
replace
9
11
9
14
0
p03076
Python
Runtime Error
a = [] for i in range(5): a.append(int(input())) def ceil10(n): if n % 10 == 0: return n else: return ((n // 10) + 1) * 10 def min_1(a): a2 = list(filter(lambda a: a > 0, (map(lambda e: e % 10, a)))) return min(a2) ans = sum(map(ceil10, a)) - 10 + min_1(a) print(ans)
a = [] for i in range(5): a.append(int(input())) def ceil10(n): if n % 10 == 0: return n else: return ((n // 10) + 1) * 10 def min_1(a): a2 = list(filter(lambda a: a > 0, list(map(lambda e: e % 10, a)))) if len(a2) == 0: return 10 return min(a2) ans = sum(map(ceil10, a)) - 10 + min_1(a) print(ans)
replace
14
15
14
18
0
p03076
Python
Runtime Error
A = int(input()) B = int(input()) C = int(input()) D = int(input()) E = int(input()) orders = [A, B, C, D, E] max_fp = 10 ans = 0 for i, order in enumerate(orders): if order % 10 < max_fp and order % 10 != 0: max_fp = order % 10 last_order = i for i, order in enumerate(orders): if i == last_order or order % 10 == 0: ans += order else: ans += (order // 10 + 1) * 10 print(ans)
A = int(input()) B = int(input()) C = int(input()) D = int(input()) E = int(input()) orders = [A, B, C, D, E] max_fp = 10 ans = 0 last_order = 0 for i, order in enumerate(orders): if order % 10 < max_fp and order % 10 != 0: max_fp = order % 10 last_order = i for i, order in enumerate(orders): if i == last_order or order % 10 == 0: ans += order else: ans += (order // 10 + 1) * 10 print(ans)
insert
9
9
9
10
0
p03076
Python
Runtime Error
list_1 = [] list_2 = [] list_3 = [] for i in range(5): list_1.append(input()) for i in range(5): list_2.append(int(list_1[i]) % 10) for i in range(5): if list_2[i] != 0: list_3.append(-(list_2[i] - 10)) else: list_3.append(0) max_num = 0 for i in range(5): if list_3[i] > max_num: max_num = list_3[i] max_num_2 = i a1 = int(list_1.pop(max_num_2)) a2 = int(list_3.pop(max_num_2)) ans = 0 for i in range(4): ans += int(list_1[i]) ans += list_3[i] ans += a1 print(ans)
list_1 = [] list_2 = [] list_3 = [] for i in range(5): list_1.append(input()) for i in range(5): list_2.append(int(list_1[i]) % 10) for i in range(5): if list_2[i] != 0: list_3.append(-(list_2[i] - 10)) else: list_3.append(0) max_num = 0 max_num_2 = 0 for i in range(5): if list_3[i] > max_num: max_num = list_3[i] max_num_2 = i a1 = int(list_1.pop(max_num_2)) a2 = int(list_3.pop(max_num_2)) ans = 0 for i in range(4): ans += int(list_1[i]) ans += list_3[i] ans += a1 print(ans)
insert
17
17
17
18
0
p03076
Python
Runtime Error
orders = [int(input()) for _ in range(5)] rest = [] time = 0 for order in orders: if order % 10 == 0: time += order else: rest.append(order) rest_mods = list(map(lambda x: x % 10, rest)) min_mods_index = rest_mods.index(min(rest_mods)) for i in range(len(rest)): time += rest[i] if i != min_mods_index: time += 10 - rest[i] % 10 print(time)
orders = [int(input()) for _ in range(5)] rest = [] time = 0 for order in orders: if order % 10 == 0: time += order else: rest.append(order) rest_mods = list(map(lambda x: x % 10, rest)) if len(rest_mods) > 0: min_mods_index = rest_mods.index(min(rest_mods)) for i in range(len(rest)): time += rest[i] if i != min_mods_index: time += 10 - rest[i] % 10 else: time += sum(rest) print(time)
replace
11
16
11
20
0
p03076
Python
Runtime Error
def main() -> None: num = [int(input()) for _ in range(5)] ans = 0 m = [] for i in num: if i % 10: ans += i + 10 - i % 10 m.append(10 - i % 10) else: ans += i print(ans - max(m)) if __name__ == "__main__": main()
def main() -> None: num = [int(input()) for _ in range(5)] ans = 0 m = [0] for i in num: if i % 10: ans += i + 10 - i % 10 m.append(10 - i % 10) else: ans += i print(ans - max(m)) if __name__ == "__main__": main()
replace
3
4
3
4
0
p03076
Python
Runtime Error
import math ABCDE = [int(input()) for _ in range(5)] print( sum([10 * math.ceil(_ / 10) for _ in ABCDE]) + min([_ % 10 for _ in ABCDE if _ % 10]) - 10 )
import math ABCDE = [int(input()) for _ in range(5)] print( sum([10 * math.ceil(_ / 10) for _ in ABCDE]) + min([10] + [_ % 10 for _ in ABCDE if _ % 10]) - 10 )
replace
5
6
5
6
0
p03076
Python
Runtime Error
import math time_list = list() for _ in range(5): time_list.append(int(input())) def key_func(x): if x < 100: # 2桁 or 1桁の場合 if x % 10 == 0: return 10 return x % 10 # ex: 19の場合は9を返す else: if x % 100 == 0: return 10 return x % 100 # ex: 123の場合は3を返す time_list.sort(key=key_func, reverse=True) # print(time_list) ans = sum for i, time in enumerate(time_list): if i < len(time_list) - 1: ans += math.ceil(time / 10) * 10 else: ans += time print(ans)
import math time_list = list() for _ in range(5): time_list.append(int(input())) # 全探索 ans = 1e6 for i in range(len(time_list)): tmp = 0 for j in range(len(time_list)): if i == j: tmp += time_list[i] continue tmp += math.ceil(time_list[j] / 10) * 10 ans = min(tmp, ans) print(ans)
replace
7
29
7
17
TypeError: unsupported operand type(s) for +=: 'builtin_function_or_method' and 'int'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03076/Python/s039938039.py", line 27, in <module> ans += math.ceil(time / 10) * 10 TypeError: unsupported operand type(s) for +=: 'builtin_function_or_method' and 'int'
p03076
Python
Runtime Error
cook = [] amari = [] t = 0 for i in range(5): cook.append(int(input())) for i in range(5): if cook[i] % 10 != 0: t += cook[i] + (10 - cook[i] % 10) else: t += cook[i] for i in range(5): if cook[i] % 10 != 0: amari.append(10 - cook[i] % 10) print(t - max(amari))
cook = [] amari = [0] t = 0 for i in range(5): cook.append(int(input())) for i in range(5): if cook[i] % 10 != 0: t += cook[i] + (10 - cook[i] % 10) else: t += cook[i] for i in range(5): if cook[i] % 10 != 0: amari.append(10 - cook[i] % 10) print(t - max(amari))
replace
1
2
1
2
0
p03076
Python
Runtime Error
times = [int(input()) for i in range(5)] cost = 0 p_times = [time % 10 for time in times] if sum(p_times) == 0 and min(p_times) > 0: last_order = False else: last_order = min([i for i in p_times if i > 0]) last_order_idx = p_times.index(last_order) if last_order: cost = times.pop(last_order_idx) for time in times: if time % 10 == 0: cost += time else: cost += time + (10 - time % 10) print(cost)
times = [int(input()) for i in range(5)] cost = 0 p_times = [time % 10 for time in times] if (sum([i % 10 for i in p_times]) == 0) & (min(times) > 0): last_order = False else: last_order = min([i for i in p_times if i > 0]) last_order_idx = p_times.index(last_order) if last_order: cost = times.pop(last_order_idx) for time in times: if time % 10 == 0: cost += time else: cost += time + (10 - time % 10) print(cost)
replace
3
4
3
5
0
p03076
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> int main() { std::vector<int> a(5); std::vector<int> uq; int sum = 0; for (int i = 0; i < 5; i++) { std::cin >> a[i]; if (a[i] % 10) { uq.push_back(a[i] % 10); a[i] += (10 - a[i] % 10); sum += a[i]; } else { sum += a[i]; } } int minuq = *std::min_element(uq.begin(), uq.end()); sum += (-10 + minuq); std::cout << sum << "\n"; }
#include <algorithm> #include <iostream> #include <vector> int main() { std::vector<int> a(5); std::vector<int> uq; int sum = 0; for (int i = 0; i < 5; i++) { std::cin >> a[i]; if (a[i] % 10) { uq.push_back(a[i] % 10); a[i] += (10 - a[i] % 10); sum += a[i]; } else { sum += a[i]; } } if (!uq.size()) { uq.push_back(10); } int minuq = *std::min_element(uq.begin(), uq.end()); sum += (-10 + minuq); std::cout << sum << "\n"; }
insert
19
19
19
22
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; using ull = unsigned long long; int main() { vector<ll> n(5); ll num = 1000; ll id; rep(i, 5) { cin >> n.at(i); if (num > n.at(i) % 10 && n.at(i) % 10 != 0) { num = n.at(i) % 10; id = i; } } ll ans = 0; rep(i, 5) { if (i == id) continue; ans += 10 * (ceil((double)n.at(i) / 10.0)); } ans += n.at(id); cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; using ull = unsigned long long; int main() { vector<ll> n(5); ll num = 10; ll id = 0; rep(i, 5) { cin >> n.at(i); if (num > n.at(i) % 10 && n.at(i) % 10 != 0) { num = n.at(i) % 10; id = i; } } ll ans = 0; rep(i, 5) { if (i == id) continue; ans += 10 * (ceil((double)n.at(i) / 10.0)); } ans += n.at(id); cout << ans << endl; return 0; }
replace
8
10
8
10
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; // 4近傍、8近傍 int dx[] = {1, 0, -1, 0, 1, -1, -1, 1}; int dy[] = {0, 1, 0, -1, 1, 1, -1, -1}; int main() { int a, b, c, d, e; cin >> a >> b >> c >> d >> e; int ans = a + b + c + d + e; vector<int> amari; if (a % 10 != 0) { amari.push_back(10 - a % 10); } if (b % 10 != 0) { amari.push_back(10 - b % 10); } if (c % 10 != 0) { amari.push_back(10 - c % 10); } if (d % 10 != 0) { amari.push_back(10 - d % 10); } if (e % 10 != 0) { amari.push_back(10 - e % 10); } sort(amari.begin(), amari.end()); for (int i = 0; i < amari.size() - 1; i++) { ans += amari[i]; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; // 4近傍、8近傍 int dx[] = {1, 0, -1, 0, 1, -1, -1, 1}; int dy[] = {0, 1, 0, -1, 1, 1, -1, -1}; int main() { int a, b, c, d, e; cin >> a >> b >> c >> d >> e; int ans = a + b + c + d + e; vector<int> amari; if (a % 10 != 0) { amari.push_back(10 - a % 10); } if (b % 10 != 0) { amari.push_back(10 - b % 10); } if (c % 10 != 0) { amari.push_back(10 - c % 10); } if (d % 10 != 0) { amari.push_back(10 - d % 10); } if (e % 10 != 0) { amari.push_back(10 - e % 10); } if (amari.size() > 0) { sort(amari.begin(), amari.end()); for (int i = 0; i < amari.size() - 1; i++) { ans += amari[i]; } } cout << ans << endl; return 0; }
replace
31
34
31
36
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { vector<int> a; int sum = 0; for (int i = 0; i < 5; i++) { int x; cin >> x; sum += x; if (x % 10 != 0) a.push_back(10 - x % 10); } sort(a.begin(), a.end()); for (int i = 0; i < a.size() - 1; i++) sum += a.at(i); cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { vector<int> a; int sum = 0; for (int i = 0; i < 5; i++) { int x; cin >> x; sum += x; if (x % 10 != 0) a.push_back(10 - x % 10); } if (!a.empty()) { sort(a.begin(), a.end()); for (int i = 0; i < a.size() - 1; i++) sum += a.at(i); } cout << sum << endl; }
replace
14
17
14
19
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; bool option(int a, int b) { return a % 10 > b % 10; } int main() { vector<int> a; int ans = 0; for (int i = 0; i < 5; i++) { int x; cin >> x; if (x % 10 == 0) { ans += x; } else { a.push_back(x); } } sort(a.begin(), a.end(), option); /*cout<<"ans = "<<ans<<endl; for(int x: a){ cout<<x<<" "; }cout<<endl;*/ for (int i = 0; i + 1 < a.size(); i++) { ans += (10 - a[i] % 10); ans += a[i]; } cout << ans + a[a.size() - 1]; return 0; }
#include <bits/stdc++.h> using namespace std; bool option(int a, int b) { return a % 10 > b % 10; } int main() { vector<int> a; int ans = 0; for (int i = 0; i < 5; i++) { int x; cin >> x; if (x % 10 == 0) { ans += x; } else { a.push_back(x); } } sort(a.begin(), a.end(), option); /*cout<<"ans = "<<ans<<endl; for(int x: a){ cout<<x<<" "; }cout<<endl;*/ if (a.size() == 0) { cout << ans; return 0; } if (a.size() == 1) { cout << a[0] + ans; return 0; } for (int i = 0; i + 1 < a.size(); i++) { ans += (10 - a[i] % 10); ans += a[i]; } cout << ans + a[a.size() - 1]; return 0; }
insert
20
20
20
28
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int setTime(int n) { if (n % 10 == 0) return n; else { int a = n / 10; return (a + 1) * 10; } } int main() { ios::sync_with_stdio(false); cin.tie(0); vector<int> pre(0); vector<pair<int, int>> vec(0); int a, tim = 0; for (int i = 0; i < 5; i++) { cin >> a; if (a % 10 == 0) tim += a; else vec.push_back(make_pair(a % 10, a)); } sort(vec.begin(), vec.end()); reverse(vec.begin(), vec.end()); int n = vec.size(); n = max(0, n - 1); for (int i = 0; i < n; i++) { tim += setTime(vec.at(i).second); } tim += vec.at(n).second; cout << tim << '\n'; }
#include <bits/stdc++.h> using namespace std; int setTime(int n) { if (n % 10 == 0) return n; else { int a = n / 10; return (a + 1) * 10; } } int main() { ios::sync_with_stdio(false); cin.tie(0); vector<int> pre(0); vector<pair<int, int>> vec(0); int a, tim = 0; for (int i = 0; i < 5; i++) { cin >> a; if (a % 10 == 0) tim += a; else vec.push_back(make_pair(a % 10, a)); } sort(vec.begin(), vec.end()); reverse(vec.begin(), vec.end()); int n = vec.size(); n = max(0, n - 1); for (int i = 0; i < n; i++) { tim += setTime(vec.at(i).second); } if (vec.size() != 0) tim += vec.at(n).second; cout << tim << '\n'; }
replace
30
31
30
32
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; using ll = long long; bool sort_by_second(pair<int, int> a, pair<int, int> b) { if (a.second != b.second) { return a.second < b.second; } else { return a.first < b.first; } } int main() { vector<pair<int, int>> t; int sum = 0; rep(i, 5) { int a; cin >> a; int b = a % 10; if (b == 0) sum += a; else t.push_back(make_pair(a, b)); } sort(t.begin(), t.end(), sort_by_second); sum += t[0].first; for (int i = 1; i < t.size(); i++) sum += t[i].first - t[i].second + 10; cout << sum << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; using ll = long long; bool sort_by_second(pair<int, int> a, pair<int, int> b) { if (a.second != b.second) { return a.second < b.second; } else { return a.first < b.first; } } int main() { vector<pair<int, int>> t; int sum = 0; rep(i, 5) { int a; cin >> a; int b = a % 10; if (b == 0) sum += a; else t.push_back(make_pair(a, b)); } if (t.empty()) { cout << sum << endl; return 0; } sort(t.begin(), t.end(), sort_by_second); sum += t[0].first; for (int i = 1; i < t.size(); i++) sum += t[i].first - t[i].second + 10; cout << sum << endl; }
insert
25
25
25
29
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long int; int main() { vector<int> dishes(5); rep(i, 5) cin >> dishes.at(i); vector<int> notpit; rep(i, 5) { if (dishes.at(i) % 10 != 0) { notpit.push_back(10 - (dishes.at(i) % 10)); } } sort(notpit.begin(), notpit.end()); int time = 0; sort(dishes.begin(), dishes.end()); rep(i, 5) time += dishes.at(i); rep(i, notpit.size() - 1) time += notpit.at(i); cout << time << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long int; int main() { vector<int> dishes(5); rep(i, 5) cin >> dishes.at(i); vector<int> notpit; rep(i, 5) { if (dishes.at(i) % 10 != 0) { notpit.push_back(10 - (dishes.at(i) % 10)); } } sort(notpit.begin(), notpit.end()); int time = 0; sort(dishes.begin(), dishes.end()); rep(i, 5) time += dishes.at(i); if (notpit.size() > 0) rep(i, notpit.size() - 1) time += notpit.at(i); cout << time << endl; }
replace
18
19
18
20
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> typedef long long LL; using namespace std; int main() { int sum = 0; vector<int> a; for (int i = 0; i < 5; i++) { int t; cin >> t; if (t % 10 == 0) sum += t; else a.push_back(t); } int x; int y = 10; for (int i = 0; i < a.size(); i++) { int s = a[i] % 10; if (s < y) x = i, y = s; } sum += a[x]; for (int i = 0; i < a.size(); i++) { if (i == x) continue; sum += a[i] + 10 - (a[i] % 10); } cout << sum << endl; }
#include <bits/stdc++.h> typedef long long LL; using namespace std; int main() { int sum = 0; vector<int> a; for (int i = 0; i < 5; i++) { int t; cin >> t; if (t % 10 == 0) sum += t; else a.push_back(t); } if (a.size() == 0) { cout << sum << endl; return 0; } int x; int y = 10; for (int i = 0; i < a.size(); i++) { int s = a[i] % 10; if (s < y) x = i, y = s; } sum += a[x]; for (int i = 0; i < a.size(); i++) { if (i == x) continue; sum += a[i] + 10 - (a[i] % 10); } cout << sum << endl; }
insert
14
14
14
19
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; bool compare(int a, int b) { if ((a % 10) > (b % 10)) return true; return false; } int main() { vector<int> v; int ans = 0, a; for (int i = 0; i < 5; i++) { cin >> a; if (a % 10 != 0) v.push_back(a); else ans += a; } sort(v.begin(), v.end(), compare); for (int i = 0; i < v.size() - 1; i++) { int b = v[i] / 10; b++; ans += b * 10; } ans += v[v.size() - 1]; cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; bool compare(int a, int b) { if ((a % 10) > (b % 10)) return true; return false; } int main() { vector<int> v; int ans = 0, a; for (int i = 0; i < 5; i++) { cin >> a; if (a % 10 != 0) v.push_back(a); else ans += a; } if (v.size() == 0) { cout << ans; return 0; } sort(v.begin(), v.end(), compare); for (int i = 0; i < v.size() - 1; i++) { int b = v[i] / 10; b++; ans += b * 10; } ans += v[v.size() - 1]; cout << ans << endl; }
insert
17
17
17
21
0
p03076
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <unordered_map> #include <utility> #include <vector> using namespace std; /**** Type Define ****/ typedef long long ll; typedef pair<ll, ll> P; typedef pair<ll, P> Q; /**** Const List ****/ const ll INF = 1LL << 60; const ll mod = 1000000007; const ll dx[4] = {1, 0, -1, 0}; const ll dy[4] = {0, -1, 0, 1}; /**** General Functions ****/ ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); } ll extgcd(ll a, ll b, ll &x, ll &y) { if (b == 0) { x = 1, y = 0; return a; } ll q = a / b, g = extgcd(b, a - q * b, x, y); ll z = x - q * y; x = y; y = z; return g; } ll invmod(ll a, ll m) { // a^-1 mod m ll x, y; extgcd(a, m, x, y); x %= m; if (x < 0) x += m; return x; } ll nCk(ll n, ll k, ll mod) { ll ans = 1; for (ll i = n, j = 1; j <= k; i--, j++) ans = (((ans * i) % mod) * invmod(j, mod)) % mod; return ans; } ll lmin(ll a, ll b) { return a > b ? b : a; }; ll lmax(ll a, ll b) { return a > b ? a : b; }; ll lsum(ll a, ll b) { return a + b; }; /**** Zip ****/ template <typename T> class Zip { vector<T> d; bool flag; public: Zip() { flag = false; } void add(T x) { d.push_back(x); flag = true; } ll getNum(T x) { // T need to have operator < !! if (flag) { sort(d.begin(), d.end()); d.erase(unique(d.begin(), d.end()), d.end()); flag = false; } return lower_bound(d.begin(), d.end(), x) - d.begin(); } ll size() { if (flag) { sort(d.begin(), d.end()); d.erase(unique(d.begin(), d.end()), d.end()); flag = false; } return (ll)d.size(); } }; /**** Union Find ****/ class UnionFind { vector<ll> par, rank; // par > 0: number, par < 0: -par public: void init(ll n) { par.resize(n, 1); rank.resize(n, 0); } ll getSize(ll x) { return par[find(x)]; } ll find(ll x) { if (par[x] > 0) return x; return -(par[x] = -find(-par[x])); } void merge(ll x, ll y) { x = find(x); y = find(y); if (x == y) return; if (rank[x] < rank[y]) { par[y] += par[x]; par[x] = -y; } else { par[x] += par[y]; par[y] = -x; if (rank[x] == rank[y]) rank[x]++; } } bool isSame(ll x, ll y) { return find(x) == find(y); } }; /**** Segment Tree ****/ template <typename T> class SegmentTree { ll n; vector<T> node; function<T(T, T)> fun, fun2; bool customChange; T outValue, initValue; public: void init(ll num, function<T(T, T)> resultFunction, T init, T out, function<T(T, T)> changeFunction = NULL) { // changeFunction: (input, beforevalue) => newvalue fun = resultFunction; fun2 = changeFunction; customChange = changeFunction != NULL; n = 1; while (n < num) n *= 2; node.resize(2 * n - 1, init); outValue = out; initValue = init; } void valueChange(ll num, T value) { num += n - 1; if (customChange) node[num] = fun2(value, node[num]); else node[num] = value; while (num > 0) num = (num - 1) / 2, node[num] = fun(node[num * 2 + 1], node[num * 2 + 2]); } T rangeQuery(ll a, ll b, ll l = 0, ll r = -1, ll k = 0) { // [a, b) if (r == -1) r = n; if (a <= l && r <= b) return node[k]; if (b <= l || r <= a) return outValue; ll mid = (l + r) / 2; return fun(rangeQuery(a, b, l, mid, 2 * k + 1), rangeQuery(a, b, mid, r, 2 * k + 2)); } }; /**** LIS ****/ ll lis(ll *a, ll n, ll *dp) { fill(dp, dp + n, INF); // INFを代入 for (ll i = 0; i < n; i++) *lower_bound(dp, dp + n, a[i]) = a[i]; return (ll)(lower_bound(dp, dp + n, INF) - dp); } /**** main function ****/ ll minaus, ans = 0, sum = 0; ll a[5]; priority_queue<P, vector<P>, greater<P>> p; string s; int main() { for (int i = 0; i < 5; i++) { cin >> a[i]; if (a[i] % 10 != 0) { p.push(P(a[i] % 10, i)); a[i] -= a[i] % 10; a[i] += 10; } sum += a[i]; } minaus = p.top().first; ans = p.top().second; cout << sum - (10 - minaus) << endl; }
#include <algorithm> #include <bits/stdc++.h> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <unordered_map> #include <utility> #include <vector> using namespace std; /**** Type Define ****/ typedef long long ll; typedef pair<ll, ll> P; typedef pair<ll, P> Q; /**** Const List ****/ const ll INF = 1LL << 60; const ll mod = 1000000007; const ll dx[4] = {1, 0, -1, 0}; const ll dy[4] = {0, -1, 0, 1}; /**** General Functions ****/ ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); } ll extgcd(ll a, ll b, ll &x, ll &y) { if (b == 0) { x = 1, y = 0; return a; } ll q = a / b, g = extgcd(b, a - q * b, x, y); ll z = x - q * y; x = y; y = z; return g; } ll invmod(ll a, ll m) { // a^-1 mod m ll x, y; extgcd(a, m, x, y); x %= m; if (x < 0) x += m; return x; } ll nCk(ll n, ll k, ll mod) { ll ans = 1; for (ll i = n, j = 1; j <= k; i--, j++) ans = (((ans * i) % mod) * invmod(j, mod)) % mod; return ans; } ll lmin(ll a, ll b) { return a > b ? b : a; }; ll lmax(ll a, ll b) { return a > b ? a : b; }; ll lsum(ll a, ll b) { return a + b; }; /**** Zip ****/ template <typename T> class Zip { vector<T> d; bool flag; public: Zip() { flag = false; } void add(T x) { d.push_back(x); flag = true; } ll getNum(T x) { // T need to have operator < !! if (flag) { sort(d.begin(), d.end()); d.erase(unique(d.begin(), d.end()), d.end()); flag = false; } return lower_bound(d.begin(), d.end(), x) - d.begin(); } ll size() { if (flag) { sort(d.begin(), d.end()); d.erase(unique(d.begin(), d.end()), d.end()); flag = false; } return (ll)d.size(); } }; /**** Union Find ****/ class UnionFind { vector<ll> par, rank; // par > 0: number, par < 0: -par public: void init(ll n) { par.resize(n, 1); rank.resize(n, 0); } ll getSize(ll x) { return par[find(x)]; } ll find(ll x) { if (par[x] > 0) return x; return -(par[x] = -find(-par[x])); } void merge(ll x, ll y) { x = find(x); y = find(y); if (x == y) return; if (rank[x] < rank[y]) { par[y] += par[x]; par[x] = -y; } else { par[x] += par[y]; par[y] = -x; if (rank[x] == rank[y]) rank[x]++; } } bool isSame(ll x, ll y) { return find(x) == find(y); } }; /**** Segment Tree ****/ template <typename T> class SegmentTree { ll n; vector<T> node; function<T(T, T)> fun, fun2; bool customChange; T outValue, initValue; public: void init(ll num, function<T(T, T)> resultFunction, T init, T out, function<T(T, T)> changeFunction = NULL) { // changeFunction: (input, beforevalue) => newvalue fun = resultFunction; fun2 = changeFunction; customChange = changeFunction != NULL; n = 1; while (n < num) n *= 2; node.resize(2 * n - 1, init); outValue = out; initValue = init; } void valueChange(ll num, T value) { num += n - 1; if (customChange) node[num] = fun2(value, node[num]); else node[num] = value; while (num > 0) num = (num - 1) / 2, node[num] = fun(node[num * 2 + 1], node[num * 2 + 2]); } T rangeQuery(ll a, ll b, ll l = 0, ll r = -1, ll k = 0) { // [a, b) if (r == -1) r = n; if (a <= l && r <= b) return node[k]; if (b <= l || r <= a) return outValue; ll mid = (l + r) / 2; return fun(rangeQuery(a, b, l, mid, 2 * k + 1), rangeQuery(a, b, mid, r, 2 * k + 2)); } }; /**** LIS ****/ ll lis(ll *a, ll n, ll *dp) { fill(dp, dp + n, INF); // INFを代入 for (ll i = 0; i < n; i++) *lower_bound(dp, dp + n, a[i]) = a[i]; return (ll)(lower_bound(dp, dp + n, INF) - dp); } /**** main function ****/ ll minaus, ans = 0, sum = 0; ll a[5]; priority_queue<P, vector<P>, greater<P>> p; string s; int main() { for (int i = 0; i < 5; i++) { cin >> a[i]; if (a[i] % 10 != 0) { p.push(P(a[i] % 10, i)); a[i] -= a[i] % 10; a[i] += 10; } sum += a[i]; } if (!p.empty()) { minaus = p.top().first; ans = p.top().second; cout << sum - (10 - minaus) << endl; } else { cout << sum << endl; } }
replace
203
207
203
211
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); int main() { IOS; int a, b, c, d, e; cin >> a >> b >> c >> d >> e; vector<int> nums; nums.push_back(a); nums.push_back(b); nums.push_back(c); nums.push_back(d); nums.push_back(e); vector<int> vec; for (int i = 0; i < 5; i++) { if (10 - (nums[i] % 10) != 10) { vec.push_back(10 - (nums[i] % 10)); } } sort(vec.begin(), vec.end()); int count = 0; for (int i = 0; i < vec.size() - 1; i++) { count += vec[i]; } int ans = a + b + c + d + e; cout << ans + count << endl; }
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); int main() { IOS; int a, b, c, d, e; cin >> a >> b >> c >> d >> e; vector<int> nums; nums.push_back(a); nums.push_back(b); nums.push_back(c); nums.push_back(d); nums.push_back(e); vector<int> vec = {0}; for (int i = 0; i < 5; i++) { if (10 - (nums[i] % 10) != 10) { vec.push_back(10 - (nums[i] % 10)); } } sort(vec.begin(), vec.end()); int count = 0; for (int i = 0; i < vec.size() - 1; i++) { count += vec[i]; } int ans = a + b + c + d + e; cout << ans + count << endl; }
replace
16
17
16
17
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> P; #define rep(i, n) for (ll i = 0; i < n; i++) #define FOR(i, a, b) for (ll i = a; i < b; i++) #define is(a, b) a == b #define len(v) ll(v.size()) const ll mod = 1e9 + 7; // vector書き出し template <class T> void cout_vec(const vector<T> &vec1) { rep(i, len(vec1)) { cout << vec1[i] << ' '; } cout << '\n'; } int main() { cin.tie(0); ios::sync_with_stdio(false); vector<int> a(5); vector<int> b; int ans = 0; rep(i, 5) { cin >> a[i]; ans += a[i]; if (a[i] % 10 != 0) { b.push_back(10 - a[i] % 10); ans += 10 - a[i] % 10; } } cout << ans - *max_element(begin(b), end(b)) << endl; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> P; #define rep(i, n) for (ll i = 0; i < n; i++) #define FOR(i, a, b) for (ll i = a; i < b; i++) #define is(a, b) a == b #define len(v) ll(v.size()) const ll mod = 1e9 + 7; // vector書き出し template <class T> void cout_vec(const vector<T> &vec1) { rep(i, len(vec1)) { cout << vec1[i] << ' '; } cout << '\n'; } int main() { cin.tie(0); ios::sync_with_stdio(false); vector<int> a(5); vector<int> b; int ans = 0; rep(i, 5) { cin >> a[i]; ans += a[i]; if (a[i] % 10 != 0) { b.push_back(10 - a[i] % 10); ans += 10 - a[i] % 10; } } if (!b.empty()) { cout << ans - *max_element(begin(b), end(b)) << endl; } else { cout << ans << endl; } }
replace
32
33
32
37
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; const ll INF64 = 1LL << 60; const int INF32 = 1 << 29; const int MOD = 1000000007; // Library // bool comp(const int lh, const int rh) { int tmp_l = lh % 10; int tmp_r = rh % 10; return (lh % 10) > (rh % 10); } int main() { #ifdef MYLOCAL ifstream in("input.txt"); cin.rdbuf(in.rdbuf()); #endif int ans = 0; vector<int> vec; for (int i = 0; i < 5; ++i) { int tmp; cin >> tmp; if (tmp % 10 == 0) { ans += tmp; } else { vec.push_back(tmp); } } sort(vec.begin(), vec.end(), comp); for (int i = 0; i < vec.size() - 1; ++i) { int tmp = vec[i] / 10; ans += (tmp + 1) * 10; } ans += vec[vec.size() - 1]; cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; const ll INF64 = 1LL << 60; const int INF32 = 1 << 29; const int MOD = 1000000007; // Library // bool comp(const int lh, const int rh) { int tmp_l = lh % 10; int tmp_r = rh % 10; return (lh % 10) > (rh % 10); } int main() { #ifdef MYLOCAL ifstream in("input.txt"); cin.rdbuf(in.rdbuf()); #endif int ans = 0; vector<int> vec; for (int i = 0; i < 5; ++i) { int tmp; cin >> tmp; if (tmp % 10 == 0) { ans += tmp; } else { vec.push_back(tmp); } } sort(vec.begin(), vec.end(), comp); if (vec.empty()) { cout << ans << endl; return 0; } for (int i = 0; i < vec.size() - 1; ++i) { int tmp = vec[i] / 10; ans += (tmp + 1) * 10; } ans += vec[vec.size() - 1]; cout << ans << endl; return 0; }
insert
37
37
37
42
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int ans = 0; vector<int> b; for (int i = 0; i < 5; i++) { int A; cin >> A; if (A % 10 != 0) b.push_back(A % 10); int temp = (A + 9) / 10; ans += temp * 10; } int sub = *min_element(b.begin(), b.end()); ans -= (10 - sub); cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int ans = 0; vector<int> b; for (int i = 0; i < 5; i++) { int A; cin >> A; if (A % 10 != 0) b.push_back(A % 10); int temp = (A + 9) / 10; ans += temp * 10; } if (b.size() >= 1) { int sub = *min_element(b.begin(), b.end()); ans -= (10 - sub); } cout << ans << endl; }
replace
14
16
14
18
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { vector<ll> a; ll sum = 0; for (int i = 0; i < 5; i++) { int x; cin >> x; sum += x; if (x % 10 != 0) a.push_back(10 - x % 10); } sort(a.begin(), a.end()); for (int i = 0; i < a.size() - 1; i++) sum += a.at(i); cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { vector<ll> a; ll sum = 0; for (int i = 0; i < 5; i++) { int x; cin >> x; sum += x; if (x % 10 != 0) a.push_back(10 - x % 10); } if (!a.empty()) { sort(a.begin(), a.end()); for (int i = 0; i < a.size() - 1; i++) sum += a.at(i); } cout << sum << endl; }
replace
14
17
14
20
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { vector<int> list(5); int t, j = 0, mw; for (int i = 0; i < 5; i++) { cin >> list.at(i); t = 10 - (list.at(i) % 10); if (j < t && t != 10) { j = t; mw = i; } } int ans = 0, x; for (int i = 0; i < 5; i++) { if (i != mw) { x = list.at(i); if (x % 10 != 0) { x = (x + 10) / 10 * 10; } ans += x; } } ans += list.at(mw); cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { vector<int> list(5); int t, j = 0, mw = 0; for (int i = 0; i < 5; i++) { cin >> list.at(i); t = 10 - (list.at(i) % 10); if (j < t && t != 10) { j = t; mw = i; } } int ans = 0, x; for (int i = 0; i < 5; i++) { if (i != mw) { x = list.at(i); if (x % 10 != 0) { x = (x + 10) / 10 * 10; } ans += x; } } ans += list.at(mw); cout << ans << endl; }
replace
4
5
4
5
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { vector<pair<int, int>> T(5); int k, ans = 0; for (int i = 0; i < 5; i++) { cin >> k; T.at(i) = make_pair(k % 10, k); } sort(T.begin(), T.end()); for (int i = 0; T.at(i).first == 0; i++) { ans += T.at(i).second; } for (int i = 4; i >= 0 && T.at(i).first != 0; i--) { ans += (T.at(i).second / 10 + 1) * 10; } k = 1; for (int i = 0; i < 5 && k; i++) { if (T.at(i).first != 0) { ans = ans - (T.at(i).second / 10 + 1) * 10 + T.at(i).second; k = 0; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { vector<pair<int, int>> T(5); int k, ans = 0; for (int i = 0; i < 5; i++) { cin >> k; T.at(i) = make_pair(k % 10, k); } sort(T.begin(), T.end()); for (int i = 0; i < 5 && T.at(i).first == 0; i++) { ans += T.at(i).second; } for (int i = 4; i >= 0 && T.at(i).first != 0; i--) { ans += (T.at(i).second / 10 + 1) * 10; } k = 1; for (int i = 0; i < 5 && k; i++) { if (T.at(i).first != 0) { ans = ans - (T.at(i).second / 10 + 1) * 10 + T.at(i).second; k = 0; } } cout << ans << endl; }
replace
11
12
11
12
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG int64_t MOD = 1000000007; int main() { int ans = 0; vector<int> S; for (int i = 0; i < 5; i++) { int a; cin >> a; if (a % 10 != 0) { S.push_back(a % 10); a += 10 - (a % 10); } ans += a; a %= 10; } sort(S.begin(), S.end()); cout << ans - 10 + S.at(0); }
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG int64_t MOD = 1000000007; int main() { int ans = 0; vector<int> S; for (int i = 0; i < 5; i++) { int a; cin >> a; if (a % 10 != 0) { S.push_back(a % 10); a += 10 - (a % 10); } ans += a; a %= 10; } if (S.size() != 0) { sort(S.begin(), S.end()); cout << ans - 10 + S.at(0); } else cout << ans; }
replace
18
20
18
23
0
p03076
C++
Runtime Error
#include <algorithm> #include <iostream> #include <numeric> #include <vector> int main() { std::vector<int> n(5), m; int k; for (int i = 0; i < 5; i++) { std::cin >> n[i]; if (n[i] % 10 != 0) { m.push_back(10 - n[i] % 10); } } std::cout << std::accumulate(n.begin(), n.end(), 0) + std::accumulate(m.begin(), m.end(), 0) - *(std::max_element(m.begin(), m.end())) << std::endl; return 0; }
#include <algorithm> #include <iostream> #include <numeric> #include <vector> int main() { std::vector<int> n(5), m; int k; for (int i = 0; i < 5; i++) { std::cin >> n[i]; if (n[i] % 10 != 0) { m.push_back(10 - n[i] % 10); } } if (m.size() == 0) { m.push_back(0); } std::cout << std::accumulate(n.begin(), n.end(), 0) + std::accumulate(m.begin(), m.end(), 0) - *(std::max_element(m.begin(), m.end())) << std::endl; return 0; }
insert
15
15
15
19
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; using ll = long long; int main() { vector<int> vec(5); int a = 9; int idx; rep(i, 5) { cin >> vec[i]; int tmp = vec[i] % 10; if (tmp == 0) tmp = 10; if (tmp <= a) { idx = i; a = tmp; } } int ans = 0; rep(i, 5) { if (i == idx) continue; ans += (vec[i] + 10 - 1) / 10 * 10; } ans += vec[idx]; cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; using ll = long long; int main() { vector<int> vec(5); int a = 9; int idx = 0; rep(i, 5) { cin >> vec[i]; int tmp = vec[i] % 10; if (tmp == 0) tmp = 10; if (tmp <= a) { idx = i; a = tmp; } } int ans = 0; rep(i, 5) { if (i == idx) continue; ans += (vec[i] + 10 - 1) / 10 * 10; } ans += vec[idx]; cout << ans << endl; return 0; }
replace
8
9
8
9
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define repe(i, n) for (int i = 0; i <= n; ++i) #define repr(i, n) for (int i = n - 1; i > 0; --i) #define all(x) (x).begin(), (x).end() #define pb(x) push_back(x) using namespace std; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } template <class T> using V = vector<T>; typedef long long ll; const int INF = 1e9; const ll MOD = 1000000007; const ll MAX = 510000; int gcd(int a, int b) { return b ? gcd(b, a % b) : a; } int lcm(int a, int b) { return a * b / gcd(a, b); } long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD; finv[i] = finv[i - 1] * inv[i] % MOD; } } // 二項係数計算 long long COM(int n, int k) { if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; } int main() { int a, b, c, d, e; vector<int> V(5); vector<int> A; int diff = 0; int total = 0; rep(i, 5) { cin >> V[i]; if (V[i] % 10 != 0) { A.pb(10 - V[i] % 10); } } sort(all(A)); rep(i, 5) { total += V[i]; } rep(j, A.size() - 1) { diff += A[j]; } cout << total + diff << "\n"; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define repe(i, n) for (int i = 0; i <= n; ++i) #define repr(i, n) for (int i = n - 1; i > 0; --i) #define all(x) (x).begin(), (x).end() #define pb(x) push_back(x) using namespace std; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } template <class T> using V = vector<T>; typedef long long ll; const int INF = 1e9; const ll MOD = 1000000007; const ll MAX = 510000; int gcd(int a, int b) { return b ? gcd(b, a % b) : a; } int lcm(int a, int b) { return a * b / gcd(a, b); } long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD; finv[i] = finv[i - 1] * inv[i] % MOD; } } // 二項係数計算 long long COM(int n, int k) { if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; } int main() { int a, b, c, d, e; vector<int> V(5); vector<int> A; int diff = 0; int total = 0; rep(i, 5) { cin >> V[i]; if (V[i] % 10 != 0) { A.pb(10 - V[i] % 10); } } sort(all(A)); rep(i, 5) { total += V[i]; } if (A.size() > 0) { rep(j, A.size() - 1) { diff += A[j]; } } cout << total + diff << "\n"; }
replace
63
64
63
66
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; #define rep(i, n) \ ; \ for (ll i = 0; i < (ll)n; i++) int main() { vector<int> p; vector<P> q; rep(i, 5) { int c; cin >> c; if (c % 10 == 0) p.push_back(c); else q.push_back({c % 10, c}); } sort(q.rbegin(), q.rend()); int ans = 0; rep(i, p.size()) ans += p[i]; rep(i, q.size() - 1) ans += 10 * ((q[i].second + 9) / 10); ans += q[q.size() - 1].second; cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; #define rep(i, n) \ ; \ for (ll i = 0; i < (ll)n; i++) int main() { vector<int> p; vector<P> q; rep(i, 5) { int c; cin >> c; if (c % 10 == 0) p.push_back(c); else q.push_back({c % 10, c}); } sort(q.rbegin(), q.rend()); int ans = 0; rep(i, p.size()) ans += p[i]; rep(i, q.size() - 1) ans += 10 * ((q[i].second + 9) / 10); if (q.size() != 0) ans += q[q.size() - 1].second; cout << ans << endl; }
replace
24
25
24
27
0
p03076
C++
Runtime Error
// // main.cpp // ABC123 // // Created by hiroaki on 2019/04/16. // Copyright © 2019年 hiroaki. All rights reserved. // #include <algorithm> #include <iostream> #include <vector> using namespace std; vector<int> v; int set(int food) { v.push_back(10 - food % 10); int r = food + (10 - food % 10); return r; } int main() { // int a,b,c,d,e,k; // cin >>a>>b>>c>>d>>e>>k; // int flag = 0; // if (abs(a-b)>k) { // flag = 1; // } // if (abs(a-c)>k) { // flag = 1; // } // if (abs(a-d)>k) { // flag = 1; // } // if (abs(a-e)>k) { // flag = 1; // } // if (abs(b-c)>k) { // flag = 1; // } // if (abs(b-d)>k) { // flag = 1; // } // if (abs(b-e)>k) { // flag = 1; // } // if (abs(c-d)>k) { // flag = 1; // } // if (abs(c-e)>k) { // flag = 1; // } // if (abs(d-e)>k) { // flag = 1; // } // if(flag==1){ // cout<<":("<<endl; // }else{ // cout<<"Yay!"<<endl; // } int a, b, c, d, e; cin >> a >> b >> c >> d >> e; // int set(int food){ // v.push_back(10-food%10); // food=food+(10-food%10); // return food; // } if (a % 10 != 0) { a = set(a); } if (b % 10 != 0) { b = set(b); } if (c % 10 != 0) { c = set(c); } if (d % 10 != 0) { d = set(d); } if (e % 10 != 0) { e = set(e); } int maxv = *max_element(v.begin(), v.end()); cout << a + b + c + d + e - maxv << endl; return 0; }
// // main.cpp // ABC123 // // Created by hiroaki on 2019/04/16. // Copyright © 2019年 hiroaki. All rights reserved. // #include <algorithm> #include <iostream> #include <vector> using namespace std; vector<int> v; int set(int food) { v.push_back(10 - food % 10); int r = food + (10 - food % 10); return r; } int main() { // int a,b,c,d,e,k; // cin >>a>>b>>c>>d>>e>>k; // int flag = 0; // if (abs(a-b)>k) { // flag = 1; // } // if (abs(a-c)>k) { // flag = 1; // } // if (abs(a-d)>k) { // flag = 1; // } // if (abs(a-e)>k) { // flag = 1; // } // if (abs(b-c)>k) { // flag = 1; // } // if (abs(b-d)>k) { // flag = 1; // } // if (abs(b-e)>k) { // flag = 1; // } // if (abs(c-d)>k) { // flag = 1; // } // if (abs(c-e)>k) { // flag = 1; // } // if (abs(d-e)>k) { // flag = 1; // } // if(flag==1){ // cout<<":("<<endl; // }else{ // cout<<"Yay!"<<endl; // } int a, b, c, d, e; cin >> a >> b >> c >> d >> e; // int set(int food){ // v.push_back(10-food%10); // food=food+(10-food%10); // return food; // } if (a % 10 != 0) { a = set(a); } if (b % 10 != 0) { b = set(b); } if (c % 10 != 0) { c = set(c); } if (d % 10 != 0) { d = set(d); } if (e % 10 != 0) { e = set(e); } int maxv = 0; if (v.size() > 0) { maxv = *max_element(v.begin(), v.end()); } cout << a + b + c + d + e - maxv << endl; return 0; }
replace
79
80
79
83
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ITR(x, c) for(__typeof(c.begin() x=c.begin();x!=c.end();x++) #define RITR(x, c) for(__typeof(c.rbegin() x=c.rbegin();x!=c.rend();x++) #define setp(n) fixed << setprecision(n) #define lf double #define ll long long #define vll vector<ll> #define vi vector<int> #define pll pair<ll, ll> #define pi pair<int, int> #define all(a) (a.begin()), (a.end()) #define rall(a) (a.rbegin()), (a.rend()) #define fi first #define se second #define pb push_back #define mp make_pair #define ins insert using namespace std; int main(void) { cin.tie(0); ios::sync_with_stdio(false); ll a[5]; vll b; ll sum = 0; rep(i, 5) { cin >> a[i]; sum += a[i]; if (a[i] % 10 != 0) { sum += 10 - a[i] % 10; b.pb(10 - a[i] % 10); } } sort(rall(b)); sum -= b[0]; cout << sum << "\n"; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ITR(x, c) for(__typeof(c.begin() x=c.begin();x!=c.end();x++) #define RITR(x, c) for(__typeof(c.rbegin() x=c.rbegin();x!=c.rend();x++) #define setp(n) fixed << setprecision(n) #define lf double #define ll long long #define vll vector<ll> #define vi vector<int> #define pll pair<ll, ll> #define pi pair<int, int> #define all(a) (a.begin()), (a.end()) #define rall(a) (a.rbegin()), (a.rend()) #define fi first #define se second #define pb push_back #define mp make_pair #define ins insert using namespace std; int main(void) { cin.tie(0); ios::sync_with_stdio(false); ll a[5]; vll b; ll sum = 0; rep(i, 5) { cin >> a[i]; sum += a[i]; if (a[i] % 10 != 0) { sum += 10 - a[i] % 10; b.pb(10 - a[i] % 10); } } if (b.size()) { sort(rall(b)); sum -= b[0]; } cout << sum << "\n"; return 0; }
replace
38
40
38
42
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> #define SYNC ios::sync_with_stdio(0); #define F first #define S second #define endl '\n' using namespace std; using ll = long long int; using ii = pair<int, int>; using vii = vector<ii>; using vi = vector<int>; using graph = vector<vi>; const int INF = 0x3f3f3f3f; const int MAXN = 58; const ll mod = 1000000007; int main() { SYNC int n[5], k, ans = 0; int idx, maxi = 0; for (int i = 0; i < 5; ++i) { cin >> n[i]; // cout << "dif: " << abs(n[i]%10 - 10)%10 << endl; if (maxi < abs(n[i] % 10 - 10) % 10) { maxi = abs(n[i] % 10 - 10) % 10; idx = i; } ans += n[i] + abs(n[i] % 10 - 10) % 10; // cout << "ans: " << ans << endl; } // cout << idx << endl; ans -= abs(n[idx] % 10 - 10) % 10; cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define SYNC ios::sync_with_stdio(0); #define F first #define S second #define endl '\n' using namespace std; using ll = long long int; using ii = pair<int, int>; using vii = vector<ii>; using vi = vector<int>; using graph = vector<vi>; const int INF = 0x3f3f3f3f; const int MAXN = 58; const ll mod = 1000000007; int main() { SYNC int n[5], ans = 0; int idx = 0, maxi = 0; for (int i = 0; i < 5; ++i) { cin >> n[i]; // cout << "dif: " << abs(n[i]%10 - 10)%10 << endl; if (maxi < abs(n[i] % 10 - 10) % 10) { maxi = abs(n[i] % 10 - 10) % 10; idx = i; } ans += n[i] + abs(n[i] % 10 - 10) % 10; // cout << "ans: " << ans << endl; } // cout << idx << endl; ans -= abs(n[idx] % 10 - 10) % 10; cout << ans << endl; return 0; }
replace
19
21
19
21
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { vector<int> tim(5); int minwk = 125; int min_index; for (int i = 0; i < 5; i++) { cin >> tim.at(i); int rem = tim.at(i) % 10; if (rem < minwk && rem != 0) { min_index = i; minwk = rem; } } int sum = 0; for (int i = 0; i < 5; i++) { if (i != min_index) sum += ((tim.at(i) + 9) / 10) * 10; } cout << sum + tim.at(min_index) << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { vector<int> tim(5); int minwk = 125; int min_index = 0; for (int i = 0; i < 5; i++) { cin >> tim.at(i); int rem = tim.at(i) % 10; if (rem < minwk && rem != 0) { min_index = i; minwk = rem; } } int sum = 0; for (int i = 0; i < 5; i++) { if (i != min_index) sum += ((tim.at(i) + 9) / 10) * 10; } cout << sum + tim.at(min_index) << endl; return 0; }
replace
7
8
7
8
0
p03076
C++
Runtime Error
#include <iostream> using namespace std; int main() { int a[5]; int o[5]; int sub[5]; for (int i = 0; i < 5; ++i) { cin >> a[i]; o[i] = 0; int n = (a[i] / 10 + 1); sub[i] = (a[i] % 10 == 0) ? 0 : n * 10 - a[i]; // cout << i << " " << sub[i] << endl; } int time = 0; for (int i = 0; i < 5; ++i) { int idx = 0; int max = 10; for (int j = 0; j < 5; ++j) { // cout << sub[j] << endl; if (max > sub[j] && o[j] == 0) { max = sub[j]; idx = j; } } o[idx] = 1; time += (i == 4) ? a[idx] : (a[idx] % 10 == 0) ? a[idx] : (a[idx] / 10 + 1) * 10; // cout << i << " " << idx << " " <<time << endl; } return time; }
#include <iostream> using namespace std; int main() { int a[5]; int o[5]; int sub[5]; for (int i = 0; i < 5; ++i) { cin >> a[i]; o[i] = 0; int n = (a[i] / 10 + 1); sub[i] = (a[i] % 10 == 0) ? 0 : n * 10 - a[i]; // cout << i << " " << sub[i] << endl; } int time = 0; for (int i = 0; i < 5; ++i) { int idx = 0; int max = 10; for (int j = 0; j < 5; ++j) { // cout << sub[j] << endl; if (max > sub[j] && o[j] == 0) { max = sub[j]; idx = j; } } o[idx] = 1; time += (i == 4) ? a[idx] : (a[idx] % 10 == 0) ? a[idx] : (a[idx] / 10 + 1) * 10; // cout << i << " " << idx << " " <<time << endl; } cout << time << endl; return 0; }
replace
34
36
34
36
215
p03076
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { vector<int> v; int p, ans; rep(i, 5) { cin >> p; if (p % 10 == 0) ans += p; else { ans += p / 10 * 10; v.push_back(p % 10); } } sort(v.begin(), v.end()); if (v.size() <= 1) ans += v.at(0) + (v.size() - 1) * 10; cout << ans; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { vector<int> v; int p, ans; rep(i, 5) { cin >> p; if (p % 10 == 0) ans += p; else { ans += p / 10 * 10; v.push_back(p % 10); } } sort(v.begin(), v.end()); if (v.size() >= 1) ans += v.at(0) + (v.size() - 1) * 10; cout << ans; }
replace
17
18
17
18
0
p03076
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)n; i++) using ll = long long; template <class T> using vt = std::vector<T>; using vvi = std::vector<vt<int>>; int main() { vt<int> m(5); int num, k = 9; rep(i, 5) { std::cin >> m[i]; if (k > m[i] % 10 && m[i] % 10 != 0) { k = m[i] % 10; num = i; } } int ans = 0; rep(i, 5) { if (i == num) continue; else if (m[i] % 10 != 0) m[i] += 10 - (m[i] % 10); ans += m[i]; } std::cout << ans + m[num] << '\n'; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)n; i++) using ll = long long; template <class T> using vt = std::vector<T>; using vvi = std::vector<vt<int>>; int main() { vt<int> m(5); int num = 0, k = 9; rep(i, 5) { std::cin >> m[i]; if (k > m[i] % 10 && m[i] % 10 != 0) { k = m[i] % 10; num = i; } } int ans = 0; rep(i, 5) { if (i == num) continue; else if (m[i] % 10 != 0) m[i] += 10 - (m[i] % 10); ans += m[i]; } std::cout << ans + m[num] << '\n'; return 0; }
replace
8
9
8
9
0
p03076
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <math.h> #include <stack> #include <string> #include <vector> // #include<stdlib.h> using namespace std; int main() { short i[5]; int a = 0, m = 0; for (int k = 0; k < 5; k++) { cin >> i[k]; if (10 - (i[k] % 10) > m && i[k] % 10 != 0) { m = 10 - (i[k] % 10); } if (i[k] % 10 != 0) { i[k] += 10 - (i[k] % 10); } a += i[k]; } a -= m; cout << a; while (true) ; return 0; }
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <math.h> #include <stack> #include <string> #include <vector> // #include<stdlib.h> using namespace std; int main() { short i[5]; int a = 0, m = 0; for (int k = 0; k < 5; k++) { cin >> i[k]; if (10 - (i[k] % 10) > m && i[k] % 10 != 0) { m = 10 - (i[k] % 10); } if (i[k] % 10 != 0) { i[k] += 10 - (i[k] % 10); } a += i[k]; } a -= m; cout << a; return 0; }
delete
26
28
26
26
TLE
p03077
Python
Runtime Error
import math n = int(input()) a = int(input()) b = int(input()) c = int(input()) d = int(input()) e = int(input()) cities = [a, b, c, d, e] min_val = 1e6 for i, x in enumerate(cities): if x < min_val: min_val = x idx = i ans = 0 if idx == 0 else idx ans += math.ceil(n / min_val) ans = ans + 4 - idx print(ans)
import math n = int(input()) a = int(input()) b = int(input()) c = int(input()) d = int(input()) e = int(input()) cities = [a, b, c, d, e] min_val = 1e18 idx = 0 for i, x in enumerate(cities): if x < min_val: min_val = x idx = i ans = 0 if idx == 0 else idx ans += math.ceil(n / min_val) ans = ans + 4 - idx print(ans)
replace
10
11
10
12
0
p03077
Python
Runtime Error
import math n = int(input()) a = int(input()) b = int(input()) c = int(input()) d = int(input()) e = int(input()) cities = [a, b, c, d, e] min_val = 10 for i, x in enumerate(cities): if x < min_val: min_val = x idx = i ans = 0 if idx == 0 else idx ans += math.ceil(n / min_val) ans = ans + 4 - idx print(ans)
import math n = int(input()) a = int(input()) b = int(input()) c = int(input()) d = int(input()) e = int(input()) cities = [a, b, c, d, e] min_val = 1e18 for i, x in enumerate(cities): if x < min_val: min_val = x idx = i ans = 0 if idx == 0 else idx ans += math.ceil(n / min_val) ans = ans + 4 - idx print(ans)
replace
10
11
10
11
0
p03077
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = a; i <= b; i++) #define per(i, a, b) for (int i = a; i >= b; i--) #define clr(a, x) memset(a, x, sizeof(a)) #define SZ(x) ((int)(x).size()) #define lson rt << 1 #define rson rt << 1 | 1 #define pb push_back #define fi first #define se second #define what_is(x) cerr << #x << " " << x << endl; typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; template <typename T> inline void _read(T &x) { cin >> x; } void R() {} template <typename T, typename... U> void R(T &head, U &...tail) { _read(head); R(tail...); } template <typename T> inline void _write(const T &x) { cout << x << ' '; } void W() { cout << endl; } template <typename T, typename... U> void W(const T &head, const U &...tail) { _write(head); W(tail...); } void go(); int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); go(); return 0; } /****************ackun*********************/ void go() { int n; R(n); ll mi = 1e16; rep(i, 1, 5) { ll x; R(x); mi = min(mi, x); } ll ans = 5; n -= mi; if (n > 0) { ans += n / mi; if ((n % mi) != 0) { ans++; } } W(ans); }
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = a; i <= b; i++) #define per(i, a, b) for (int i = a; i >= b; i--) #define clr(a, x) memset(a, x, sizeof(a)) #define SZ(x) ((int)(x).size()) #define lson rt << 1 #define rson rt << 1 | 1 #define pb push_back #define fi first #define se second #define what_is(x) cerr << #x << " " << x << endl; typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; template <typename T> inline void _read(T &x) { cin >> x; } void R() {} template <typename T, typename... U> void R(T &head, U &...tail) { _read(head); R(tail...); } template <typename T> inline void _write(const T &x) { cout << x << ' '; } void W() { cout << endl; } template <typename T, typename... U> void W(const T &head, const U &...tail) { _write(head); W(tail...); } void go(); int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); go(); return 0; } /****************ackun*********************/ void go() { ll n; R(n); ll mi = 1e16; rep(i, 1, 5) { ll x; R(x); mi = min(mi, x); } ll ans = 5; n -= mi; if (n > 0) { ans += n / mi; if ((n % mi) != 0) { ans++; } } W(ans); }
replace
40
41
40
41
0
p03077
C++
Runtime Error
#include <bits/stdc++.h> #define _overload(_1, _2, _3, name, ...) name #define _rep(i, n) _range(i, 0, n) #define _range(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define rep(...) _overload(__VA_ARGS__, _range, _rep, )(__VA_ARGS__) #define _rrep(i, n) _rrange(i, n, 0) #define _rrange(i, a, b) for (int i = (int)(a)-1; i >= (int)(b); --i) #define rrep(...) _overload(__VA_ARGS__, _rrange, _rrep, )(__VA_ARGS__) #define _all(arg) begin(arg), end(arg) #define uniq(arg) sort(_all(arg)), (arg).erase(unique(_all(arg)), end(arg)) #define bit(n) (1LL << (n)) // #define DEBUG #ifdef DEBUG #define dump(...) fprintf(stderr, __VA_ARGS__) #else #define dump(...) #endif template <class T> bool chmax(T &a, const T &b) { return (a < b) ? (a = b, 1) : 0; } template <class T> bool chmin(T &a, const T &b) { return (b < a) ? (a = b, 1) : 0; } using namespace std; using ll = long long; using vi = vector<int>; using vll = vector<ll>; const double EPS = 1e-10; const double PI = acos(-1.0); const int inf = INT_MAX; const ll INF = LLONG_MAX; const ll MOD = 1000000007LL; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; ll extgcd(ll a, ll b, ll &x, ll &y) { x = 1, y = 0; ll g = a; if (b != 0) g = extgcd(b, a % b, y, x), y -= a / b * x; return g; } ll ADD(const ll &a, const ll &b, const ll mod = MOD) { return (a + b) % mod; } ll SUB(const ll &a, const ll &b, const ll mod = MOD) { return (a - b + mod) % mod; } ll MUL(const ll &a, const ll &b, const ll mod = MOD) { return (1LL * a * b) % mod; } ll DIV(const ll &a, const ll &b, const ll mod = MOD) { ll x, y; extgcd(b, mod, x, y); return MUL(a, (x + mod) % mod, mod); } int main(void) { cin.tie(0); ios::sync_with_stdio(false); ll n; cin >> n; int m = 5; vi a(m); for (auto &e : a) cin >> e; ll mincap = *min_element(_all(a)); ll res = 4 + (n + mincap - 1) / mincap; cout << res << endl; return 0; }
#include <bits/stdc++.h> #define _overload(_1, _2, _3, name, ...) name #define _rep(i, n) _range(i, 0, n) #define _range(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define rep(...) _overload(__VA_ARGS__, _range, _rep, )(__VA_ARGS__) #define _rrep(i, n) _rrange(i, n, 0) #define _rrange(i, a, b) for (int i = (int)(a)-1; i >= (int)(b); --i) #define rrep(...) _overload(__VA_ARGS__, _rrange, _rrep, )(__VA_ARGS__) #define _all(arg) begin(arg), end(arg) #define uniq(arg) sort(_all(arg)), (arg).erase(unique(_all(arg)), end(arg)) #define bit(n) (1LL << (n)) // #define DEBUG #ifdef DEBUG #define dump(...) fprintf(stderr, __VA_ARGS__) #else #define dump(...) #endif template <class T> bool chmax(T &a, const T &b) { return (a < b) ? (a = b, 1) : 0; } template <class T> bool chmin(T &a, const T &b) { return (b < a) ? (a = b, 1) : 0; } using namespace std; using ll = long long; using vi = vector<int>; using vll = vector<ll>; const double EPS = 1e-10; const double PI = acos(-1.0); const int inf = INT_MAX; const ll INF = LLONG_MAX; const ll MOD = 1000000007LL; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; ll extgcd(ll a, ll b, ll &x, ll &y) { x = 1, y = 0; ll g = a; if (b != 0) g = extgcd(b, a % b, y, x), y -= a / b * x; return g; } ll ADD(const ll &a, const ll &b, const ll mod = MOD) { return (a + b) % mod; } ll SUB(const ll &a, const ll &b, const ll mod = MOD) { return (a - b + mod) % mod; } ll MUL(const ll &a, const ll &b, const ll mod = MOD) { return (1LL * a * b) % mod; } ll DIV(const ll &a, const ll &b, const ll mod = MOD) { ll x, y; extgcd(b, mod, x, y); return MUL(a, (x + mod) % mod, mod); } int main(void) { cin.tie(0); ios::sync_with_stdio(false); ll n; cin >> n; int m = 5; vll a(m); for (auto &e : a) cin >> e; ll mincap = *min_element(_all(a)); ll res = 4 + (n + mincap - 1) / mincap; cout << res << endl; return 0; }
replace
70
71
70
71
0
p03077
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < n; i++) using namespace std; typedef long long ll; int main() { ll N; vector<int> maxs(5); cin >> N; rep(i, 5) cin >> maxs[i]; sort(maxs.begin(), maxs.end()); ll res = 5; if (N % maxs[0]) res += ll(N / maxs[0]); else if (N > maxs[0]) res += N / maxs[0] - 1; cout << res << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < n; i++) using namespace std; typedef long long ll; int main() { ll N; vector<ll> maxs(5); cin >> N; rep(i, 5) cin >> maxs[i]; sort(maxs.begin(), maxs.end()); ll res = 5; if (N % maxs[0]) res += ll(N / maxs[0]); else if (N > maxs[0]) res += N / maxs[0] - 1; cout << res << endl; return 0; }
replace
7
8
7
8
0
p03077
C++
Runtime Error
// ~/Remember,remember the 6th of March #include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <complex> #include <ctype.h> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <time.h> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; typedef long long ll; typedef unsigned long long ull; const double PI = acos(-1.0); const double EPS = 1e-9; const ll MOD = 100000000; const int N = 2e6 + 10; void fast() { std::ios_base::sync_with_stdio(0); } int main() { /*#ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); //freopen("output.txt","w",stdout); #endif*/ ll n; cin >> n; vector<ll> arr(n); for (ll &i : arr) cin >> i; ll v = *min_element(arr.begin(), arr.end()); cout << (n + v - 1) / v + 4; return 0; }
// ~/Remember,remember the 6th of March #include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <complex> #include <ctype.h> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <time.h> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; typedef long long ll; typedef unsigned long long ull; const double PI = acos(-1.0); const double EPS = 1e-9; const ll MOD = 100000000; const int N = 2e6 + 10; void fast() { std::ios_base::sync_with_stdio(0); } int main() { /*#ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); //freopen("output.txt","w",stdout); #endif*/ ll n; cin >> n; vector<ll> arr(5); for (ll &i : arr) cin >> i; ll v = *min_element(arr.begin(), arr.end()); cout << (n + v - 1) / v + 4; return 0; }
replace
42
43
42
43
0
p03077
C++
Runtime Error
#include <algorithm> #include <iostream> #include <math.h> #include <string.h> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> P; int main() { int n, a, b, c, d, e; cin >> n >> a >> b >> c >> d >> e; int x = 0; if (n % min(a, min(b, min(c, min(d, e)))) != 0) { x = 1; } cout << n / min(a, min(b, min(c, min(d, e)))) + 5 - 1 + x << endl; return 0; }
#include <algorithm> #include <iostream> #include <math.h> #include <string.h> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> P; int main() { ll n, a, b, c, d, e; cin >> n >> a >> b >> c >> d >> e; int x = 0; if (n % min(a, min(b, min(c, min(d, e)))) != 0) { x = 1; } cout << n / min(a, min(b, min(c, min(d, e)))) + 5 - 1 + x << endl; return 0; }
replace
11
12
11
12
0
p03077
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { long n, ans = 4; cin >> n; vector<int> temp(5); rep(i, 5) cin >> temp.at(i); sort(temp.begin(), temp.end()); ans += (n + temp.at(0) - 1) / temp.at(0); cout << ans << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { long n, ans = 4; cin >> n; vector<long> temp(5); rep(i, 5) cin >> temp.at(i); sort(temp.begin(), temp.end()); ans += (n + temp.at(0) - 1) / temp.at(0); cout << ans << endl; }
replace
7
8
7
8
0
p03077
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define REP(i, n) for (int i = 0; i < n; i++) template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } const ll MOD = 1e9 + 7; int main() { ll N; cin >> N; ll m; for (int i = 0; i < 5; i++) { ll tmp; cin >> tmp; chmin(m, tmp); } ll ans = 4LL + (N / m) + (N % m != 0); cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define REP(i, n) for (int i = 0; i < n; i++) template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } const ll MOD = 1e9 + 7; int main() { ll N; cin >> N; ll m = 1e18; for (int i = 0; i < 5; i++) { ll tmp; cin >> tmp; chmin(m, tmp); } ll ans = 4LL + (N / m) + (N % m != 0); cout << ans << endl; return 0; }
replace
26
27
26
27
0
p03077
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, n) for (int i = 1; i <= (int)(n); i++) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--) #define repi(i, n, m) for (int i = (int)(n); i < (int)(m); i++) #define all(x) (x).begin(), (x).end() typedef long long ll; using namespace std; int main() { int n, a, b, c, d, e; cin >> n >> a >> b >> c >> d >> e; ll x = min({a, b, c, d, e}); cout << (ll)(n + x - 1) / x + 4 << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, n) for (int i = 1; i <= (int)(n); i++) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--) #define repi(i, n, m) for (int i = (int)(n); i < (int)(m); i++) #define all(x) (x).begin(), (x).end() typedef long long ll; using namespace std; int main() { ll n, a, b, c, d, e; cin >> n >> a >> b >> c >> d >> e; ll x = min({a, b, c, d, e}); cout << (ll)(n + x - 1) / x + 4 << endl; }
replace
9
10
9
10
0
p03077
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n, a, b, c, d, e; cin >> n >> a >> b >> c >> d >> e; ll mi = min({a, b, c, d, e}); if (n % mi == 0) cout << n / mi + 4; else cout << n / mi + 5; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, a, b, c, d, e; cin >> n >> a >> b >> c >> d >> e; ll mi = min({a, b, c, d, e}); if (n % mi == 0) cout << n / mi + 4; else cout << n / mi + 5; }
replace
7
8
7
8
0
p03077
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main(void) { int N, A, B, C, D, E; cin >> N; int tmp, mini = 100000; for (int i = 0; i < 5; ++i) { cin >> tmp; mini = min(tmp, mini); } cout << ceil(N / mini) + 5 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main(void) { long N, A, B, C, D, E; cin >> N >> A >> B >> C >> D >> E; long mini = min({A, B, C, D, E}); cout << ((N - 1) / mini) + 5 << endl; return 0; }
replace
5
13
5
9
0
p03077
C++
Time Limit Exceeded
#include <algorithm> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <set> #include <string> #include <utility> #include <vector> using namespace std; #define MOD 1000000007; int main() { long long n, a, b, c, d, e; cin >> n >> a >> b >> c >> d >> e; long long n1 = n, n2 = 0, n3 = 0, n4 = 0, n5 = 0, n6 = 0, t = 0; while (n6 < n) { n6 += min(n5, e); if (n5 <= e) n5 = 0; else n5 -= e; n5 += min(n4, d); if (n4 <= d) n4 = 0; else n4 -= d; n4 += min(n3, c); if (n3 <= c) n3 = 0; else n3 -= c; n3 += min(n2, b); if (n2 <= b) n2 = 0; else n2 -= b; n2 += min(n1, a); if (n1 <= a) n1 = 0; else n1 -= a; t++; } cout << t << endl; return 0; }
#include <algorithm> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <set> #include <string> #include <utility> #include <vector> using namespace std; #define MOD 1000000007; int main() { long long n, a, b, c, d, e; cin >> n >> a >> b >> c >> d >> e; long long neck = min(min(min(min(a, b), c), d), e); cout << (n + neck - 1) / neck + 4 << endl; return 0; }
replace
17
47
17
19
TLE
p03077
C++
Runtime Error
#include <bits/stdc++.h> #define ll unsigned long long int using namespace std; int main() { ll n, sum = 0; cin >> n; int a[5]; for (int i = 0; i < 5; i++) { cin >> a[i]; } ll mn = *min_element(a, a + 5); ll val = n / mn; ll mod = n % mn; if (mod > 0) val++; cout << 4 + val << '\n'; }
#include <bits/stdc++.h> #define ll unsigned long long int using namespace std; int main() { ll n, sum = 0; cin >> n; ll a[5]; for (int i = 0; i < 5; i++) { cin >> a[i]; } ll mn = *min_element(a, a + 5); ll val = n / mn; ll mod = n % mn; if (mod > 0) val++; cout << 4 + val << '\n'; }
replace
6
7
6
7
0
p03077
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { unsigned long long n; cin >> n; auto v = vector<int>(istream_iterator<int>(cin), istream_iterator<int>()); auto _min = *std::min_element(v.begin(), v.end()); unsigned long long minits = ceil((double)n / (double)_min) + 4; cout << minits; }
#include <bits/stdc++.h> using namespace std; int main() { unsigned long long n; cin >> n; auto v = vector<unsigned long long>(istream_iterator<unsigned long long>(cin), istream_iterator<unsigned long long>()); auto _min = *std::min_element(v.begin(), v.end()); unsigned long long minits = ceil((double)n / (double)_min) + 4; cout << minits; }
replace
5
6
5
7
0
p03077
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { long long a, N; cin >> N; // すべてを配列vecに入れる vector<int> vec(5); for (int i = 0; i < 5; i++) { cin >> vec.at(i); } // vecの中で一番小さい要素を選ぶ for (int i = 0; i < 5; i++) { if (i == 0) a = vec.at(0); else if (a > vec.at(i)) a = vec.at(i); else { } } cout << 5 + N / a << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long N, A, B, C, D, E, p; cin >> N >> A >> B >> C >> D >> E; p = min({A, B, C, D, E}); cout << 5 + (N - 1) / p << endl; }
replace
4
22
4
8
0
p03077
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const double EPS = 1e-9; typedef vector<int> vint; typedef pair<int, int> pint; #define rep(i, n) REP(i, 0, n) #define ALL(v) v.begin(), v.end() #define MSG(a) cout << #a << " " << a << endl; #define REP(i, x, n) for (int i = x; i < n; i++) template <class T, class C> void chmax(T &a, C b) { a > b ?: a = b; } template <class T, class C> void chmin(T &a, C b) { a < b ?: a = b; } int main(int argc, char *argv[]) { long long n; int padding = 0; vint a(5); cin >> n >> a[0] >> a[1] >> a[2] >> a[3] >> a[4]; if (n % *min_element(ALL(a)) != 0) padding = 1; cout << n / *min_element(ALL(a)) + 4 + padding << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; const double EPS = 1e-9; typedef vector<int> vint; typedef pair<int, int> pint; #define rep(i, n) REP(i, 0, n) #define ALL(v) v.begin(), v.end() #define MSG(a) cout << #a << " " << a << endl; #define REP(i, x, n) for (int i = x; i < n; i++) template <class T, class C> void chmax(T &a, C b) { a > b ?: a = b; } template <class T, class C> void chmin(T &a, C b) { a < b ?: a = b; } int main(int argc, char *argv[]) { long long n; int padding = 0; vector<long> a(5); cin >> n >> a[0] >> a[1] >> a[2] >> a[3] >> a[4]; if (n % *min_element(ALL(a)) != 0) padding = 1; cout << n / *min_element(ALL(a)) + 4 + padding << endl; return 0; }
replace
15
16
15
16
0
p03077
C++
Time Limit Exceeded
#pragma GCC optimize("Ofast") #pragma GCC target("avx2,tune=native") #include <bits/stdc++.h> #include <x86intrin.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); long long N, A, B, C, D, E; cin >> N >> A >> B >> C >> D >> E; long long cnt[6] = {N, 0, 0, 0, 0, 0}, time = 0; while (cnt[5] < N) { if (cnt[4] <= E) { cnt[5] += cnt[4]; cnt[4] = 0; } else { cnt[5] += E; cnt[4] -= E; } if (cnt[3] <= D) { cnt[4] += cnt[3]; cnt[3] = 0; } else { cnt[4] += D; cnt[3] -= D; } if (cnt[2] <= C) { cnt[3] += cnt[2]; cnt[2] = 0; } else { cnt[3] += C; cnt[2] -= C; } if (cnt[1] <= B) { cnt[2] += cnt[1]; cnt[1] = 0; } else { cnt[2] += B; cnt[1] -= B; } if (cnt[0] <= A) { cnt[1] += cnt[0]; cnt[0] = 0; } else { cnt[1] += A; cnt[0] -= A; } time++; } cout << time; return 0; }
#pragma GCC optimize("Ofast") #pragma GCC target("avx2,tune=native") #include <bits/stdc++.h> #include <x86intrin.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); long long N, A[5]; cin >> N >> A[0] >> A[1] >> A[2] >> A[3] >> A[4]; sort(A, A + 5); cout << (long long)ceil((double)N / (double)A[0]) + 4; return 0; }
replace
11
53
11
15
TLE
p03077
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> using namespace std; #define ll long long int main() { while (1) { ll n; cin >> n; ll a[6]; for (int i = 0; i < 5; i++) { cin >> a[i]; } sort(a, a + 5); if (a[0] >= n) cout << "5" << endl; else { ll ans; if (n % a[0]) ans = n / a[0] + 5; else ans = n / a[0] + 4; cout << ans << endl; } } return 0; }
#include <algorithm> #include <iostream> using namespace std; #define ll long long int main() { ll n; cin >> n; ll a[6]; for (int i = 0; i < 5; i++) { cin >> a[i]; } sort(a, a + 5); if (a[0] >= n) cout << "5" << endl; else { ll ans; if (n % a[0]) ans = n / a[0] + 5; else ans = n / a[0] + 4; cout << ans << endl; } return 0; }
replace
7
25
7
23
TLE
p03077
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <iomanip> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; typedef long l; typedef pair<int, int> P; const ll INF = 100000000000000001; const double PI = 3.141592653589; int main() { int n; cin >> n; vector<int> t(5); rep(i, 5) cin >> t[i]; vector<int> a(6, 0); a[0] = n; ll time = 0; while (a[5] != n) { for (int i = 4; 0 <= i; i--) { if (a[i] == 0) continue; if (a[i] < t[i]) { a[i + 1] += a[i]; a[i] = 0; } else { a[i + 1] += t[i]; a[i] -= t[i]; } } // rep(i,6){ // cout<<a[i]<<(i==5?"\n":" "); // } time++; } cout << time << endl; return 0; }
#include <bits/stdc++.h> #include <iomanip> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; typedef long l; typedef pair<int, int> P; const ll INF = 100000000000000001; const double PI = 3.141592653589; int main() { ll n, a, b, c, d, e; cin >> n >> a >> b >> c >> d >> e; ll mm = min({a, b, c, d, e}); if (n % mm == 0) cout << n / mm + 4 << endl; else cout << n / mm + 5 << endl; return 0; }
replace
11
37
11
18
TLE
p03077
C++
Runtime Error
#include <iostream> using namespace std; using ll = long long; int main() { ll n, i, c, bn; cin >> n; for (i = 0; i < 5; ++i) { cin >> c; bn = min(bn, c); } if (n % bn == 0) cout << n / bn + 4 << endl; else cout << n / bn + 5 << endl; return 0; }
#include <iostream> using namespace std; using ll = long long; int main() { ll n, i, c, bn = 1e15 + 1; cin >> n; for (i = 0; i < 5; ++i) { cin >> c; bn = min(bn, c); } if (n % bn == 0) cout << n / bn + 4 << endl; else cout << n / bn + 5 << endl; return 0; }
replace
5
6
5
6
0
p03077
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, A, B, C, D, E, X; cin >> N >> A >> B >> C >> D >> E; X = min(A, min(B, min(C, min(D, E)))); if (N % X != 0) { cout << N / X + 5 << endl; } else { cout << N / X + 4 << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { long long N, A, B, C, D, E, X; cin >> N >> A >> B >> C >> D >> E; X = min(A, min(B, min(C, min(D, E)))); if (N % X != 0) { cout << N / X + 5 << endl; } else { cout << N / X + 4 << endl; } }
replace
4
5
4
5
0
p03077
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; void solveA() { int a, b, c, d, e, k; cin >> a >> b >> c >> d >> e >> k; if (e - a > k) { cout << ":(" << endl; } else { cout << "Yay!" << endl; } } void solveB() { int a[5]; cin >> a[0] >> a[1] >> a[2] >> a[3] >> a[4]; int min = 9; int minad = 0; for (int i = 0; i < 5; i++) { if (a[i] % 10 < min && a[i] % 10 != 0) { min = a[i] % 10; minad = i; } } int ans = 0; for (int i = 0; i < 5; i++) { if (i == minad || a[i] % 10 == 0) { ans += a[i]; } else { ans = ans + 10 - a[i] % 10 + a[i]; } } cout << ans << endl; } void solveC() { long long n; vector<long long> a{5}; cin >> n >> a[0] >> a[1] >> a[2] >> a[3] >> a[4]; sort(a.begin(), a.end()); cout << (n + a[0] - 1) / a[0] + 4 << endl; } void solveD() {} int main() { solveC(); }
#include <bits/stdc++.h> using namespace std; void solveA() { int a, b, c, d, e, k; cin >> a >> b >> c >> d >> e >> k; if (e - a > k) { cout << ":(" << endl; } else { cout << "Yay!" << endl; } } void solveB() { int a[5]; cin >> a[0] >> a[1] >> a[2] >> a[3] >> a[4]; int min = 9; int minad = 0; for (int i = 0; i < 5; i++) { if (a[i] % 10 < min && a[i] % 10 != 0) { min = a[i] % 10; minad = i; } } int ans = 0; for (int i = 0; i < 5; i++) { if (i == minad || a[i] % 10 == 0) { ans += a[i]; } else { ans = ans + 10 - a[i] % 10 + a[i]; } } cout << ans << endl; } void solveC() { long long n; vector<long long> a(5); cin >> n >> a[0] >> a[1] >> a[2] >> a[3] >> a[4]; sort(a.begin(), a.end()); cout << (n + a[0] - 1) / a[0] + 4 << endl; } void solveD() {} int main() { solveC(); }
replace
39
40
39
40
0
p03077
C++
Time Limit Exceeded
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define ll long long using namespace std; int main() { ll N, A, B, C, D, E; cin >> N >> A >> B >> C >> D >> E; vector<ll> vec = {N, 0, 0, 0, 0, 0}; vector<ll> key = {A, B, C, D, E}; ll t = 0; while (vec[5] != N) { for (ll i = 4; i > -1; i--) { vec[i + 1] += min(vec[i], key[i]); vec[i] -= min(vec[i], key[i]); } // rep(i,6) cout <<vec[i]<<endl; t++; } cout << t << endl; }
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define ll long long using namespace std; int main() { ll N, A, B, C, D, E; cin >> N >> A >> B >> C >> D >> E; vector<ll> vec = {N, 0, 0, 0, 0, 0}; vector<ll> key = {A, B, C, D, E}; B = min(A, B); C = min(B, C); D = min(C, D); E = min(D, E); ll k; if (N % E == 0) k = N / E; else k = N / E + 1; cout << 4 + k << endl; }
replace
21
31
21
31
TLE
p03077
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define ll long long #define endl '\n' using namespace std; int dy[4] = {1, 0, -1, 0}, dx[4] = {0, 1, 0, -1}; int main() { cin.tie(0); ios::sync_with_stdio(false); ll n, trans[5]; cin >> n; rep(i, 5) { cin >> trans[i]; } ll num[6] = {n, 0, 0, 0, 0, 0}; ll cnt = 0; while (num[5] != n) { for (int i = 4; i >= 0; i--) { if (num[i] > 0) { ll tmp = num[i]; num[i] -= tmp > trans[i] ? trans[i] : tmp; num[i + 1] += tmp > trans[i] ? trans[i] : tmp; if (num[i] < 0) { num[i] = 0; } } } cnt++; } cout << cnt << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define ll long long #define endl '\n' using namespace std; int dy[4] = {1, 0, -1, 0}, dx[4] = {0, 1, 0, -1}; int main() { cin.tie(0); ios::sync_with_stdio(false); ll n, a, b, c, d, e; cin >> n >> a >> b >> c >> d >> e; cout << (n - 1) / min({a, b, c, d, e}) + 5 << endl; return 0; }
replace
10
29
10
13
TLE
p03077
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { long n; cin >> n; vector<int> h(5); for (int i = 0; i < 5; i++) { cin >> h.at(i); } sort(h.begin(), h.end()); if (h.at(0) >= n) { cout << 5 << endl; } else { cout << (n + h.at(0) - 1) / h.at(0) + 4 << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { long n; cin >> n; vector<long> h(5); for (long i = 0; i < 5; i++) { cin >> h.at(i); } sort(h.begin(), h.end()); if (h.at(0) >= n) { cout << 5 << endl; } else { cout << (n + h.at(0) - 1) / h.at(0) + 4 << endl; } }
replace
6
8
6
8
0
p03077
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <numeric> #include <vector> using namespace std; int main() { int n, a, b, c, d, e; cin >> n >> a >> b >> c >> d >> e; cout << max({(n - 1) / a, (n - 1) / b, (n - 1) / c, (n - 1) / d, (n - 1) / e}) + 5 << endl; return 0; }
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <numeric> #include <vector> using namespace std; int main() { long long n, a, b, c, d, e; cin >> n >> a >> b >> c >> d >> e; cout << max({(n - 1) / a, (n - 1) / b, (n - 1) / c, (n - 1) / d, (n - 1) / e}) + 5 << endl; return 0; }
replace
8
9
8
9
0
p03077
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { vector<long long int> c_v(6, 0); long long int N, A, B, C, D, E, cnt = 0; cin >> N >> A >> B >> C >> D >> E; c_v[0] = N; while (c_v[5] < N) { cnt++; if (c_v[4] > 0) { if (c_v[4] >= E) { c_v[5] += E; c_v[4] -= E; } else { c_v[5] += c_v[4]; c_v[4] -= c_v[4]; } } if (c_v[3] > 0) { if (c_v[3] >= D) { c_v[4] += D; c_v[3] -= D; } else { c_v[4] += c_v[3]; c_v[3] -= c_v[3]; } } if (c_v[2] > 0) { if (c_v[2] >= C) { c_v[3] += C; c_v[2] -= C; } else { c_v[3] += c_v[2]; c_v[2] -= c_v[2]; } } if (c_v[1] > 0) { if (c_v[1] >= B) { c_v[2] += B; c_v[1] -= B; } else { c_v[2] += c_v[1]; c_v[1] -= c_v[1]; } } if (c_v[0] > 0) { if (c_v[0] >= A) { c_v[1] += A; c_v[0] -= A; } else { c_v[1] += c_v[0]; c_v[0] -= c_v[0]; } } // puts(""); } cout << cnt << endl; // char S[1000000] = {0}; // vector<int> s_v, s_01v, s_10v; // cin >> S; // //cout << strlen(S) << endl; // for (int i = 0; i < strlen(S); i++) { // s_v.push_back(S[i] - '0'); // switch(i%2) { // case 0: // s_01v.push_back(0); // s_10v.push_back(1); // break; // case 1: // s_01v.push_back(1); // s_10v.push_back(0); // break; // } // } // long long int cnt_01 = 0, cnt_10 = 0; // for (int i = 0; i < strlen(S); i++) { // if (s_01v[i] != s_v[i]) cnt_01++; // if (s_10v[i] != s_v[i]) cnt_10++; // } // if (cnt_01 > cnt_10) { // cout << cnt_10 << endl; // } // else { // cout << cnt_01 << endl; // } // for (int i = 0; i < strlen(S); i++) { // printf("%d ", s_v[i]); // } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { vector<long long int> c_v(6, 0); long long int N, A, B, C, D, E, cnt = 0; cin >> N >> A >> B >> C >> D >> E; long long int a = N % min({A, B, C, D, E}); if (a == 0) { cnt = (N / min({A, B, C, D, E})) + 4; } else { cnt = (N / min({A, B, C, D, E})) + 5; } cout << cnt << endl; // char S[1000000] = {0}; // vector<int> s_v, s_01v, s_10v; // cin >> S; // //cout << strlen(S) << endl; // for (int i = 0; i < strlen(S); i++) { // s_v.push_back(S[i] - '0'); // switch(i%2) { // case 0: // s_01v.push_back(0); // s_10v.push_back(1); // break; // case 1: // s_01v.push_back(1); // s_10v.push_back(0); // break; // } // } // long long int cnt_01 = 0, cnt_10 = 0; // for (int i = 0; i < strlen(S); i++) { // if (s_01v[i] != s_v[i]) cnt_01++; // if (s_10v[i] != s_v[i]) cnt_10++; // } // if (cnt_01 > cnt_10) { // cout << cnt_10 << endl; // } // else { // cout << cnt_01 << endl; // } // for (int i = 0; i < strlen(S); i++) { // printf("%d ", s_v[i]); // } return 0; }
replace
6
60
6
11
TLE
p03077
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // macro #define rep(i, n) for (i = 0; i < n; i++) #define ll long long #define all(v) v.begin(), v.end() // code starts int main() { ll n; cin >> n; vector<int> mov(5); int i; rep(i, 5) cin >> mov[i]; sort(all(mov)); ll ans; ans = (n + mov[0] - 1) / mov[0] + 4; cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; // macro #define rep(i, n) for (i = 0; i < n; i++) #define ll long long #define all(v) v.begin(), v.end() // code starts int main() { ll n; cin >> n; vector<ll> mov(5); int i; rep(i, 5) cin >> mov[i]; sort(all(mov)); ll ans; ans = (n + mov[0] - 1) / mov[0] + 4; cout << ans << endl; }
replace
12
13
12
13
0
p03077
C++
Runtime Error
#include <bits/stdc++.h> #define mod 1000000007 #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; typedef long long ll; int main(void) { int N, a[5]; cin >> N; rep(i, 5) cin >> a[i]; sort(a, a + 5); ll ans = ceil((N - 1) / a[0]) + 5; cout << ans; return 0; }
#include <bits/stdc++.h> #define mod 1000000007 #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; typedef long long ll; int main(void) { ll N, a[5]; cin >> N; rep(i, 5) cin >> a[i]; sort(a, a + 5); ll ans = ceil((N - 1) / a[0]) + 5; cout << ans; return 0; }
replace
11
12
11
12
0
p03077
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> #include <string> using namespace std; typedef long long ll; int main(void) { ll n, a, b, c, d, e, ans = 5; cin >> n >> a >> b >> c >> d >> e; ans += n / max({(n - 1) / a, (n - 1) / b, (n - 1) / c, (n - 1) / d, (n - 1) / e}); cout << ans << endl; return 0; }
#include <algorithm> #include <cstdio> #include <iostream> #include <string> using namespace std; typedef long long ll; int main(void) { ll n, a, b, c, d, e, ans = 5; cin >> n >> a >> b >> c >> d >> e; ans += max({(n - 1) / a, (n - 1) / b, (n - 1) / c, (n - 1) / d, (n - 1) / e}); cout << ans << endl; return 0; }
replace
10
12
10
11
0
p03077
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, a, b, c, d, e; cin >> n >> a >> b >> c >> d >> e; map<ll, ll> city_people = {{1, n}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}}; vector<ll> sub = {0, a, b, c, d, e}; int t = 0; while (true) { for (int i = 5; 1 <= i; i--) { if (city_people[i]) { city_people[i + 1] += (0 <= city_people[i] - sub[i]) ? sub[i] : city_people[i]; city_people[i] = max(0LL, city_people[i] - sub[i]); } } t++; if (city_people[6] == n) break; } cout << t << endl; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, a, b, c, d, e; cin >> n >> a >> b >> c >> d >> e; ll minv = min({a, b, c, d, e}); cout << (n + minv - 1) / minv + 4 << endl; }
replace
8
24
8
10
TLE
p03077
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; signed main(void) { vector<int> a(5); long long n, ans; cin >> n; rep(i, 5) cin >> a[i]; sort(a.begin(), a.end()); ans = (n / a[0] + 1) + 4; if (n % a[0] == 0) ans--; cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; signed main(void) { vector<long long> a(5); long long n, ans; cin >> n; rep(i, 5) cin >> a[i]; sort(a.begin(), a.end()); ans = (n / a[0] + 1) + 4; if (n % a[0] == 0) ans--; cout << ans << endl; return 0; }
replace
5
6
5
6
0
p03077
Python
Runtime Error
print(-(-(int(input())) // min([int(input() for i in range(5))])) + 4)
print(-(-int(input()) // min([int(input()) for i in range(5)])) + 4)
replace
0
1
0
1
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'generator'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03077/Python/s377505366.py", line 1, in <module> print(-(-(int(input())) // min([int(input() for i in range(5))])) + 4) TypeError: int() argument must be a string, a bytes-like object or a real number, not 'generator'
p03077
Python
Runtime Error
from math import ceil def main(N, A, B, C, D, E): loads = [A, B, C, D, E] min_val = min(loads) min_index = loads.index(min_val) res = min_index + ceil(N / min_val) + (5 - (min_index + 1)) return res if __name__ == "__main__": N = input() A = input() B = input() C = input() D = input() E = input() print(main(N, A, B, C, D, E))
from math import ceil def main(N, A, B, C, D, E): loads = [A, B, C, D, E] min_val = min(loads) min_index = loads.index(min_val) res = min_index + ceil(N / min_val) + (5 - (min_index + 1)) return res if __name__ == "__main__": N = int(input()) A = int(input()) B = int(input()) C = int(input()) D = int(input()) E = int(input()) print(main(N, A, B, C, D, E))
replace
14
20
14
20
TypeError: unsupported operand type(s) for /: 'str' and 'str'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03077/Python/s219806680.py", line 21, in <module> print(main(N, A, B, C, D, E)) File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03077/Python/s219806680.py", line 9, in main res = min_index + ceil(N / min_val) + (5 - (min_index + 1)) TypeError: unsupported operand type(s) for /: 'str' and 'str'
p03077
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { long long n; vector<int> a(5); cin >> n; long long min; for (int i = 0; i < 5; i++) { cin >> a[i]; } min = *min_element(a.begin(), a.end()); cout << 4 + (n + min - 1) / min << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long n; vector<long long> a(5); cin >> n; long long min; for (int i = 0; i < 5; i++) { cin >> a[i]; } min = *min_element(a.begin(), a.end()); cout << 4 + (n + min - 1) / min << endl; return 0; }
replace
5
6
5
6
0
p03077
C++
Runtime Error
/* * cpp_filepath */ // C++ 14 #include <algorithm> #include <cassert> #include <cmath> #include <cstring> // memset #include <iostream> #include <vector> using namespace std; #define ll long long #define loop(__x, __start, __end) for (int __x = __start; __x < __end; __x++) template <class T> ostream &operator<<(ostream &out, vector<T> const &v) { for (auto &&a : v) out << a << " "; out << endl; return out; } template <class T> void dump(T &a) { cout << a << endl; } void solve(); int main() { solve(); return 0; } void solve() { ll n; cin >> n; vector<ll> A(5); loop(i, 0, n) cin >> A[i]; sort(A.begin(), A.end()); ll m = (n / A[0]) + (n % A[0] != 0); cout << m + 4 << endl; }
/* * cpp_filepath */ // C++ 14 #include <algorithm> #include <cassert> #include <cmath> #include <cstring> // memset #include <iostream> #include <vector> using namespace std; #define ll long long #define loop(__x, __start, __end) for (int __x = __start; __x < __end; __x++) template <class T> ostream &operator<<(ostream &out, vector<T> const &v) { for (auto &&a : v) out << a << " "; out << endl; return out; } template <class T> void dump(T &a) { cout << a << endl; } void solve(); int main() { solve(); return 0; } void solve() { ll n; cin >> n; vector<ll> A(5); loop(i, 0, 5) cin >> A[i]; sort(A.begin(), A.end()); ll m = (n / A[0]) + (n % A[0] != 0); cout << m + 4 << endl; }
replace
31
32
31
32
0
p03077
C++
Runtime Error
#include <iostream> using namespace std; int a[10], ppl, ans, cnt[10]; int main() { cin >> ppl >> a[1] >> a[2] >> a[3] >> a[4] >> a[5]; a[0] = ppl; cnt[0] = 1; for (int i = 1; i <= 5; i++) { if (a[i] >= a[i - 1]) { cnt[i] = cnt[i - 1]; a[i] = a[i - 1]; } else cnt[i] = (ppl % a[i] == 0 ? (ppl / a[i]) : (ppl / a[i] + 1)); ans = max(ans, cnt[i] + i - 1); } cout << ans << endl; return 0; }
#include <iostream> using namespace std; long long a[10], ppl, ans, cnt[10]; int main() { cin >> ppl >> a[1] >> a[2] >> a[3] >> a[4] >> a[5]; a[0] = ppl; cnt[0] = 1; for (int i = 1; i <= 5; i++) { if (a[i] >= a[i - 1]) { cnt[i] = cnt[i - 1]; a[i] = a[i - 1]; } else cnt[i] = (ppl % a[i] == 0 ? (ppl / a[i]) : (ppl / a[i] + 1)); ans = max(ans, cnt[i] + i - 1); } cout << ans << endl; return 0; }
replace
4
5
4
5
0
p03077
C++
Runtime Error
#pragma GCC optimize("O2,Ofast,inline,unroll-all-loops,-ffast-math") #include <bits/stdc++.h> #define pb(X) push_back(X) #define x first #define y second #define INIT \ std::ios::sync_with_stdio(false); \ std::cin.tie(0); using namespace std; typedef pair<int, int> pii; long long n, a, b, c, d, e, ans; int main() { INIT cin >> n; vector<long long> A(5); for (int i = 0; i < n; ++i) { cin >> A[i]; } long long Min = *min_element(A.begin(), A.end()); ans = (Min + n - 1) / Min + 4; cout << ans; return 0; }
#pragma GCC optimize("O2,Ofast,inline,unroll-all-loops,-ffast-math") #include <bits/stdc++.h> #define pb(X) push_back(X) #define x first #define y second #define INIT \ std::ios::sync_with_stdio(false); \ std::cin.tie(0); using namespace std; typedef pair<int, int> pii; long long n, a, b, c, d, e, ans; int main() { INIT cin >> n; vector<long long> A(5); for (int i = 0; i < 5; ++i) { cin >> A[i]; } long long Min = *min_element(A.begin(), A.end()); ans = (Min + n - 1) / Min + 4; cout << ans; return 0; }
replace
17
18
17
18
0
p03077
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; #define REP(i, n) for (int i = 0; i < n; i++) typedef long long ll; int MAX = 5; int main() { ll N; cin >> N; int A[MAX]; REP(i, MAX) { cin >> A[i]; } sort(A, A + 5); ll ans = N / A[0] + 4; if (N % A[0] != 0) ++ans; cout << ans << endl; return 0; }
#include <algorithm> #include <iostream> using namespace std; #define REP(i, n) for (int i = 0; i < n; i++) typedef long long ll; int MAX = 5; int main() { ll N; cin >> N; ll A[MAX]; REP(i, MAX) { cin >> A[i]; } sort(A, A + 5); ll ans = N / A[0] + 4; if (N % A[0] != 0) ++ans; cout << ans << endl; return 0; }
replace
10
11
10
11
0
p03077
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long N; long long p[5]; cin >> N >> p[0] >> p[1] >> p[2] >> p[3] >> p[4]; long long T[6]; for (int i = 0; i < 6; i++) { T[i] = 0; } long long cnt = 0; T[0] = N; while (!(T[5] == N)) { cout << cnt << " " << T[0] << T[1] << T[2] << T[3] << T[4]; cnt++; for (int i = 0; i < 5; i++) { if (T[i] >= p[i]) { T[i] = T[i] - p[i]; T[i + 1] = T[i + 1] + p[i]; } else { T[i] = 0; T[i + 1] = T[i + 1] + T[i]; } } } cout << cnt << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { double N, A, B, C, D, E; cin >> N >> A >> B >> C >> D >> E; double bottle = min(min(min(min(A, B), C), D), E); // cout<<N<<" "<<bottle<<endl; cout << setprecision(18) << ceil(N / bottle) + 4 << endl; return 0; }
replace
4
27
4
9
TLE
p03077
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; typedef long long int ll; typedef pair<int, int> P; const long long mod = 1e9 + 7; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define ALL(a) (a).begin(), (a).end() int main(void) { ll n; cin >> n; ll a, b, c, d, e; cin >> a >> b >> c >> d >> e; ll ans = 0; vector<ll> v = {n, 0, 0, 0, 0, 0}; for (; v[5] != n;) { v[5] += min(v[4], e); v[4] -= min(v[4], e); v[4] += min(v[3], d); v[3] -= min(v[3], d); v[3] += min(v[2], c); v[2] -= min(v[2], c); v[2] += min(v[1], b); v[1] -= min(v[1], b); v[1] += min(v[0], a); v[0] -= min(v[0], a); ans++; } cout << ans << endl; return 0; }
#include <algorithm> #include <cmath> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; typedef long long int ll; typedef pair<int, int> P; const long long mod = 1e9 + 7; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define ALL(a) (a).begin(), (a).end() int main(void) { ll N, A, B, C, D, E; cin >> N >> A >> B >> C >> D >> E; cout << max({(N - 1) / A, (N - 1) / B, (N - 1) / C, (N - 1) / D, (N - 1) / E}) + 5 << endl; return 0; }
replace
22
42
22
28
TLE