結果
| 問題 |
No.2260 Adic Sum
|
| コンテスト | |
| ユーザー |
publfl2
|
| 提出日時 | 2023-04-07 21:26:06 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1,077 ms / 2,000 ms |
| コード長 | 353 bytes |
| コンパイル時間 | 568 ms |
| コンパイル使用メモリ | 54,016 KB |
| 実行使用メモリ | 8,448 KB |
| 最終ジャッジ日時 | 2024-10-06 06:56:33 |
| 合計ジャッジ時間 | 7,689 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 |
ソースコード
#include <stdio.h>
#include <map>
std::map<int,int> M;
int x[100010];
int main()
{
int a;
long long int b;
scanf("%d%lld",&a,&b);
for(int i=1;i<=a;i++) scanf("%d",&x[i]);
long long int p = b, ans = 0;
while(p<=1000000000)
{
M.clear();
for(int i=1;i<=a;i++)
{
M[x[i]%p]++;
ans += (M[x[i]%p]-1);
}
p*=b;
}
printf("%lld",ans);
}
publfl2