結果

問題 No.1318 ABCD quadruplets
ユーザー penguinmanpenguinman
提出日時 2020-12-15 06:15:20
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 919 bytes
コンパイル時間 2,077 ms
コンパイル使用メモリ 205,208 KB
実行使用メモリ 8,416 KB
最終ジャッジ日時 2023-10-20 05:44:16
合計ジャッジ時間 11,843 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 65 ms
4,348 KB
testcase_14 AC 1,111 ms
4,348 KB
testcase_15 AC 8 ms
4,352 KB
testcase_16 TLE -
testcase_17 AC 25 ms
4,352 KB
testcase_18 AC 985 ms
4,352 KB
testcase_19 AC 279 ms
4,352 KB
testcase_20 AC 51 ms
4,352 KB
testcase_21 AC 249 ms
4,352 KB
testcase_22 AC 16 ms
4,352 KB
testcase_23 TLE -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define endl "\n"
using std::cin;
using std::cout;
int main(){
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    int N,M; cin>>N>>M;
    std::vector<int> ans(N+1);
    REP(i,0,M){
        int sum=i*i;
        REP(j,0,M){
            int sum2=sum+(i+j)*j;
            if(sum2>N) continue;
            REP(k,0,M){
                int sum3=sum2+(i+j+k)*k;
                if(sum3>N) continue;
                REP(l,0,M){
                    int sum4=sum3+(i+j+k+l)*l;
                    if(sum4>N) continue;
                    ans[sum4]++;
                }
            }
        }
    }
    REP(i,0,N) cout<<ans[i]<<endl;
}
0