結果

問題 No.1468 Colourful Pastel
ユーザー heaveneleven521
提出日時 2021-04-04 15:17:43
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 29 ms / 1,000 ms
コード長 637 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,168 ms
コンパイル使用メモリ 183,252 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-06-02 08:24:43
合計ジャッジ時間 2,436 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

 #include <bits/stdc++.h>
using namespace std;
 
int main() {
    int n;
    cin >> n;
    vector<string> p={"Red","Orange","Yellow","Green","Cyan","Blue","Violet"};
    int cnt1[7]={};
    int cnt2[7]={};
    for(int i=0;i<n;i++){
    string q;
    cin >> q;
        for(int j=0;j<7;j++){
            if(q==p[j]){
            cnt1[j]++;
            }
        }
    }
    for(int i=0;i<n;i++){
    string r;
    cin >> r;
        for(int j=0;j<7;j++){
            if(r==p[j]){
            cnt2[j]++;
            }
        }
    }
    for(int i=0;i<7;i++){
        if(cnt1[i]>cnt2[i]){
        cout << p[i] << endl;
        }
    }
}
    
0