| Task: | Entrepreneur |
| Sender: | aalto26aw_007 |
| Submission time: | 2026-09-02 17:34:55 +0300 |
| Language: | C++ (C++20) |
| Status: | READY |
| Result: | WRONG ANSWER |
| test | verdict | time | |
|---|---|---|---|
| #1 | ACCEPTED | 0.00 s | details |
| #2 | ACCEPTED | 0.00 s | details |
| #3 | ACCEPTED | 0.00 s | details |
| #4 | ACCEPTED | 0.00 s | details |
| #5 | WRONG ANSWER | 0.00 s | details |
| #6 | ACCEPTED | 0.01 s | details |
| #7 | ACCEPTED | 0.01 s | details |
| #8 | WRONG ANSWER | 0.16 s | details |
| #9 | ACCEPTED | 0.22 s | details |
| #10 | ACCEPTED | 0.23 s | details |
| #11 | ACCEPTED | 0.00 s | details |
| #12 | ACCEPTED | 0.00 s | details |
| #13 | WRONG ANSWER | 0.00 s | details |
| #14 | ACCEPTED | 0.00 s | details |
Compiler report
input/code.cpp: In function 'bool possible(long long int, std::vector<long long int>&, long long int)':
input/code.cpp:8:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
8 | for (int i = 0; i < k.size(); i++) {
| ~~^~~~~~~~~~Code
#include <bits/stdc++.h>
using namespace std;
#define ll long long
bool possible(long long t, vector<ll>& k, long long goal) {
ll s = 0;
for (int i = 0; i < k.size(); i++) {
s += t / k[i];
}
return s >= goal;
}
int main() {
ll n, t;
cin >> n >> t;
vector<ll> k(n);
for (auto &v : k) cin >> v;
ll lo = 0;
ll hi = 1'000'000'000'000'000;
ll ans = -1;
while (lo <= hi) {
ll mid = lo + (hi - lo) / 2;
if (possible(mid, k, t)) {
hi=mid-1;
ans = mid;
} else {
lo=mid+1;
}
}
cout << ans << endl;
}Test details
Test 1
Verdict: ACCEPTED
| input |
|---|
| 10 10 6 5 1 2 1 5 10 4 6 6 |
| correct output |
|---|
| 4 |
| user output |
|---|
| 4 |
Test 2
Verdict: ACCEPTED
| input |
|---|
| 10 10 6 6 4 3 4 9 3 2 6 10 |
| correct output |
|---|
| 6 |
| user output |
|---|
| 6 |
Test 3
Verdict: ACCEPTED
| input |
|---|
| 10 10 5 4 10 7 8 4 1 8 9 2 |
| correct output |
|---|
| 5 |
| user output |
|---|
| 5 |
Test 4
Verdict: ACCEPTED
| input |
|---|
| 1 1000000000 1 |
| correct output |
|---|
| 1000000000 |
| user output |
|---|
| 1000000000 |
Test 5
Verdict: WRONG ANSWER
| input |
|---|
| 1 1000000000 1000000000 |
| correct output |
|---|
| 1000000000000000000 |
| user output |
|---|
| -1 |
Feedback: Incorrect character on line 1 col 1: expected "100000000000...", got "-1"
Test 6
Verdict: ACCEPTED
| input |
|---|
| 1000 1000 271 687 392 992 11 410 702 870... |
| correct output |
|---|
| 223 |
| user output |
|---|
| 223 |
Test 7
Verdict: ACCEPTED
| input |
|---|
| 1000 1000 598 523 703 794 737 689 724 26... |
| correct output |
|---|
| 282 |
| user output |
|---|
| 282 |
Test 8
Verdict: WRONG ANSWER
| input |
|---|
| 200000 1000000000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
| correct output |
|---|
| 5000 |
| user output |
|---|
| 276701161110644 |
Feedback: Incorrect character on line 1 col 1: expected "5000", got "276701161110644"
Test 9
Verdict: ACCEPTED
| input |
|---|
| 200000 1 760045594 599341056 300698860 ... |
| correct output |
|---|
| 8214 |
| user output |
|---|
| 8214 |
Test 10
Verdict: ACCEPTED
| input |
|---|
| 200000 1000000000 33941840 210038922 596070148 7... |
| correct output |
|---|
| 371045814100 |
| user output |
|---|
| 371045814100 |
Test 11
Verdict: ACCEPTED
| input |
|---|
| 25 1000000000 1000000000 1 1 1 1 1 1 1 1 1 1... |
| correct output |
|---|
| 41666667 |
| user output |
|---|
| 41666667 |
Test 12
Verdict: ACCEPTED
| input |
|---|
| 12 1000000000 1 1 1 1 1 1 1 1 1 1 1 10000000... |
| correct output |
|---|
| 90909091 |
| user output |
|---|
| 90909091 |
Test 13
Verdict: WRONG ANSWER
| input |
|---|
| 23 1000000000 1000000000 1000000000 10000000... |
| correct output |
|---|
| 43478261000000000 |
| user output |
|---|
| -1 |
Feedback: Incorrect character on line 1 col 1: expected "434782610000...", got "-1"
Test 14
Verdict: ACCEPTED
| input |
|---|
| 3 3 10 11 12 |
| correct output |
|---|
| 12 |
| user output |
|---|
| 12 |
