AtCoder ABC486 Solution (A~D)

Revision en1, by longyitongxue, 2026-11-28 16:59:35

A

Process the characters in order: replace A with Alpha, B with Bravo, and C with Charlie. Remember to read $$$N$$$ (I got a time penalty here).

Code

#include<bits/stdc++.h>
using namespace std;
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr),cout.tie(nullptr);
  int n;
  cin>>n;
  string s;
  cin>>s;
  for(char c:s){
    if(c=='A'){
      cout<<"Alpha ";
    }else if(c=='B'){
      cout<<"Bravo ";
    }else cout<<"Charlie ";
  }
  return 0;
}
Tags solution, abc486, atcoder beginner

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English longyitongxue 2026-11-28 17:36:09 0 (published)
en4 English longyitongxue 2026-11-28 17:35:41 1257
en3 English longyitongxue 2026-11-28 17:28:39 636
en2 English longyitongxue 2026-11-28 17:06:50 779
en1 English longyitongxue 2026-11-28 16:59:35 622 Initial revision (saved to drafts)