QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#336811 | #8284. Cats and Fish | ucup-team1516# | WA | 0ms | 3676kb | C++20 | 1.0kb | 2024-02-24 21:40:12 | 2024-02-24 21:40:13 |
Judging History
answer
#include <string.h>
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int m,n,x;
cin >> m >> n >> x;
vector<int>c(n);
int c1 = 0,c2 = 0;
for(int i = 0; i < n; i++) {
cin >> c[i];
c2 += x/c[i];
c1 += (x-1)/c[i];
}
if(c2 >= m) {
cout << 0 << " " << 0 << "\n";
}
else {
int res = n-(c2-c1);
cout << max(0,m-c2-res) << " " << min(m-c2,res) << "\n";
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3672kb
input:
2 1 1 1
output:
1 0
result:
ok 2 number(s): "1 0"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3528kb
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: 3588kb
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: 3528kb
input:
1 1 10 1
output:
0 0
result:
ok 2 number(s): "0 0"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3676kb
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: 3584kb
input:
8 2 7 12 13
output:
6 2
result:
ok 2 number(s): "6 2"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
1 1 1 2
output:
0 1
result:
ok 2 number(s): "0 1"
Test #8:
score: 0
Accepted
time: 0ms
memory: 3580kb
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: 3576kb
input:
2 2 12 24 1
output:
0 0
result:
wrong answer 2nd numbers differ - expected: '1', found: '0'