結果

問題 No.633 バスの運賃
ユーザー 007p99lupin007p99lupin
提出日時 2018-04-02 16:05:59
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 386 bytes
コンパイル時間 1,225 ms
コンパイル使用メモリ 144,856 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-08 13:25:31
合計ジャッジ時間 1,999 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 RE -
testcase_03 RE -
testcase_04 WA -
testcase_05 AC 1 ms
4,380 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(int argc, char const* argv[])
{
	int n;
	cin>>n;
	vector<int> a(n),b(n),c(n);
	int ans=0;
	int zyoukyaku=0;
	for (int i = 0; i < n-1; i++) {
		cin>>a[i];
	}
	for (int i = 0; i < n; i++) {
		cin>>b[i]>>c[i];
		b[0]=c[n]=0;
		zyoukyaku=zyoukyaku+c[n]-b[n];
		if(i>0){
			ans=ans+(a[n-1]*b[n]);
		}
	}
	cout<<ans<<endl;
	return 0;
}
0