Submission #159748

#TimeUsernameProblemLanguageResultExecution timeMemory
159748geon040702방 배정하기 (KOI17_room)C++14
100 / 100
2 ms428 KiB
#include <bits/stdc++.h> using namespace std; int student; int a, b, c; int main(void) { int i, j, k, res=0; scanf("%d%d%d%d", &a, &b, &c, &student); for(i=0;i<=student/a;i++) { for(j=0;j<=student/b;j++) { for(k=0;k<=student/c;k++) { if(student == (a*i)+(b*j)+(c*k)) { res = 1; } } } } printf("%d\n", res); return 0; }

Compilation message (stderr)

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