# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
71669 | team (#119) | Angelic Hourglass (FXCUP3_hourglass) | C++98 | 3 ms | 624 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define INF 100000000
using namespace std;
int main(){
int n;scanf("%d",&n);
int ans=INF;
int i=0;
while(1){
if((5*i)>n) break;
if(!((n-5*i)%3)){
ans=min(ans,i+(n-5*i)/3);
}
i++;
}
i=0;
while(1){
if((5*i)>n-7) break;
if(!((n-7-5*i)%3)){
ans=min(ans,i+(n-7-5*i)/3+4);
}
i++;
}
if(ans>=INF) ans=-1;
printf("%d\n",ans);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |