結果
| 問題 |
No.2610 Decreasing LCMs
|
| コンテスト | |
| ユーザー |
planes
|
| 提出日時 | 2024-01-19 23:14:36 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 790 bytes |
| コンパイル時間 | 1,777 ms |
| コンパイル使用メモリ | 169,212 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-28 05:04:31 |
| 合計ジャッジ時間 | 2,451 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 22 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
ll INF=2e18;
long long gcd(long long a, long long b) {
if (b == 0) {
return a;
} else {
return gcd(b, a % b);
}
}
long long lcm(long long a, long long b) {
long long d = gcd(a, b);
return a / d * b;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll N;cin>>N;
vector<ll> ans(N);
ans[N-1]=(1LL<<26);
if(N>=2) {
ans[N-2]=(1LL<<25);
}
if(N>=3) {
ans[N-3]=(1LL<<23)*3;
}
ll a=3;
ll b=4;
for(ll i=N-4;i>=0;i--) {
ll x=b+1;
ll y=a*2;
ans[i]=ans[i+1]*x/y;
a=x,b=y;
}
for(auto x:ans) cout<<x<<" ";
cout<<endl;
}
planes