結果
| 問題 |
No.2203 POWER!!!!!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-02-16 23:27:14 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 435 bytes |
| コンパイル時間 | 1,614 ms |
| コンパイル使用メモリ | 160,608 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2025-02-16 23:27:17 |
| 合計ジャッジ時間 | 2,953 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 WA * 10 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | scanf("%d",&n);
| ~~~~~^~~~~~~~~
main.cpp:16:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
16 | scanf("%d",&a[i]);
| ~~~~~^~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF=0x3f3f3f3f;
const int mod=1e9+7;
const int MAX=2e5+10;
int a[MAX];
int main()
{
int n,i,j,cnt[11],sd;
ll ans;
scanf("%d",&n);
memset(cnt,0,sizeof cnt);
for(i=1;i<=n;i++)
{
scanf("%d",&a[i]);
cnt[a[i]]++;
}
ans=0;
for(i=1;i<=n;i++)
{
sd=1;
for(j=1;j<=8;j++)
{
sd*=a[i];
ans+=sd*cnt[j];
}
}
printf("%lld\n",ans);
return 0;
}