結果
| 問題 |
No.407 鴨等素数間隔列の数え上げ
|
| コンテスト | |
| ユーザー |
RIGIH
|
| 提出日時 | 2017-06-27 01:52:58 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 451 bytes |
| コンパイル時間 | 522 ms |
| コンパイル使用メモリ | 58,836 KB |
| 実行使用メモリ | 10,496 KB |
| 最終ジャッジ日時 | 2024-10-04 10:02:14 |
| 合計ジャッジ時間 | 4,915 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 19 TLE * 2 -- * 10 |
ソースコード
#include<stdio.h>
#include <iostream>
#include <cstring>
#include <math.h>
using namespace std;
long long sosu(long long);
int main(){
long long n,a;
cin>>n>>a;
long long m=0;
int x=a/(n-1);
for(long long d=2 ; d <= x ; d++){
if(sosu(d)==1){
m+=+a-(n-1)*d+1;
}
}
cout<<m<<endl;
return 0;
}
long long sosu(long long n){
if (n==1) return 0;
long long i;
for(i=2;i*i<=n;i++) if(n%i==0) return 0;
return 1;
}
RIGIH