結果

問題 No.2187 三立法和 mod 333
ユーザー t98slidert98slider
提出日時 2023-01-13 23:34:16
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 688 bytes
コンパイル時間 1,520 ms
コンパイル使用メモリ 169,560 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-26 05:11:15
合計ジャッジ時間 5,704 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 57 ms
4,376 KB
testcase_02 AC 38 ms
4,380 KB
testcase_03 AC 28 ms
4,380 KB
testcase_04 AC 28 ms
4,380 KB
testcase_05 AC 40 ms
4,376 KB
testcase_06 AC 57 ms
4,380 KB
testcase_07 TLE -
testcase_08 AC 97 ms
4,376 KB
testcase_09 TLE -
testcase_10 AC 57 ms
4,380 KB
testcase_11 AC 64 ms
4,380 KB
testcase_12 AC 76 ms
4,380 KB
testcase_13 AC 65 ms
4,376 KB
testcase_14 AC 40 ms
4,376 KB
testcase_15 AC 87 ms
4,380 KB
testcase_16 AC 57 ms
4,380 KB
testcase_17 AC 64 ms
4,380 KB
testcase_18 AC 28 ms
4,380 KB
testcase_19 TLE -
testcase_20 AC 87 ms
4,380 KB
testcase_21 TLE -
testcase_22 AC 88 ms
4,384 KB
testcase_23 AC 28 ms
4,384 KB
testcase_24 AC 97 ms
4,376 KB
testcase_25 AC 28 ms
4,376 KB
testcase_26 AC 28 ms
4,380 KB
testcase_27 AC 97 ms
4,380 KB
testcase_28 AC 40 ms
4,376 KB
testcase_29 AC 86 ms
4,380 KB
testcase_30 AC 37 ms
4,376 KB
testcase_31 AC 37 ms
4,376 KB
testcase_32 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
    int A;
    cin >> A;
    ll ans = 0, lim = 4444ll * 4444 * 4444 * 4444;
    vector<vector<ll>> tb(333);
    for(ll i = 1; i <= 4444; i++){
        ll rem = i * i * i % 333;
        tb[rem].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