結果

問題 No.2253 Ignore Subtle Differences
ユーザー HIcoderHIcoder
提出日時 2023-07-08 20:05:22
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 961 bytes
コンパイル時間 831 ms
コンパイル使用メモリ 104,436 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-09-29 21:39:42
合計ジャッジ時間 1,699 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<set>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<map>
#include<numeric>
#include<queue>
#include<cmath>
using namespace std;
typedef long long ll;
const ll INF=1LL<<60;
typedef pair<ll,ll> P;
typedef pair<int,P> PP;
const ll MOD=998244353;
const double PI=acos(-1);


int main(){
    ll ans=0;
    vector<ll> b(100000,0);

    vector<pair<ll,ll>> ansxy(3);
    b[0]=0,b[1]=1;
    for(int i=2;;i++){
        b[i]=4*b[i-1]-b[i-2];

        ll canda=b[i];
        ll candb=b[i-1];

        if(canda>=1e9 || candb>=1e9)break;

        if(canda>0 && candb>0){
            ll S= (canda+candb)*abs(canda-candb);
            if(S>1e16){
                ans=max(ans,S);

                ansxy[0]=make_pair(0,0);
                ansxy[1]=make_pair(canda,candb);
                ansxy[2]=make_pair(candb,canda);


            }
        }
    }

    for(auto [x,y]:ansxy){
        cout<<x<<' '<<y<<endl;
    }

}
0