알고리즘/BOJ

백준 20232번 Archivist

꾸준함. 2021. 3. 29. 23:32

문제 링크입니다: www.acmicpc.net/problem/20232

 

20232번: Archivist

The only line of input contains a single integer $y$ ($1995 \le y \le 2019$), denoting the year. You don't need to process year numbers less than $1995$ or greater than $2019$, or incorrect year formats. It is guaranteed that you will be given a number bet

www.acmicpc.net

간단한 구현 문제였습니다.

 

#include <iostream>
#include <string>
using namespace std;
const int MAX = 25;
const int START_YEAR = 1995;
string winners[MAX] = { "ITMO", "SPbSU", "SPbSU"
, "ITMO", "ITMO", "SPbSU"
, "ITMO", "ITMO", "ITMO"
, "ITMO", "ITMO", "PetrSU, ITMO"
, "SPbSU", "SPbSU", "ITMO"
, "ITMO", "ITMO", "ITMO"
, "SPbSU", "ITMO", "ITMO"
, "ITMO", "ITMO", "SPbSU", "ITMO" };
int main(void)
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int y;
cin >> y;
cout << winners[y - START_YEAR] << "\n";
return 0;
}
view raw .cpp hosted with ❤ by GitHub

 

개발환경:Visual Studio 2017

 

지적, 조언, 질문 환영입니다! 댓글 남겨주세요~

반응형

'알고리즘 > BOJ' 카테고리의 다른 글

백준 20352번 Circus  (0) 2021.03.29
백준 20233번 Bicycle  (0) 2021.03.29
백준 20215번 Cutting Corners  (0) 2021.03.29
백준 19944번 뉴비의 기준은 뭘까?  (3) 2021.03.29
백준 5103번 DVDs  (0) 2021.03.28