Submission #147615

#TimeUsernameProblemLanguageResultExecution timeMemory
147615yoniAngelic Hourglass (FXCUP3_hourglass)C++11
100 / 100
2 ms420 KiB
#include <iostream> int main() { int N; scanf("%d", &N); int cnt5 = N/5; int ans = N==7?4:-1; N -= cnt5*5; while (cnt5 >= 0) { if (N % 3 == 0) { ans = cnt5 + N/3; break; } cnt5--; N += 5; } printf("%d", ans); 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...