結果

問題 No.2177 Recurring ab
ユーザー _yurimoir
提出日時 2023-01-06 22:31:21
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 545 bytes
コンパイル時間 2,946 ms
コンパイル使用メモリ 243,180 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-30 18:54:00
合計ジャッジ時間 3,618 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 11 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main(){
    double n;
    cin>>n;
    int ans=0;
    for(int i=0;i<10;i++){
        for(int j=0;j<10;j++){
            if(i==j)continue;
            int limit=max(i,j);
            double p1,p2;
            p1=(n*i+sqrt(n*n*i*i+4*(1+n*j)))/2.0;
            p2=(n*i-sqrt(n*n*i*i+4*(1+n*j)))/2.0;
            int x1,x2;
            x1=(int)p1;
            x2=-(int)(-p2);
            if(x1<limit)continue;
            ans+=x1-limit;
        }
    }
    cout<<ans<<endl;
}
0