結果
| 問題 |
No.2938 Sigma Sigma Distance Distance Problem
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-18 21:24:52 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 897 bytes |
| コンパイル時間 | 3,507 ms |
| コンパイル使用メモリ | 274,980 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-18 21:50:38 |
| 合計ジャッジ時間 | 4,694 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 39 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int long long
using vi=vector<int>;
using vvi=vector<vector<int>>;
using vvvi=vector<vector<vector<int>>>;
using vs=vector<string>;
using mai=map<int,int>;
using sei=set<int>;
using sti=stack<int>;
using qui=queue<int>;
#define rep(i,x) for(int i=0;i<(int)x;i++)
#define rept(i,a,b) for(int i=(int)a;i<(int)b;i++)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
const double PI=3.141592653589793;
const int INF=1LL<<60;
template<typename T> void printv(vector<T> x){rep(i,x.size())cout<<(i!=0?" ":"")<<x[i];cout<<'\n';}
template<typename T> void printvv(vector<vector<T>> x){rep(i,x.size())printv(x[i]);}
signed main(){
int n;cin>>n;
if(n>100) return 0;
vi a(n);
rep(i,n){
cin>>a[i];
if(a[i]>100) return 0;
}
int ans=0;
rep(i,n) rep(j,n) ans+=abs(i-j)*abs(a[i]-a[j]);
}