| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1365808 | afterzero | Snail (NOI18_snail) | C++20 | 1 ms | 344 KiB |
#include<bits/stdc++.h>
using namespace std ;
int main(){
long long h , n ;
cin >> h>> n ;
vector<long long>a(n);
long long sum = 0 ;
for(int i = 0 ; i< n ; i++){
cin >> a[i];
sum+=a[i];
}
if(a[0]<=0){
cout << -1 << " " << -1 << endl;
return 0 ;
}
if(sum>h){ cout << "0 " ;
if(h%a[0]==0){
cout << (h/a[0])-1;
}else{
cout << int(h/a[0]);
}
}
else{
if(h%sum==0){
cout << (h/sum)-1 << " " ;
if(h%a[0]==0){
cout << ((h/a[0])-1)%n;
}else{
cout << (int(h/a[0]))%n;
}
}else{
cout << int(h/sum)<< " ";
if(h%a[0]==0){
cout << ((h/a[0])-1)%n;
}else{
cout << (int(h/a[0]))%n;
}
}
}
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
