QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#387903#8284. Cats and FishKLPP#WA 0ms3672kbC++14832b2024-04-12 23:52:552024-04-12 23:52:55

Judging History

This is the latest submission verdict.

  • [2024-04-12 23:52:55]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3672kb
  • [2024-04-12 23:52:55]
  • Submitted

answer

#include <bits/stdc++.h>
using namespace std;

#define rep(i,a,b) for (int i=a; i<b; i++)
#define trav(a,b) for (auto a:b)
#define all(x) begin(x),end(x)
#define lld long long

void solve() {
	int fish, cat, max_time;
	cin >> fish >> cat >> max_time;
	vector<int> takes(cat);
	for (int i = 0; i < cat; i++) cin >> takes[i];
	//int current_time = 0;
	

	sort(all(takes));

	int incomplete=0;
	for(int i=0;i<cat;i++){

	     int caneat=max_time/takes[i];

	     int eatennow=min(fish,caneat);
	     fish-=eatennow;


	     if(fish==0)continue;

	     if(max_time%takes[i]!=0){
		  incomplete++;
		  fish--;
	     }
	     
	}

	cout<<fish<<' '<<incomplete<<'\n';
	
}

signed main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int tt = 1;
	//cin >> tt;
	while (tt--) solve();
	return 0; 
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3568kb

input:

2 1 1
1

output:

1 0

result:

ok 2 number(s): "1 0"

Test #2:

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

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: 3576kb

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: 3640kb

input:

1 1 10
1

output:

0 0

result:

ok 2 number(s): "0 0"

Test #5:

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

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: 3572kb

input:

8 2 7
12 13

output:

6 2

result:

ok 2 number(s): "6 2"

Test #7:

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

input:

1 1 1
2

output:

0 1

result:

ok 2 number(s): "0 1"

Test #8:

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

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: 3580kb

input:

2 2 12
24 1

output:

0 0

result:

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