結果
| 問題 | No.407 鴨等素数間隔列の数え上げ |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-07-28 13:52:08 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 338 bytes |
| 記録 | |
| コンパイル時間 | 2,024 ms |
| コンパイル使用メモリ | 336,968 KB |
| 実行使用メモリ | 45,312 KB |
| 最終ジャッジ日時 | 2026-07-13 15:00:07 |
| 合計ジャッジ時間 | 5,197 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 TLE * 1 -- * 1 |
| other | -- * 31 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,l,ans=0;
map<int,bool> prm;
signed main()
{
scanf("%lld %lld",&n,&l);
for(int i=2; i<=l; i++)
{
if(prm[i])
continue;
for(int j=i; j<=l; j+=i)
prm[j]=false;
ll fst=l-i*(n-1)+1;
if(fst<=0)
break;
ans+=fst;
}
printf("%lld\n",ans);
return 0;
}
vjudge1