結果
問題 | No.1351 Sum of GCD Equals LCM |
ユーザー |
![]() |
提出日時 | 2021-01-17 14:48:00 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 1,536 bytes |
コンパイル時間 | 2,023 ms |
コンパイル使用メモリ | 190,788 KB |
最終ジャッジ日時 | 2025-01-18 00:58:16 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 50 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i,n) for(ll i=0;i<(ll)(n);i++) #define rep1(i,n) for(ll i=1;i<=(ll)(n);i++) #define LOCAL 1; #ifdef LOCAL #define dbg(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl #else #define dbg(x) true #endif template<typename T> ostream& operator<< (ostream& out, const vector<T>& v) { out << "["; size_t last = v.size() - 1; for (size_t i = 0; i < v.size(); ++i) { out << v[i]; if (i != last) out << ", "; } out << "]"; return out; } template<typename F, typename S> ostream& operator<< (ostream& out, const pair<F,S>& p) { out << "[" << p.first << ", " << p.second << "]"; return out; } int main(){ ios::sync_with_stdio(false); cin.tie(0); ll n; cin >> n; // mt19937 rng((unsigned int) chrono::steady_clock::now().time_since_epoch().count()); // uniform_int_distribution<int> dist_a(1, 100); // while(1){ // set<ll> st; // while(st.size()!=n){ // st.insert(dist_a(rng)); // } // vector<ll> a; // // for(auto j:st){ // // a.push_back(j); // // } // ll c = 1; // rep(i,n){ // a.push_back(c); // c*=2; // } // ll lcm = 1; // ll ans = 0; // rep(i,n){ // ans += gcd(a[i],a[(i+1)%n]); // lcm *= a[i]; // if(i>0) lcm /= gcd(a[i],a[i-1]); // } // if(ans==lcm){ // dbg(a); // dbg(lcm); // } // } ll c=1; rep(i,n) { cout << c <<" \n"[i==n-1]; c*=2; } return 0; }