Submission #71669

#TimeUsernameProblemLanguageResultExecution timeMemory
71669team (#119)Angelic Hourglass (FXCUP3_hourglass)C++98
100 / 100
3 ms624 KiB
#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)

hourglass.cpp: In function 'int main()':
hourglass.cpp:5:16: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     int n;scanf("%d",&n);
           ~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...