QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#708692 | #5674. Sum of Remainders | mgoldy925# | Compile Error | / | / | Python3 | 566b | 2024-11-04 03:42:48 | 2024-11-04 03:42:49 |
Judging History
answer
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;
vector<int>v;
int main(){
int n;
cin>>n;
v.clear();
int tmp;cin>>tmp;
for(int i=2;i<=n;++i){
int x;cin>>x;
for(int j=0;j<v.size();++j)x-=i%v[j];
int xxx=x/i;
for(int j=1;j<=tmp-xxx;++j)v.push_back(i);
tmp=xxx;
}
while(tmp>0)--tmp,v.push_back(n+1);
printf("%d",(int)v.size());
for(int i=0;i<v.size();++i)printf(" %d",v[i]);
return 0;
}
Details
File "answer.code", line 7 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax