提出 #510255
ソースコード 拡げる
#include <iostream>
using namespace std;
typedef long long ll;
int main() {
int n;
int seq[ 31 ];
ll pow2[ 31 ];
ll sum = 0;
cin >> n;
pow2[ 0 ] = 1;
for( int i = 1; i < 31; i++ ) {
pow2[ i ] = pow2[ i - 1 ] * 2;
}
for( int i = 0; i < n; i++ ) {
cin >> seq[ i ];
sum += seq[ i ] * pow2[ n - 1 - i ];
}
cout << sum << endl;
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - とても長い数列 |
| ユーザ | rmn_31415 |
| 言語 | C++ (GCC 4.9.2) |
| 得点 | 100 |
| コード長 | 399 Byte |
| 結果 | AC |
| 実行時間 | 26 ms |
| メモリ | 928 KiB |
ジャッジ結果
| セット名 | Sample | DataSet1 | DataSet2 | ||||||
|---|---|---|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 60 / 60 | 40 / 40 | ||||||
| 結果 |
|
|
|
| セット名 | テストケース |
|---|---|
| Sample | sample-01.txt, sample-02.txt, sample-03.txt |
| DataSet1 | sample-01, sample-02, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt |
| DataSet2 | sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, 02-08.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 01-01.txt | AC | 23 ms | 800 KiB |
| 01-02.txt | AC | 23 ms | 924 KiB |
| 01-03.txt | AC | 23 ms | 804 KiB |
| 01-04.txt | AC | 23 ms | 796 KiB |
| 01-05.txt | AC | 23 ms | 796 KiB |
| 01-06.txt | AC | 23 ms | 676 KiB |
| 01-07.txt | AC | 23 ms | 804 KiB |
| 01-08.txt | AC | 22 ms | 928 KiB |
| 02-01.txt | AC | 23 ms | 800 KiB |
| 02-02.txt | AC | 23 ms | 672 KiB |
| 02-03.txt | AC | 22 ms | 796 KiB |
| 02-04.txt | AC | 26 ms | 728 KiB |
| 02-05.txt | AC | 22 ms | 924 KiB |
| 02-06.txt | AC | 22 ms | 800 KiB |
| 02-07.txt | AC | 23 ms | 672 KiB |
| 02-08.txt | AC | 23 ms | 672 KiB |
| sample-01.txt | AC | 23 ms | 928 KiB |
| sample-02.txt | AC | 22 ms | 924 KiB |
| sample-03.txt | AC | 22 ms | 796 KiB |