結果
問題 |
No.1468 Colourful Pastel
|
ユーザー |
![]() |
提出日時 | 2021-04-05 11:48:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 20 ms / 1,000 ms |
コード長 | 1,080 bytes |
コンパイル時間 | 1,146 ms |
コンパイル使用メモリ | 92,812 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-30 17:13:30 |
合計ジャッジ時間 | 2,876 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
/* -*- coding: utf-8 -*- * * 1468.cc: No.1468 Colourful Pastel - yukicoder */ #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<iostream> #include<string> #include<vector> #include<map> #include<set> #include<stack> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<functional> using namespace std; /* constant */ const int MAX_N = 100000; const int CN = 7; const char scs[CN][16] = { "Red", "Orange", "Yellow", "Green", "Cyan", "Blue", "Violet" }; /* typedef */ /* global variables */ int cmap[128]; int acs[CN], bcs[CN]; /* subroutines */ /* main */ int main() { for (int i = 0; i < CN; i++) cmap[scs[i][0]] = i; int n; scanf("%d", &n); for (int i = 0; i < n; i++) { char s[16]; scanf("%s", s); acs[cmap[s[0]]]++; } for (int i = 0; i + 1 < n; i++) { char s[16]; scanf("%s", s); bcs[cmap[s[0]]]++; } for (int i = 0; i < CN; i++) if (acs[i] != bcs[i]) { puts(scs[i]); break; } return 0; }