Submission #00164


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include<bits/stdc++.h>
#define FOR(i,n) for(int i=0;i<n;i++)
#define SFOR(i,a,b) for(int i=a;i<b;i++)
#define elif(a) else if(a)
#define INF INT_MAX
#define F first
#define S second
#define endl '\n'
using namespace std;
typedef long long ll;
typedef pair<int,int>P;
int n;
int d[1000006];
int cnt;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
cin>>n;
SFOR(i,2,n+1){
for(int j=i;j<=n;j+=i){
if(d[j]==1){
d[j]=0;
cnt--;
}else{
d[j]=1;
cnt++;
}
}
}
cout<<cnt<<endl;
return 0;
}

ステータス

項目 データ
問題 0008 - マリア・アントーニア・ヨーゼファ・ヨハンナ・フォン・ハプスブルク=ロートリンゲン (Maria Antonia Josepha Johanna von Habsburg-Lothringen)
ユーザー名 Zzz..ei1704..Zzz
投稿日時 2019-06-18 17:41:42
言語 C++14
状態 Accepted
得点 13
ソースコード長 593 Byte
最大実行時間 64 ms
最大メモリ使用量 4472 KB

セット

セット 得点 Cases
1 ALL 13 / 13 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in01 AC 19 ms 604 KB
1
in02 AC 20 ms 552 KB
1
in03 AC 25 ms 624 KB
1
in04 AC 23 ms 572 KB
1
in05 AC 26 ms 648 KB
1
in06 AC 20 ms 600 KB
1
in07 AC 29 ms 548 KB
1
in08 AC 20 ms 628 KB
1
in09 AC 20 ms 708 KB
1
in10 AC 15 ms 536 KB
1
in11 AC 22 ms 492 KB
1
in12 AC 16 ms 576 KB
1
in13 AC 25 ms 648 KB
1
in14 AC 24 ms 944 KB
1
in15 AC 64 ms 4472 KB
1
in16 AC 24 ms 524 KB
1
in17 AC 26 ms 724 KB
1
in18 AC 19 ms 536 KB
1