結果
問題 | No.2203 POWER!!!!! |
ユーザー | |
提出日時 | 2023-02-03 21:42:23 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 34 ms / 2,000 ms |
コード長 | 2,370 bytes |
コンパイル時間 | 3,267 ms |
コンパイル使用メモリ | 252,808 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-02 19:32:39 |
合計ジャッジ時間 | 4,628 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ull = uint64_t; using ll = int64_t; using vi = vector<int>; using vll = vector<ll>; using vs = vector<string>; using ld = long double; using P = pair<ll,ll>; using G = vector<vector<int>>; #define LO(...) (void)0 #define debug(x) (void)0 #define reps(i,a,n) for(ll i##_len = (ll)(n), i = (a); i < i##_len; ++i) #define rep(i,n) reps(i,0,(n)) #define rrep(i,n) reps(i,1,(n)+1) #define repd(i,n) for(ll i=(n)-1;i>=0;i--) #define rrepd(i,n) for(ll i=(n);i>=1;i--) #define inp(i) ll i; cin >> i; #define inps(s) string s; cin >> s; #define inpp(p) cin >> (p).first >> (p).second #define inpv(v,N) vll v(N);rep(i,N)cin>>v[i]; #define inpvs(v,N) vs v(N);rep(i,N)cin>>v[i]; #define all(v) begin(v),end(v) #define Yes cout<<"Yes\n" #define No cout<<"No\n" #define allok(i,N,pred) [&]()->bool{bool allok_=1;rep(i,N)if(!(pred))allok_=0;return allok_;}() #define anyok(i,N,pred) [&]()->bool{bool anyok_=0;rep(i,N)if(pred)anyok_=1;return anyok_;}() void YESNO(bool b){cout<<(b?"YES\n":"NO\n");}void yesno(bool b){cout<<(b?"yes\n":"no\n");}void YesNo(bool b){cout<<(b?"Yes\n":"No\n");} #define SP cout << " " #define ENDL cout << "\n" #define setfp cout << fixed << setprecision(16) template<typename C>void ou(const C&v){cout<<v;} template<typename C>void ous(const C&v){cout<<v<<" ";} template<typename C>void oul(const C&v){cout<<v<<"\n";} template<typename C>void ouv(const C &v){for(auto &&e:v){cout << e;if(&e != &v.back()) cout << ' ';}cout << "\n";} template<typename C>void ouvadd(const C &v){for(auto &&e:v){cout << e+1;if(&e != &v.back()) cout << ' ';}cout << "\n";} template<typename T>bool chmax(T &a, const T &b){return a<b?(a=b,1):0;} template<typename T>bool chmin(T &a, const T &b){return b<a?(a=b,1):0;} template<typename T>void so(T &a){sort(begin(a),end(a));} template<typename T,typename C>void so(T &a,C c){sort(begin(a),end(a),c);} template<typename T>void rso(T &a){sort(rbegin(a),rend(a));} template<typename T,typename C>void rso(T &a,C c){sort(rbegin(a),rend(a),c);} constexpr ll INF = 1e18; ll ipow(ll a, ll b){ ll r = 1; rep(i,b){ r *= a; } return r; } int main() { inp(N); inpv(a,N); map<ll,ll> s; rep(i,N)s[a[i]]++; ll ans = 0; rep(i,8){ rep(j,8){ ans += ipow(i+1,j+1) * s[i+1] * s[j+1]; } } oul(ans); }