QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#432848 | #6712. Sum of Factorials | surenjamts# | Compile Error | / | / | C++14 | 614b | 2024-06-07 18:55:35 | 2024-06-07 18:55:37 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
bool ans[N+5];
int main(){
int fact[20];
fact[0] = 1;
for (int i = 1; i<=11; i++){
fact[i] = fact[i-1] * i;
}
ans[0] = true;
ans[1] = true;
for(int k = 1; k<=11; k++){
for(int i = N; i>=0; i--){
if(ans[i]) {
if(i + fact[k] > N) continue;
ans[i + fact[k]] = true;
}
}
}
int A = 0;
while() {
cin >> A;
if( A == -1) break;
if(ans[A]) cout << "YES\n";
else cout << "NO\n";
}
}
Details
answer.code: In function ‘int main()’: answer.code:27:15: error: expected primary-expression before ‘)’ token 27 | while() { | ^