結果

問題 No.2260 Adic Sum
ユーザー karinohitokarinohito
提出日時 2023-03-15 00:37:21
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 616 bytes
コンパイル時間 4,713 ms
コンパイル使用メモリ 253,320 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-04-15 23:30:34
合計ジャッジ時間 9,324 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,624 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 9 ms
5,376 KB
testcase_09 AC 3 ms
5,376 KB
testcase_10 AC 8 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 8 ms
5,376 KB
testcase_13 AC 21 ms
5,376 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
#define all(A) A.begin(),A.end()
#define rep(i, n) for (ll i = 0; i < (ll) (n); i++)

int main() {
    int N,P;
    cin>>N>>P;
    vector<int> A(N);
    for(int i=0;i<N;i++)cin>>A[i];

    long long an=0;
    for(int i=0;i<N;i++){
        for(int j=0;j<i;j++){
            int d=abs(A[i]-A[j]);
            while(d%P==0){
                an++;
                d/=P;
            }
        }
    }
    cout<<an<<endl;
    
}
0