結果

問題 No.717 ファッションへのこだわり
コンテスト
ユーザー tatyam
提出日時 2018-07-27 22:33:46
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 351µs
コード長 802 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,044 ms
コンパイル使用メモリ 212,732 KB
実行使用メモリ 9,856 KB
最終ジャッジ日時 2026-10-10 20:06:00
合計ジャッジ時間 2,374 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define rep(i,l,r) for(int i=l;i<r;i++)
#define LINF (ll)1e18
#define INF (int)1e9
struct aaa{aaa(){cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(10);};}aaaaaaa;
inline void in() {}
template <class Head, class... Tail>
inline void in(Head&& head,Tail&&... tail){
    cin>>head;
    in(move(tail)...);
}
template <class T>
inline void out(T t) {
    cout<<t<<'\n';
}
template <class Head, class... Tail>
inline void out(Head head,Tail... tail){
    cout<<head<<' ';
    out(move(tail)...);
}
int main(){
    int a,b;
    in(a,b);
    string s,t;
    in(s,t);
    int b1=accumulate(s.begin(), s.end(), 0)-'A'*a;
    int b2=accumulate(t.begin(), t.end(), 0)-'A'*b;
    out(min(a-b1,b-b2)+min(b1,b2));
}

















0