본문 바로가기

분류 전체보기89

백준 1233번 -주사위 https://www.acmicpc.net/problem/1233 1233번: 주사위 지민이는 주사위 던지기 게임을 좋아하여 어느 날 옆에 있는 동호를 설득하여 주사위 던지기 게임을 하자고 하였다. 총 3개의 주사위가 있다. 그리고 이 주사위는 각각 S1(2 ≤ S1 ≤ 20), S2(2 ≤ S2 www.acmicpc.net #include using namespace std; int s1, s2, s3, maxValue=0, maxKey; map mp; int main(){ cin >> s1 >> s2 >> s3; for(int i=1; i 2023. 8. 6.
백준 1225번- 이상한 곱셈 #include using namespace std; typedef long long ll; string num1, num2; ll sum=0; int main(){ cin >> num1 >> num2; for(int i=0; i 2023. 8. 4.
백준 1212번 - 8진수 2진수 //1번 #include using namespace std; string convertToBinary(int num) { string binaryStr = ""; while (num > 0) { int remainder = num % 2; binaryStr = to_string(remainder) + binaryStr; num /= 2; } return binaryStr; } int main() { string octalStr; cin >> octalStr; // 입력이 0인 경우 예외 처리 if (octalStr == "0") { cout eight; for(int i=0; i 2023. 8. 4.
백준 1173번-운동 처음 풀이- 맞음(근데 조건식이 좀 복잡..) #include using namespace std; int N, m, M, T, R, exeCnt=0, totalTime=0, x; int main(){ cin >> N >> m >> M >> T >> R; x = m; //초기 x if(x+T>M && x-R=m x+T >=M일 때, x-R=m x+T N >> m >> M >> T >> R; x = m; //초기 x if(x+T>M && x-R 2023. 7. 31.
백준 1159번- 농구 경기 1) #include using namespace std; int num; string name; vector names; vector memberlist; map mp; bool isValue = false; int main(){ cin >> num; for(int i=0; i> name; names.push_back(name); } for(int i=0; i= 5){ memberlist.push_back(it.first); isValue = true; } } if(isValue){ for(char i : memberlist) cout 2023. 7. 30.
백준 1157번 - 단어 공부 처음에 짠 코드 - 시간 초과다... #include using namespace std; string s; int maxCnt=0, cnt=0; char tmp; int main(){ cin >> s; for(int i=0; i 2023. 7. 28.