SlideShare una empresa de Scribd logo
1 de 27
Program MADE IN BRAIN 알고리즘의 ‘느낌’ 알아보기 24th이시야 Hanyang University, EECS, JARAM
프로그래밍이란? Hanyang University, EECS, JARAM
1%의 영감 Hanyang University, EECS, JARAM
그래서 프로그래밍이란? Hanyang University, EECS, JARAM
프로그램 == 생각들의 집합 프로그램 == 알고리즘의 집합 Hanyang University, EECS, JARAM
알고리즘 문제를 해결하기 위한 절차나 방법 Hanyang University, EECS, JARAM
알고리즘의 연구 고안 검증  분석 테스트 Hanyang University, EECS, JARAM
알고리즘의 분석  정확성 작업량 기억 장소 사용량 단순성 최적성 Hanyang University, EECS, JARAM
알고리즘의 속도 O(1) O(log N) O(N) O(N log N) O(N2) O(N3) O(2n) Hanyang University, EECS, JARAM
알고리즘의 효과 한 문제를 푸는 여러 가지 방법의 예시 Hanyang University, EECS, JARAM
1부터 N까지의 합 ? Hanyang University, EECS, JARAM
1~N의 합 반복문  이용 수식 이용 sumOneToN(int n){ int result = 0; 	for (inti =1 ; i<=n ; i++) 		result +=I; 	return result; } sumOneToN(int n){ 	return n * (n + 1) / 2; } Hanyang University, EECS, JARAM
GCD 구하기 정의 이용 유클리드 알고리즘 intgreatestCommonDivisor(int num1, int num2){ int result = 1; intminGCM = 1; 	int bignum = (num1<=num2)?num2:num1; 	for(inti= bignum;i>minGCM;i--){ 		if(num1%i==0 && num2%i==0){ 			result=i; 			return result; 		} 	} 	return minGCM; } intgreatestCommonDivisor (int num1, int num2){ int  temp; 	while(num1 != 0){ 		if(num1<num2){ 			temp = num1; 			num1=num2; 			num2=temp; 		} 		num1 = num1-num2; 	} 	return num2; } Hanyang University, EECS, JARAM
GCD 구하기 유클리드 알고리즘 개선된 유클리드 알고리즘 intgreatestCommonDivisor (int num1, int num2){ int  temp; 	while(num1 != 0){ 		if(num1<num2){ 			temp = num1; 			num1=num2; 			num2=temp; 		} 		num1 = num1-num2; 	} 	return num2; } intgreatestCommonDivisor (int num1, int num2){ int  temp; 	while(num2 != 0){ 		temp = num1 % num2 		num1=num2; 		num2=temp; 	} 	return num2; } Hanyang University, EECS, JARAM
ICPC acm with Algorithm Hanyang University, EECS, JARAM
문제 1.코인 10원이 K개, 50원이 L개, 100원이 M개 500원이 N개 있다. 총 금액을 구하시오 입력 한 줄에 정수인 K, L, M, N을 순서대로 입력한다. (0 <= K, L, M, N <= 100) 출력 결과값은 총 금액을 계산한 값이다. Hanyang University, EECS, JARAM
문제 2. 소수 판별 하기 1보다 큰 정수 P가 1과 P 자신 이외의양의  약수를 가지지 않을 때의 P를 소수라고 부른다. 이를테면 2, 3, 5, 7, 11, 13, 17, 19, 23 등은 모두 소수이다. 4, 6, 16 등과 같이 소수가 아니면서 2 이상인 자연수를 합성수라고 정의하며, 1은 소수도 아니고 합성수도 아닌 수이다. 주어진 자연수 N의 소수여부를 판정해라. Hanyang University, EECS, JARAM
문제 2. 소수 판별 하기 Ex) 3 -> YES 입력 N은 1 <= N <= 10000000 사이의 범위를 가진다. 출력 N이 소수인 경우에는 Yes를 출력하고 N이 소수가 아닌 경우에는 No를 출력한다. Hanyang University, EECS, JARAM
소수 판별 정의에 의한 판별 계량 된 방법 Boolean isPrime(int n){ 	for(inti = 2;i<=n;i++){ 		if(n%i == 0) 			return false; 	} 	return true; } Boolean isPrime(int n){ Int end = (int)sqrt(n); 	for(inti = 2;i<=end;i++){ 		if(n%i == 0) 			return false; 	} 	return true; } Hanyang University, EECS, JARAM
문제 3. 수 뒤집기 뒤집어서 합한 뒤 대칭이 되는 수인지 아닌지 판단 Ex) 124 -> 421 124+421 = 545 입력 Testcase T는 1<=T<=10 정수N은 10<= N<=100000 출력 대칭이면 YES 아니면 NO Hanyang University, EECS, JARAM
문제 4. Molar mass 'c' carbon , 'h' hydrogen , 'o' oxygen,and 'n' nitrogen without parntheses.the standard atomic weights for 'c' 'h' 'o' 'n‘ Input Ex) C6H5OH output The line should contain the molar mass of the given molecular formula. Ex) 94.108 Hanyang University, EECS, JARAM
알고리즘 ++ Hanyang University, EECS, JARAM
자료구조 배열 스택 힙 트리 그래프 Hanyang University, EECS, JARAM
정렬 거품 정렬 선택 정렬 삽입 정렬 쉘 정렬 퀵 정렬 병합 정렬 힙 정렬 기수 정렬 Hanyang University, EECS, JARAM
알고리즘 속도를 위한 기법 상태저장 자료구조 보완  나누어 풀기 점화식과 자료저장 수식 이용 Hanyang University, EECS, JARAM
참고 자료 Wiki Pedia C로 배우는 알고리즘 생각하는 프로그래밍 Hanyang University, EECS, JARAM
? Q&A Hanyang University, EECS, JARAM

