Submission #147611

#TimeUsernameProblemLanguageResultExecution timeMemory
147611yoniAngelic Hourglass (FXCUP3_hourglass)C++11
58 / 100
2 ms396 KiB
#include <iostream> int main() { int N; scanf("%d", &N); int cnt5 = N/5; N -= cnt5 * 5; int cnt3 = -1; while (cnt5 >= 0) { if (N % 3 == 0) { cnt3 = N / 3; break; } cnt5--; N += 5; } printf("%d", cnt3==-1?-1:cnt3+cnt5); return 0; }

Compilation message (stderr)

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