Submission #71723

#TimeUsernameProblemLanguageResultExecution timeMemory
71723유애나 (#119)Angelic Hourglass (FXCUP3_hourglass)C++17
58 / 100
3 ms740 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n, dp[5001]; scanf("%d", &n); dp[0] = 0; dp[1] = dp[2] = dp[4] = 9999; dp[3] = 1; for(int i = 5; i <= n; i++) dp[i] = min(dp[i - 3], dp[i - 5]) + 1; printf("%d\n", dp[n] > n ? -1 : dp[n]); }

Compilation message (stderr)

hourglass.cpp: In function 'int main()':
hourglass.cpp:6:10: 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...