QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#339643#8284. Cats and FishIsaacQWA 0ms3708kbC++14711b2024-02-27 18:44:152024-02-27 18:44:16

Judging History

This is the latest submission verdict.

  • [2024-02-27 18:44:16]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3708kb
  • [2024-02-27 18:44:15]
  • Submitted

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];
    for(int i=0; i<m; i++) cin >> a[i];

    ll sum = 0;
    ll inc = 0;
    for(int i=0; i<m; i++)
    {
        sum += k/a[i];

        if(k % a[i] != 0) inc += 1;
    }

    if(sum >= n) cout << "0 0";
    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: 3656kb

input:

2 1 1
1

output:

1 0

result:

ok 2 number(s): "1 0"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3708kb

input:

8 3 5
1 3 4

output:

0 1

result:

ok 2 number(s): "0 1"

Test #3:

score: 0
Accepted
time: 0ms
memory: 3652kb

input:

4 5 1
5 4 3 2 1

output:

0 3

result:

ok 2 number(s): "0 3"

Test #4:

score: 0
Accepted
time: 0ms
memory: 3676kb

input:

1 1 10
1

output:

0 0

result:

ok 2 number(s): "0 0"

Test #5:

score: 0
Accepted
time: 0ms
memory: 3668kb

input:

14 3 10
1 40 50

output:

2 2

result:

ok 2 number(s): "2 2"

Test #6:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

8 2 7
12 13

output:

6 2

result:

ok 2 number(s): "6 2"

Test #7:

score: 0
Accepted
time: 0ms
memory: 3668kb

input:

1 1 1
2

output:

0 1

result:

ok 2 number(s): "0 1"

Test #8:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

12 2 11
8 3

output:

6 2

result:

ok 2 number(s): "6 2"

Test #9:

score: -100
Wrong Answer
time: 0ms
memory: 3656kb

input:

2 2 12
24 1

output:

0 0

result:

wrong answer 2nd numbers differ - expected: '1', found: '0'