結果

問題 No.505 カードの数式2
ユーザー conf
提出日時 2017-04-21 22:44:04
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 336 bytes
コンパイル時間 598 ms
コンパイル使用メモリ 63,528 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-20 05:33:22
合計ジャッジ時間 1,742 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 WA * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main(){
    int N;
    cin>>N;
    int64_t ans=0;
    while(N--){
        int64_t n;
        cin>>n;
        if(n<0)n=-n;
        if(!ans){
            ans+=n;
        }else if(n>1){
            ans*=n;
        }else{
            ans+=n;
        }
    }
    cout<<ans<<endl;

    return 0;
}
0