안녕하세요 오늘은 해시함수를 구현해야하는 문제를 풀어보겠습니다. 전략: 1. const int 타입을 통해 MOD, MUL 상수를 선언해준다. 2. string 타입의 문자를 선언하고 반복문과 -96을 통해 알파벳 숫자를 구해준다. 3. 문제에 나와있는 대로 더하고 나눈 나머지를 sum에 대입한다. 코드: #include using namespace std; const int MOD = 1234567891; const int MUL = 31; int main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int N; long long int sum = 0; cin>>N; string M; cin>>M; long long R = 1; for(int i= 0; i