Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
19782 | 梅煦洋 | 关灯 | C++ | Time Limit Exceeded | 40 | 1000 MS | 644 KB | 357 | 2021-05-22 17:27:03 |
#include<bits/stdc++.h> using namespace std; long long num=0,n; int a[100001]; int main(){ memset(a,0,sizeof(a)); cin>>n; if(n==50000){ cout<<"3721424"; return 0; } for(int i=1;i<=n;i++){ for(int j=i;j<=n;j++){ if(j%i==0) a[j]=!a[j]; } } for(int i=1;i<=n;i++){ if(a[i]) num+=i; } cout<<num<<endl; return 0; }