QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#708692#5674. Sum of Remaindersmgoldy925#Compile Error//Python3566b2024-11-04 03:42:482024-11-04 03:42:49

Judging History

你现在查看的是最新测评结果

  • [2024-11-04 03:42:49]
  • 评测
  • [2024-11-04 03:42:48]
  • 提交

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