Submission #917334

#TimeUsernameProblemLanguageResultExecution timeMemory
917334rainboy방 배정하기 (KOI17_room)C++17
100 / 100
1 ms600 KiB
#include <stdio.h> int main() { int a, b, c, n, k, l, m; scanf("%d%d%d%d", &a, &b, &c, &n); for (k = 0; a * k <= n; k++) for (l = 0; (m = a * k + b * l) <= n; l++) if ((n - m) % c == 0) { printf("1\n"); return 0; } printf("0\n"); return 0; }

Compilation message (stderr)

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