Submission #1062950

# Submission time Handle Problem Language Result Execution time Memory
1062950 2024-08-17T12:23:17 Z jundi Snail (NOI18_snail) C++17
0 / 100
2 ms 348 KB
#include <bits/stdc++.h>
using namespace std;

int main(){
	double h;
	int n;
	cin>>h>>n;
	vector<double> a(n);
	double maxx=0;
	double one=0;
	for(int i=0;i<n;i++){
		cin>>a[i];
		maxx=max(maxx,a[i]);
		one+=a[i];
	}
	int day=ceil((h-maxx)/one);
	h-=(one*day);
	int re=0;
	for(int i=0;i<n;i++){
		re+=a[i];
		if(re>=h){cout<<day<<" "<<i; return 0;}
	}
	cout<<-1<<" "<<-1;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Incorrect 2 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -