結果
問題 | No.1433 Two color sequence |
ユーザー |
|
提出日時 | 2021-03-20 07:58:52 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 274 bytes |
コンパイル時間 | 2,104 ms |
コンパイル使用メモリ | 191,820 KB |
最終ジャッジ日時 | 2025-01-19 20:07:14 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 4 WA * 17 |
ソースコード
#include<bits/stdc++.h>#define int long longusing namespace std;signed main(){int N;cin>>N;string S;cin>>S;int R=0,B=0;for(int i=0;i<N;i++){int A;cin>>A;if(S[i]=='R')R+=A;else B=A;}cout<<abs(R-B)<<endl;}