結果
| 問題 |
No.3383 1122-like Number (C++)
|
| コンテスト | |
| ユーザー |
Rho
|
| 提出日時 | 2025-11-21 23:54:20 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 74 ms / 2,000 ms |
| コード長 | 344 bytes |
| コンパイル時間 | 1,826 ms |
| コンパイル使用メモリ | 198,004 KB |
| 実行使用メモリ | 16,796 KB |
| 最終ジャッジ日時 | 2025-11-22 12:39:39 |
| 合計ジャッジ時間 | 3,695 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 |
ソースコード
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
vector<int>sieve;
int main(){
int n;
cin>>n;
sieve.resize(n+1);
for(int i=2;i<=n;i++){
if(!sieve[i]){
for(int j=i*2;j<=n;j+=i){
sieve[j]++;
if(j%(i*i)==0)sieve[j]+=1e5;
}
}
}
int a=count(sieve.begin(),sieve.end(),4);
cout<<a<<endl;
}
Rho