結果
| 問題 | No.633 バスの運賃 | 
| コンテスト | |
| ユーザー |  ykringum | 
| 提出日時 | 2019-05-01 02:22:27 | 
| 言語 | C (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1 ms / 2,000 ms | 
| コード長 | 297 bytes | 
| コンパイル時間 | 440 ms | 
| コンパイル使用メモリ | 28,800 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-12-31 12:04:23 | 
| 合計ジャッジ時間 | 1,351 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 9 | 
ソースコード
#include <stdio.h>
int main(void) {
	int n, i;
  scanf("%d", &n);
  int a[100], b, c, sum = 0, ans = 0;
	
	for( i = 0; i < n - 1; i++) {
    scanf("%d", &a[i]);
  }
	for( i = 0; i < n - 1; i++) {
		scanf("%d %d", &b, &c);
		sum += c - b;
		ans += sum * a[i];
	}
	printf("%d", ans);
	return 0;
}
            
            
            
        