結果
問題 | No.2203 POWER!!!!! |
ユーザー |
|
提出日時 | 2025-02-16 23:28:05 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 16 ms / 2,000 ms |
コード長 | 439 bytes |
コンパイル時間 | 1,402 ms |
コンパイル使用メモリ | 159,724 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-02-16 23:28:07 |
合計ジャッジ時間 | 2,423 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
コンパイルメッセージ
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+=1LL*sd*cnt[j];}}printf("%lld\n",ans);return 0;}