結果

問題 No.2610 Decreasing LCMs
ユーザー planesplanes
提出日時 2024-01-19 23:14:36
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 790 bytes
コンパイル時間 1,687 ms
コンパイル使用メモリ 169,708 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-01-19 23:14:40
合計ジャッジ時間 2,884 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
testcase_13 AC 2 ms
6,676 KB
testcase_14 AC 2 ms
6,676 KB
testcase_15 AC 2 ms
6,676 KB
testcase_16 AC 2 ms
6,676 KB
testcase_17 AC 2 ms
6,676 KB
testcase_18 AC 2 ms
6,676 KB
testcase_19 AC 2 ms
6,676 KB
testcase_20 AC 3 ms
6,676 KB
testcase_21 AC 2 ms
6,676 KB
testcase_22 AC 2 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

  #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;
  
 
}




0