Skip to content

Commit 2e671a8

Browse files
author
Replit user
committed
[Baekjoon] 시뮬 - 2578번 코드
1 parent 3fa924e commit 2e671a8

File tree

4 files changed

+155
-0
lines changed

4 files changed

+155
-0
lines changed

Diff for: .replit

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
run = "python3 main.py"
2+
3+
# The primary language of the repl. There can be others, though!
4+
language = "python3"
5+
# A list of globs that specify which files and directories should
6+
# be hidden in the workspace.
7+
hidden = ["venv", ".config", "**/__pycache__", "**/.mypy_cache", "**/*.pyc"]
8+
9+
# Specifies which nix channel to use when building the environment.
10+
[nix]
11+
channel = "stable-22_11"
12+
13+
[env]
14+
VIRTUAL_ENV = "/home/runner/${REPL_SLUG}/venv"
15+
PATH = "${VIRTUAL_ENV}/bin"
16+
PYTHONPATH = "$PYTHONHOME/lib/python3.10:${VIRTUAL_ENV}/lib/python3.10/site-packages"
17+
REPLIT_POETRY_PYPI_REPOSITORY = "https://package-proxy.replit.com/pypi/"
18+
MPLBACKEND = "TkAgg"
19+
POETRY_CACHE_DIR = "${HOME}/${REPL_SLUG}/.cache/pypoetry"
20+
21+
# Enable unit tests. This is only supported for a few languages.
22+
[unitTest]
23+
language = "python3"
24+
25+
# Add a debugger!
26+
[debugger]
27+
support = true
28+
29+
# How to start the debugger.
30+
[debugger.interactive]
31+
transport = "localhost:0"
32+
startCommand = ["dap-python", "main.py"]
33+
34+
# How to communicate with the debugger.
35+
[debugger.interactive.integratedAdapter]
36+
dapTcpAddress = "localhost:0"
37+
38+
# How to tell the debugger to start a debugging session.
39+
[debugger.interactive.initializeMessage]
40+
command = "initialize"
41+
type = "request"
42+
43+
[debugger.interactive.initializeMessage.arguments]
44+
adapterID = "debugpy"
45+
clientID = "replit"
46+
clientName = "replit.com"
47+
columnsStartAt1 = true
48+
linesStartAt1 = true
49+
locale = "en-us"
50+
pathFormat = "path"
51+
supportsInvalidatedEvent = true
52+
supportsProgressReporting = true
53+
supportsRunInTerminalRequest = true
54+
supportsVariablePaging = true
55+
supportsVariableType = true
56+
57+
# How to tell the debugger to start the debuggee application.
58+
[debugger.interactive.launchMessage]
59+
command = "attach"
60+
type = "request"
61+
62+
[debugger.interactive.launchMessage.arguments]
63+
logging = {}
64+
65+
# Configures the packager.
66+
[packager]
67+
language = "python3"
68+
ignoredPackages = ["unit_tests"]
69+
70+
[packager.features]
71+
enabledForHosting = false
72+
# Enable searching packages from the sidebar.
73+
packageSearch = true
74+
# Enable guessing what packages are needed from the code.
75+
guessImports = true
76+
77+
# These are the files that need to be preserved when this
78+
# language template is used as the base language template
79+
# for Python repos imported from GitHub
80+
[gitHubImport]
81+
requiredFiles = [".replit", "replit.nix", ".config", "venv"]
82+
83+
[languages]
84+
85+
[languages.python3]
86+
pattern = "**/*.py"
87+
88+
[languages.python3.languageServer]
89+
start = "pylsp"
90+
91+
[deployment]
92+
run = ["sh", "-c", "python3 main.py"]

Diff for: main.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print(10)

Diff for: replit.nix

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{ pkgs }: {
2+
deps = [
3+
pkgs.python310Full
4+
pkgs.replitPackages.prybar-python310
5+
pkgs.replitPackages.stderred
6+
];
7+
env = {
8+
PYTHON_LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
9+
# Needed for pandas / numpy
10+
pkgs.stdenv.cc.cc.lib
11+
pkgs.zlib
12+
# Needed for pygame
13+
pkgs.glib
14+
# Needed for matplotlib
15+
pkgs.xorg.libX11
16+
];
17+
PYTHONHOME = "${pkgs.python310Full}";
18+
PYTHONBIN = "${pkgs.python310Full}/bin/python3.10";
19+
LANG = "en_US.UTF-8";
20+
STDERREDBIN = "${pkgs.replitPackages.stderred}/bin/stderred";
21+
PRYBAR_PYTHON_BIN = "${pkgs.replitPackages.prybar-python310}/bin/prybar-python310";
22+
};
23+
}

Diff for: 시뮬/2578.py

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import sys
2+
3+
input = sys.stdin.readline
4+
5+
bingo = dict()
6+
# MC = [list(map(int, input().split())) for _ in range(5)]
7+
check = [[0] * 5 for i in range(5)]
8+
for i in range(5):
9+
num = list(map(int, input().split()))
10+
for j in range(5):
11+
bingo[num[j]] = (i, j)
12+
13+
cnt = 0
14+
result = 0
15+
for _ in range(5):
16+
MC = list(map(int, input().split()))
17+
for i in range(5):
18+
result += 1
19+
x, y = bingo[MC[i]]
20+
check[x][y] = 1
21+
22+
cnt = 0
23+
for j in range(5):
24+
# 가로 빙고 세기
25+
if sum(check[j]) == 5:
26+
cnt += 1
27+
# 세로 빙고 세기
28+
if sum([k[j] for k in check]) == 5:
29+
cnt += 1
30+
31+
#대각선 빙고 세기
32+
if check[0][4] + check[1][3] + check[2][2] + check[3][1] + check[4][0] == 5:
33+
cnt += 1
34+
if check[0][0] + check[1][1] + check[2][2] + check[3][3] + check[4][4] == 5:
35+
cnt += 1
36+
37+
if cnt >= 3:
38+
print(result)
39+
sys.exit()

0 commit comments

Comments
 (0)