René's URL Explorer Experiment


Title: [Week 6] DICTIONARY self review - Yunhyunjo · Issue #184 · Queue-ri/Advanced-Algorithm-Study · GitHub

Open Graph Title: [Week 6] DICTIONARY self review - Yunhyunjo · Issue #184 · Queue-ri/Advanced-Algorithm-Study

X Title: [Week 6] DICTIONARY self review - Yunhyunjo · Issue #184 · Queue-ri/Advanced-Algorithm-Study

Description: DICTIONARY self review 1. 해결 시도 과정 위상정렬을 위해 indegree와 ch를 선언하여 저장하고 인접리스트를 만들어 정렬을 시도하였습니다. 2. 작성한 코드와 설명 while (c--) { string s, p; fill(indegree.begin(), indegree.end(), 0); fill(ch.begin(), ch.end(), 0); vector > v(26); c...

Open Graph Description: DICTIONARY self review 1. 해결 시도 과정 위상정렬을 위해 indegree와 ch를 선언하여 저장하고 인접리스트를 만들어 정렬을 시도하였습니다. 2. 작성한 코드와 설명 while (c--) { string s, p; fill(indegree.begin(), indegree.end(), 0); fill(ch.begin(), ch.e...

X Description: DICTIONARY self review 1. 해결 시도 과정 위상정렬을 위해 indegree와 ch를 선언하여 저장하고 인접리스트를 만들어 정렬을 시도하였습니다. 2. 작성한 코드와 설명 while (c--) { string s, p; fill(indegree.begin(), indegree.end(), 0); fill(ch.begin(), ch.e...

Opengraph URL: https://github.com/Queue-ri/Advanced-Algorithm-Study/issues/184

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Week 6] DICTIONARY self review - Yunhyunjo","articleBody":"# DICTIONARY self review ![](https://img.shields.io/badge/-WA-%23e00000)\r\n\r\n## 1. 해결 시도 과정\r\n위상정렬을 위해 indegree와 ch를 선언하여 저장하고 인접리스트를 만들어 정렬을 시도하였습니다.\r\n\r\n## 2. 작성한 코드와 설명\r\n```cpp\r\nwhile (c--) {\r\n\t\tstring s, p;\r\n\t\tfill(indegree.begin(), indegree.end(), 0);\r\n\t\tfill(ch.begin(), ch.end(), 0);\r\n\t\tvector \u003cvector \u003cint\u003e\u003e v(26);\r\n\t\tcin \u003e\u003e n \u003e\u003e s;\r\n\t\tp = s;\r\n\t\tch[p[0] - 97] = 1;\r\n\t\tfor (int i = 1; i \u003c n; i++) {\r\n\t\t\tcin \u003e\u003e s;\r\n\t\t\tif (p[0] != s[0]) {\r\n\t\t\t\tif (ch[s[0] - 97] == 0) ch[s[0] - 97] = 1;\r\n\t\t\t\tindegree[s[0] - 97]++;\r\n\t\t\t\tv[p[0] - 97].push_back(s[0] - 97);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tint pp = 1;\r\n\t\t\t\twhile (pp \u003c p.size() \u0026\u0026 pp \u003c s.size()) {\r\n\t\t\t\t\tif (p[pp] != s[pp]) {\r\n\t\t\t\t\t\tif (ch[p[pp] - 97] == 0) ch[p[pp] - 97] = 1;\r\n\t\t\t\t\t\tif (ch[s[pp] - 97] == 0) ch[s[pp] - 97] = 1;\r\n\t\t\t\t\t\tindegree[s[pp] - 97]++;\r\n\t\t\t\t\t\tv[p[pp] - 97].push_back(s[pp] - 97);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpp++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tp = s;\r\n\t\t}\r\n\t\tcout \u003c\u003c topologySort(v) \u003c\u003c endl;\r\n\t}\r\n```\r\n먼저 입력된 순서대로 비교하여 인접리스트를 만들고 indegree도 구해주었습니다. \r\n두 단어의 0번째 값이 같을 경우에는 다음 인덱스의 해당하는 문자를 비교해주었습니다. \r\n그렇게 구한 인접리스트를 topologySort함수에 매개변수로 넘겨주어 위상정렬을 해 출력해 주었습니다.\r\n\r\n```cpp\r\nstring topologySort(vector \u003cvector \u003cint\u003e\u003e\u0026 v) {\r\n\tstring s = \"\";\r\n\tqueue \u003cint\u003e q;\r\n\tfor (int i = 0; i \u003c 26; i++) {\r\n\t\tif (ch[i] == 1 \u0026\u0026 indegree[i] == 0) {\r\n\t\t\tq.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\twhile (!q.empty()) {\r\n\t\tint x = q.front();\r\n\t\tq.pop();\r\n\t\tchar c = x + 97;\r\n\t\ts += c;\r\n\t\tfor (int j = 0; j \u003c v[x].size(); j++) {\r\n\t\t\tif (v[x][0] == 50) return \"INVALID HYPOTHESIS\";\r\n\t\t\tif (--indegree[v[x][j]] == 0) q.push(v[x][j]);\r\n\t\t}\r\n\t\tv[x].clear();\r\n\t\tv[x].push_back(50);\r\n\t}\r\n\tif(s == \"\") return \"INVALID HYPOTHESIS\";\r\n\tfor (int i = 0; i \u003c 26; i++) {\r\n\t\tif (ch[i] == 0) {\r\n\t\t\tchar c = i + 97;\r\n\t\t\ts += c;\r\n\t\t}\r\n\t}\r\n\treturn s;\r\n}\r\n```\r\nqueue를 사용하여 일단 indegree값이 0인 값을 넣어주었습니다. 그 다음 bfs를 통해 위상정렬을 해 주었습니다.\r\n순환을 막기위해 이미 정렬에 사용한 정점 리스트는 clear해준 다음 값 50을 넣어주었고, for 문을 돌때 0번째 값이 50이면 이미 정렬에 사용한 정점으로 순환된 것 이므로 바로  INVALID HYPOTHESIS를 리턴해주었습니다.\r\n또 indegree가 0인 것이 없어 s가 비어있을 경우에도 순환이란 뜻이므로 INVALID HYPOTHESIS를 리턴해주었습니다.\r\n\r\n## 3. 막힌 점 및 개선 사항\r\n예제 입력은 정답이 제대로 나와서 정확히 어디서 틀린지를 모르겠습니다. 만약 똑같은 순서가 중복으로 나올 때 어차피 topologySort함수에서 걸러지므로 인접리스트 만들때 처리를 안해줬는데 처리하는 코드를 넣어줘야할 것 같습니다.","author":{"url":"https://github.com/Yunhyunjo","@type":"Person","name":"Yunhyunjo"},"datePublished":"2022-03-03T13:08:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/184/Advanced-Algorithm-Study/issues/184"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d7161d8a-f449-47ec-61ad-64e83648d3e9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8FA4:68859:181BE0:1F7C6E:698FA360
html-safe-nonce3afb6bae72c99bb8b9719996e806cb0edbdc82e5691b46fe55fd1af77300210e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RkE0OjY4ODU5OjE4MUJFMDoxRjdDNkU6Njk4RkEzNjAiLCJ2aXNpdG9yX2lkIjoiNDIwMTE3MTQ2NTQ5ODc2NDEyOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac40860a1f9cd9132b716579d07451ccd5dcec85c3cdc55f8b2627d5d638a1aef1
hovercard-subject-tagissue:1158389421
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/Queue-ri/Advanced-Algorithm-Study/184/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e06c6c09e16c0f69830e6fbd023faad5f9a2c9a91f643f07793e06886ed420ce/Queue-ri/Advanced-Algorithm-Study/issues/184
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e06c6c09e16c0f69830e6fbd023faad5f9a2c9a91f643f07793e06886ed420ce/Queue-ri/Advanced-Algorithm-Study/issues/184
og:image:altDICTIONARY self review 1. 해결 시도 과정 위상정렬을 위해 indegree와 ch를 선언하여 저장하고 인접리스트를 만들어 정렬을 시도하였습니다. 2. 작성한 코드와 설명 while (c--) { string s, p; fill(indegree.begin(), indegree.end(), 0); fill(ch.begin(), ch.e...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameYunhyunjo
hostnamegithub.com
expected-hostnamegithub.com
Noneff0b5286b4f7cd2eb22d357a0ae8fb9a0ae1eaf6abfbae7410c3b315d16414e1
turbo-cache-controlno-preview
go-importgithub.com/Queue-ri/Advanced-Algorithm-Study git https://github.com/Queue-ri/Advanced-Algorithm-Study.git
octolytics-dimension-user_id77003554
octolytics-dimension-user_loginQueue-ri
octolytics-dimension-repository_id327196656
octolytics-dimension-repository_nwoQueue-ri/Advanced-Algorithm-Study
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id327196656
octolytics-dimension-repository_network_root_nwoQueue-ri/Advanced-Algorithm-Study
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release17aba3d160d69b8c2b37695ebd174d8101af8896
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/Queue-ri/Advanced-Algorithm-Study/issues/184#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FQueue-ri%2FAdvanced-Algorithm-Study%2Fissues%2F184
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FQueue-ri%2FAdvanced-Algorithm-Study%2Fissues%2F184
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=Queue-ri%2FAdvanced-Algorithm-Study
Reloadhttps://patch-diff.githubusercontent.com/Queue-ri/Advanced-Algorithm-Study/issues/184
Reloadhttps://patch-diff.githubusercontent.com/Queue-ri/Advanced-Algorithm-Study/issues/184
Reloadhttps://patch-diff.githubusercontent.com/Queue-ri/Advanced-Algorithm-Study/issues/184
Queue-ri https://patch-diff.githubusercontent.com/Queue-ri
Advanced-Algorithm-Studyhttps://patch-diff.githubusercontent.com/Queue-ri/Advanced-Algorithm-Study
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FQueue-ri%2FAdvanced-Algorithm-Study
Fork 2 https://patch-diff.githubusercontent.com/login?return_to=%2FQueue-ri%2FAdvanced-Algorithm-Study
Star 9 https://patch-diff.githubusercontent.com/login?return_to=%2FQueue-ri%2FAdvanced-Algorithm-Study
Code https://patch-diff.githubusercontent.com/Queue-ri/Advanced-Algorithm-Study
Issues 10 https://patch-diff.githubusercontent.com/Queue-ri/Advanced-Algorithm-Study/issues
Pull requests 1 https://patch-diff.githubusercontent.com/Queue-ri/Advanced-Algorithm-Study/pulls
Actions https://patch-diff.githubusercontent.com/Queue-ri/Advanced-Algorithm-Study/actions
Security 0 https://patch-diff.githubusercontent.com/Queue-ri/Advanced-Algorithm-Study/security
Insights https://patch-diff.githubusercontent.com/Queue-ri/Advanced-Algorithm-Study/pulse
Code https://patch-diff.githubusercontent.com/Queue-ri/Advanced-Algorithm-Study
Issues https://patch-diff.githubusercontent.com/Queue-ri/Advanced-Algorithm-Study/issues
Pull requests https://patch-diff.githubusercontent.com/Queue-ri/Advanced-Algorithm-Study/pulls
Actions https://patch-diff.githubusercontent.com/Queue-ri/Advanced-Algorithm-Study/actions
Security https://patch-diff.githubusercontent.com/Queue-ri/Advanced-Algorithm-Study/security
Insights https://patch-diff.githubusercontent.com/Queue-ri/Advanced-Algorithm-Study/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/Queue-ri/Advanced-Algorithm-Study/issues/184
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/Queue-ri/Advanced-Algorithm-Study/issues/184
[Week 6] DICTIONARY self review - Yunhyunjohttps://patch-diff.githubusercontent.com/Queue-ri/Advanced-Algorithm-Study/issues/184#top
2기스터디 2기https://github.com/Queue-ri/Advanced-Algorithm-Study/issues?q=state%3Aopen%20label%3A%222%EA%B8%B0%22
WAWrong Answerhttps://github.com/Queue-ri/Advanced-Algorithm-Study/issues?q=state%3Aopen%20label%3A%22WA%22
https://github.com/Yunhyunjo
https://github.com/Yunhyunjo
Yunhyunjohttps://github.com/Yunhyunjo
on Mar 3, 2022https://github.com/Queue-ri/Advanced-Algorithm-Study/issues/184#issue-1158389421
https://camo.githubusercontent.com/6389fe8e6eac7066a1d7da0125d8a5837f55a16a3607d0e3bbf02c5f40ead308/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2d57412d253233653030303030
2기스터디 2기https://github.com/Queue-ri/Advanced-Algorithm-Study/issues?q=state%3Aopen%20label%3A%222%EA%B8%B0%22
WAWrong Answerhttps://github.com/Queue-ri/Advanced-Algorithm-Study/issues?q=state%3Aopen%20label%3A%22WA%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.