結果
問題 |
No.633 バスの運賃
|
ユーザー |
|
提出日時 | 2018-06-14 18:54:40 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 228 bytes |
コンパイル時間 | 558 ms |
コンパイル使用メモリ | 63,968 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 14:25:57 |
合計ジャッジ時間 | 1,107 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() | ^~~~
ソースコード
#include<iostream> using namespace std; int n,a[100],cnt,b,c; main() { cin>>n; for(int i=1;i<n;i++)cin>>a[i]; cin>>b>>cnt; int ans=0; for(int i=1;i<n;i++) { ans+=a[i]*cnt; cin>>b>>c; cnt+=c-b; } cout<<ans<<endl; }