結果

問題 No.2610 Decreasing LCMs
ユーザー tanaka255tanaka255
提出日時 2024-01-19 23:40:58
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 570 bytes
コンパイル時間 1,953 ms
コンパイル使用メモリ 204,476 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-01-19 23:41:02
合計ジャッジ時間 3,174 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 1 ms
6,676 KB
testcase_03 AC 1 ms
6,676 KB
testcase_04 AC 1 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 1 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 1 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 1 ms
6,676 KB
testcase_19 AC 2 ms
6,676 KB
testcase_20 AC 1 ms
6,676 KB
testcase_21 AC 1 ms
6,676 KB
testcase_22 AC 2 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int N;
using ll=long long;
bool ok(vector<int>a){
  for(int i=0;i<N-1;++i){
    if(a[i]<a[i+1])continue;
    return 0;
  }
  for(int i=0;i<N-2;++i){
    if(lcm((ll)a[i],(ll)a[i+1])>lcm((ll)a[i+1],(ll)a[i+2]))continue;
    return 0;
  }
  return 1;
}
void solve();
int main(){
  cin>>N;
  vector<int>a={3,4,8};
  for(int i=3;i<N;++i){
    vector<int>na(i+1);
    for(int j=0;j<i;++j){
      na[j+1]=a[j]*2;
    }
    na[0]=na[1]-1;
    swap(a,na);
  }
  for(int i=0;i<N;++i)cout<<a[i]<<" \n"[i+1==N];
  //cout<<ok(a)<<endl;;
}
0