結果
問題 |
No.929 よくあるボールを移動するやつ
|
ユーザー |
|
提出日時 | 2019-11-23 00:57:16 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 406 bytes |
コンパイル時間 | 795 ms |
コンパイル使用メモリ | 91,872 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-11 06:38:58 |
合計ジャッジ時間 | 1,505 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 9 WA * 3 |
ソースコード
#include<iostream> #include<algorithm> #include<cmath> #include<iomanip> #include<set> #include<map> #include<queue> #include<vector> using namespace std; typedef long long ll; const int MOD=1e9+7; int main() { cin.tie(0),cout.tie(0); ios::sync_with_stdio(false); int n,b,ans=0,cnt=0; cin >> n; for(int i=1; i<=n; i++) { cin >> b; cnt+=b; ans+=abs(cnt-i); } cout << ans << endl; }