結果

問題 No.152 貯金箱の消失
ユーザー aaaaaaiuaaaaaaiu
提出日時 2019-08-24 19:07:37
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 12 ms / 5,000 ms
コード長 305 bytes
コンパイル時間 1,971 ms
コンパイル使用メモリ 193,220 KB
最終ジャッジ日時 2025-01-07 14:51:22
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int l;
    cin>>l;
    l/=4;
    int ans=0;
    for (int i=2;i*i<l;i++)
        for (int j=1+i%2;j<i&&2*i*j+2*i*i<=l;j+=2)
            if (gcd(i,j)==1)
                ans++;
    cout<<ans%1000003<<endl;
    return 0;
}
0