結果

問題 No.152 貯金箱の消失
ユーザー tottoripapertottoripaper
提出日時 2015-02-15 23:36:27
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 26 ms / 5,000 ms
コード長 343 bytes
コンパイル時間 370 ms
コンパイル使用メモリ 38,604 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-06 01:20:30
合計ジャッジ時間 1,330 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
4,376 KB
testcase_01 AC 11 ms
4,380 KB
testcase_02 AC 11 ms
4,376 KB
testcase_03 AC 11 ms
4,376 KB
testcase_04 AC 11 ms
4,380 KB
testcase_05 AC 11 ms
4,380 KB
testcase_06 AC 11 ms
4,376 KB
testcase_07 AC 13 ms
4,380 KB
testcase_08 AC 25 ms
4,376 KB
testcase_09 AC 26 ms
4,380 KB
testcase_10 AC 22 ms
4,376 KB
testcase_11 AC 17 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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