Submission #1074675

# Submission time Handle Problem Language Result Execution time Memory
1074675 2024-08-25T12:22:29 Z AdrianSoh Snail (NOI18_snail) C++14
0 / 100
2 ms 604 KB
#include <bits/stdc++.h>
#define intt long long
using namespace std;

int main(){
	intt h,p;cin >> h >> p;
	vector <intt> vec(p);
	intt total = 0;
	for(intt i=0;i<p;i++){
		cin >> vec[i];
		total+=vec[i];
	}
	intt maxv = *max_element(vec.begin(),vec.end());
	intt maxi = 0;
	for(intt i=0;i<vec.size();i++){
		if(vec[i] == maxv){
			maxi = i;break;
		}
	}
	if(h/total-1<0){
		cout << -1 << " " << -1;
	}else{
		cout << h/total-1 << " " << maxi;
	}
}

Compilation message

snail.cpp: In function 'int main()':
snail.cpp:15:16: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |  for(intt i=0;i<vec.size();i++){
      |               ~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 604 KB Execution killed with signal 8
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 604 KB Execution killed with signal 8
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -