結果

問題 No.152 貯金箱の消失
コンテスト
ユーザー tottoripaper
提出日時 2015-02-15 23:36:27
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 11 ms / 5,000 ms
コード長 343 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 427 ms
コンパイル使用メモリ 51,732 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2026-03-09 03:39:15
合計ジャッジ時間 1,156 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <cstdio>
#include <algorithm>

int main(){
    int L;
    scanf("%d", &L);

    int res = 0;
    for(int s=1;s<=10000;s+=2){
        for(int t=1;t<s;t+=2){
            if(4 * s * (s + t) > L){continue;}
            if(std::__gcd(s, t) != 1){continue;}
            res = (res + 1) % 1000003;
        }
    }

    printf("%d\n", res);
}
0