結果

問題 No.2187 三立法和 mod 333
ユーザー t98slidert98slider
提出日時 2023-01-13 23:37:59
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 72 ms / 100 ms
コード長 664 bytes
コンパイル時間 1,593 ms
コンパイル使用メモリ 170,180 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-26 05:13:21
合計ジャッジ時間 4,763 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
4,380 KB
testcase_01 AC 41 ms
4,380 KB
testcase_02 AC 27 ms
4,380 KB
testcase_03 AC 21 ms
4,376 KB
testcase_04 AC 20 ms
4,380 KB
testcase_05 AC 29 ms
4,380 KB
testcase_06 AC 41 ms
4,376 KB
testcase_07 AC 72 ms
4,376 KB
testcase_08 AC 69 ms
4,376 KB
testcase_09 AC 72 ms
4,380 KB
testcase_10 AC 42 ms
4,376 KB
testcase_11 AC 47 ms
4,376 KB
testcase_12 AC 57 ms
4,380 KB
testcase_13 AC 46 ms
4,380 KB
testcase_14 AC 29 ms
4,380 KB
testcase_15 AC 62 ms
4,376 KB
testcase_16 AC 41 ms
4,388 KB
testcase_17 AC 46 ms
4,380 KB
testcase_18 AC 21 ms
4,376 KB
testcase_19 AC 71 ms
4,376 KB
testcase_20 AC 62 ms
4,380 KB
testcase_21 AC 71 ms
4,376 KB
testcase_22 AC 63 ms
4,384 KB
testcase_23 AC 21 ms
4,376 KB
testcase_24 AC 69 ms
4,380 KB
testcase_25 AC 21 ms
4,380 KB
testcase_26 AC 21 ms
4,380 KB
testcase_27 AC 70 ms
4,380 KB
testcase_28 AC 30 ms
4,380 KB
testcase_29 AC 62 ms
4,380 KB
testcase_30 AC 27 ms
4,380 KB
testcase_31 AC 28 ms
4,376 KB
testcase_32 AC 62 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
    int A;
    cin >> A;
    A %= 333;
    ll ans = 0, lim = 4444ll * 4444 * 4444 * 4444;
    vector<vector<ll>> tb(333);
    for(ll i = 1; i < 4444; i++) tb[i * i * i % 333].push_back(i * i * i * i);
    for(int i = 0; i < 333; i++){
        for(int j = 0; j < 333; j++){
            int k = A - i - j;
            while(k < 0)k += 333;
            for(auto &&vi:tb[i]){
                for(auto &&vj:tb[j]){
                    ans += upper_bound(tb[k].begin(), tb[k].end(), lim - vi - vj) - tb[k].begin();
                }
            }
        }
    }
    cout << ans << '\n';
}
0