Más contenido relacionado

Último

A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)Tae Young Lee
 
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionKim Daeun
 
Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Wonjun Hwang
 
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Kim Daeun
 
캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스
 
Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Wonjun Hwang
 

Último (6)

A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)
 
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
 
Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)
 
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
 
캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차
 
Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)
 

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Program made in brain

  • 1. Program MADE IN BRAIN 알고리즘의 ‘느낌’ 알아보기 24th이시야 Hanyang University, EECS, JARAM
  • 3. 1%의 영감 Hanyang University, EECS, JARAM
  • 5. 프로그램 == 생각들의 집합 프로그램 == 알고리즘의 집합 Hanyang University, EECS, JARAM
  • 6. 알고리즘 문제를 해결하기 위한 절차나 방법 Hanyang University, EECS, JARAM
  • 7. 알고리즘의 연구 고안 검증 분석 테스트 Hanyang University, EECS, JARAM
  • 8. 알고리즘의 분석 정확성 작업량 기억 장소 사용량 단순성 최적성 Hanyang University, EECS, JARAM
  • 9. 알고리즘의 속도 O(1) O(log N) O(N) O(N log N) O(N2) O(N3) O(2n) Hanyang University, EECS, JARAM
  • 10. 알고리즘의 효과 한 문제를 푸는 여러 가지 방법의 예시 Hanyang University, EECS, JARAM
  • 11. 1부터 N까지의 합 ? Hanyang University, EECS, JARAM
  • 12. 1~N의 합 반복문 이용 수식 이용 sumOneToN(int n){ int result = 0; for (inti =1 ; i<=n ; i++) result +=I; return result; } sumOneToN(int n){ return n * (n + 1) / 2; } Hanyang University, EECS, JARAM
  • 13. GCD 구하기 정의 이용 유클리드 알고리즘 intgreatestCommonDivisor(int num1, int num2){ int result = 1; intminGCM = 1; int bignum = (num1<=num2)?num2:num1; for(inti= bignum;i>minGCM;i--){ if(num1%i==0 && num2%i==0){ result=i; return result; } } return minGCM; } intgreatestCommonDivisor (int num1, int num2){ int temp; while(num1 != 0){ if(num1<num2){ temp = num1; num1=num2; num2=temp; } num1 = num1-num2; } return num2; } Hanyang University, EECS, JARAM
  • 14. GCD 구하기 유클리드 알고리즘 개선된 유클리드 알고리즘 intgreatestCommonDivisor (int num1, int num2){ int temp; while(num1 != 0){ if(num1<num2){ temp = num1; num1=num2; num2=temp; } num1 = num1-num2; } return num2; } intgreatestCommonDivisor (int num1, int num2){ int temp; while(num2 != 0){ temp = num1 % num2 num1=num2; num2=temp; } return num2; } Hanyang University, EECS, JARAM
  • 15. ICPC acm with Algorithm Hanyang University, EECS, JARAM
  • 16. 문제 1.코인 10원이 K개, 50원이 L개, 100원이 M개 500원이 N개 있다. 총 금액을 구하시오 입력 한 줄에 정수인 K, L, M, N을 순서대로 입력한다. (0 <= K, L, M, N <= 100) 출력 결과값은 총 금액을 계산한 값이다. Hanyang University, EECS, JARAM
  • 17. 문제 2. 소수 판별 하기 1보다 큰 정수 P가 1과 P 자신 이외의양의 약수를 가지지 않을 때의 P를 소수라고 부른다. 이를테면 2, 3, 5, 7, 11, 13, 17, 19, 23 등은 모두 소수이다. 4, 6, 16 등과 같이 소수가 아니면서 2 이상인 자연수를 합성수라고 정의하며, 1은 소수도 아니고 합성수도 아닌 수이다. 주어진 자연수 N의 소수여부를 판정해라. Hanyang University, EECS, JARAM
  • 18. 문제 2. 소수 판별 하기 Ex) 3 -> YES 입력 N은 1 <= N <= 10000000 사이의 범위를 가진다. 출력 N이 소수인 경우에는 Yes를 출력하고 N이 소수가 아닌 경우에는 No를 출력한다. Hanyang University, EECS, JARAM
  • 19. 소수 판별 정의에 의한 판별 계량 된 방법 Boolean isPrime(int n){ for(inti = 2;i<=n;i++){ if(n%i == 0) return false; } return true; } Boolean isPrime(int n){ Int end = (int)sqrt(n); for(inti = 2;i<=end;i++){ if(n%i == 0) return false; } return true; } Hanyang University, EECS, JARAM
  • 20. 문제 3. 수 뒤집기 뒤집어서 합한 뒤 대칭이 되는 수인지 아닌지 판단 Ex) 124 -> 421 124+421 = 545 입력 Testcase T는 1<=T<=10 정수N은 10<= N<=100000 출력 대칭이면 YES 아니면 NO Hanyang University, EECS, JARAM
  • 21. 문제 4. Molar mass 'c' carbon , 'h' hydrogen , 'o' oxygen,and 'n' nitrogen without parntheses.the standard atomic weights for 'c' 'h' 'o' 'n‘ Input Ex) C6H5OH output The line should contain the molar mass of the given molecular formula. Ex) 94.108 Hanyang University, EECS, JARAM
  • 22. 알고리즘 ++ Hanyang University, EECS, JARAM
  • 23. 자료구조 배열 스택 힙 트리 그래프 Hanyang University, EECS, JARAM
  • 24. 정렬 거품 정렬 선택 정렬 삽입 정렬 쉘 정렬 퀵 정렬 병합 정렬 힙 정렬 기수 정렬 Hanyang University, EECS, JARAM
  • 25. 알고리즘 속도를 위한 기법 상태저장 자료구조 보완 나누어 풀기 점화식과 자료저장 수식 이용 Hanyang University, EECS, JARAM
  • 26. 참고 자료 Wiki Pedia C로 배우는 알고리즘 생각하는 프로그래밍 Hanyang University, EECS, JARAM
  • 27. ? Q&A Hanyang University, EECS, JARAM