QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#339651 | #8284. Cats and Fish | IsaacQ | WA | 0ms | 3716kb | C++14 | 810b | 2024-02-27 18:53:11 | 2024-02-27 18:53:12 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define pii pair<int,int>
using namespace std;
const ll N = 1e9;
const ll mod = 998244353;
ll sum = 0;
int n, m, k;
void solve()
{
ll a[n];
int cnt = 0;
for(int i=0; i<m; i++)
{
cin >> a[i];
if(a[i] > k) cnt ++;
}
ll sum = 0;
ll inc = 0;
m = min(m,n);
for(int i=0; i<m; i++)
{
sum += k/a[i];
if(k % a[i] != 0) inc += 1;
}
if(sum >= n) cout << "0 " << cnt << endl;
else {
if(sum + inc >= n)
{
cout << "0 ";
cout << min(inc, n - sum) << endl;
}
else
{
cout << n - sum - inc << " " << inc << endl;
}
}
}
int main()
{
cin >> n >> m >> k;
solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3676kb
input:
2 1 1 1
output:
1 0
result:
ok 2 number(s): "1 0"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
8 3 5 1 3 4
output:
0 1
result:
ok 2 number(s): "0 1"
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3716kb
input:
4 5 1 5 4 3 2 1
output:
0 4
result:
wrong answer 2nd numbers differ - expected: '3', found: '4'