-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
9-pu2rile #29
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ€! μ΄λ²μλ cμΈμ΄λ‘ ꡬννμ
¨κ΅°μγ
γ
cμΈμ΄ μ λ§ μ€λλ§μ
λλ€...
μ λ λ¨Όμ μ΄ λ¬Έμ λ₯Ό νμ΄λ΄€λλ°...μ’ λ°λ³΄κ°μ΄...μλͺ» μ΄ν΄ν΄ λ²λ €μ κ° νμ°¨λ³λ‘λ§ μ μλ₯Ό λΉκ΅νλ©΄ λλ μ€ μμμ΄μγ
γ
λμ ν©μ λΉκ΅νλ κ±°μκ΅°μ... 그리ꡬ μ λ―Έλμ€κ° μ΄κΈ°λ κ²½μ°λ μλ€κ³ μκ°νκ³ νμλλ° κ·Έλ κ² νλ©΄ μ λλλΌκ΅¬μ...
λ€μ μκ°μ ν΄λ³΄κ³ νμ΄λ΄€μ΄μ! κ·Όλ°, λ λ¬Έμ κ° μκΈ΄κ² λνλ μ½λλ λΆλͺ
μ½λ ν μ€μ μμλ§ λ€λ₯Έλ°,,, μ λλκ±°μμ. νμ°Έμ μ΄ν΄κ° λμ§ μμ κ³ λ―Όνμ΄μ
μ μ²μ μ½λλ
Geminis = list(map(int, input().split())) # μ λ―Έλμ€μ νμ°¨λ³ λμ
Gullivers = list(map(int, input().split())) # 걸리λ²μ€μ νμ°¨λ³ λμ
Geminis_score = 0 # μ λ―Έλμ€ μ΄ μ μ
Gullivers_score = 0 # 걸리λ²μ€ μ΄ μ μ
win = False # μ λ―Έλμ€κ° ν λ²μ΄λΌλ 걸리λ²μ€μκ² μ΄κΈ΄ μ μ΄ μλμ§ μ¬λΆ
for i in range(9): # 0~9
Geminis_score += Geminis[i] # μ λ―Έλμ€μ κ° νμ°¨λ³ λμ ν©
Gullivers_score += Gullivers[i] # 걸리λ²μ€μ κ° νμ°¨λ³ λμ ν©
if Geminis_score > Gullivers_score: #μ λ―Έλμ€κ° ν λ²μ΄λΌλ μ΄κΈ°κ³ μλμ§ μ²΄ν¬
win = True
if Geminis_score < Gullivers_score and win: # μ λ―Έλμ€κ° ν λ²μ΄λΌλ μ΄κ²Όμ§λ§ μ΄ λμ μμ λ°λ € μ‘μ κ²½μ° μμ ν¨
result = "Yes"
else:
result = "No"
print(result)
μ΄κ±°μμ΅λλ€
Gullivers_score += Gullivers[i] # 걸리λ²μ€μ κ° νμ°¨λ³ λμ ν©
μ΄ μ½λμ μμκ° λ¬Έμ μμ΄μ. μ ifλ¬Έ λ€μ λμμΌ ν κΉ κ³μ κ³ λ―Όν΄ λ΄€λλ° μ²μμλ μ μ΄ν΄κ° λμ§ μμμ΅λλ€
κ·Έλ°λ°, λ¬Έμ μ ννΈ λΆλΆμ λμμλ **μΈλ¦Ό μ λ―Έλμ€κ° μ΄κΈ°κ³ μλ μκ°μ (μΈλ¦Όμ΄ 1ν μ΄μ 1μ μ λΈ μκ°) ~ (μ€ννΈλ§ν¬κ° 3ν λ§μ 1μ μ λΈ μκ°)**λ₯Ό λ³΄κ³ κΉ¨λ¬μμ΅λλ€. μΈλ¦Ό μ λ―Έλμ€κ° μ΄κΈ°κ³ μλ μκ°μλ κ·Έ νμ°¨μ 걸리λ²μ€ μ μκ° ν©ν΄μ§κΈ° μ μ΄μμ΄μ! κ·Έλμ κ·Έ νμ°¨μ 걸리λ²μ€ μ μλ₯Ό ν©νκΈ° μ μ λ―Έλμ€μμ λΉκ΅λ₯Ό ν ν, 걸리λ²μ€μ μ μλ₯Ό λνλ κ² λ§λ€λ κ²μ μκ²λμμ΅λλΉ κ·Έ νμ°¨μ 걸리λ²μ€μ μ μκΉμ§ λν΄ λΉκ΅νκ² λλ©΄, μ λ―Έλμ€κ° μ΄κΈ°κ³ μλ€κ° μμ λΉν λΆλΆμ΄ λ°μλμ§ μλλ€λ κ²μ μκ²λμμ΅λλ€.
μ΄ λΆλΆμ μκ³ λλ λ¬Έμ λ₯Ό νΈλ κ²μ μ±κ³΅ν μ μμμ΄μ!π₯³
μ΄λ² PRλ μκ³ νμ ¨μ΄μ! λλΆμ μ¬λ―Έμλ λ¬Έμ νκ³ κ°λλΉ~
μ΅μ’ μ½λλ Geminis = list(map(int, input().split())) # μ λ―Έλμ€μ νμ°¨λ³ λμ
Gullivers = list(map(int, input().split())) # 걸리λ²μ€μ νμ°¨λ³ λμ
Geminis_score = 0 # μ λ―Έλμ€ μ΄ μ μ
Gullivers_score = 0 # 걸리λ²μ€ μ΄ μ μ
win = False # μ λ―Έλμ€κ° ν λ²μ΄λΌλ 걸리λ²μ€μκ² μ΄κΈ΄ μ μ΄ μλμ§ μ¬λΆ
for i in range(9): # 0~9
Geminis_score += Geminis[i] # μ λ―Έλμ€μ κ° νμ°¨λ³ λμ ν©
if Geminis_score > Gullivers_score: #μ λ―Έλμ€κ° ν λ²μ΄λΌλ μ΄κΈ°κ³ μλμ§ μ²΄ν¬
win = True
Gullivers_score += Gullivers[i] # 걸리λ²μ€μ κ° νμ°¨λ³ λμ ν©
if Geminis_score < Gullivers_score and win: # μ λ―Έλμ€κ° ν λ²μ΄λΌλ μ΄κ²Όμ§λ§ μ΄ λμ μμ λ°λ € μ‘μ κ²½μ° μμ ν¨
result = "Yes"
else:
result = "No"
print(result) μ΄ μ½λμ
λλΉ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CμΈμ΄ μ€λλ§μ΄λ€μ!
μ λ C++λ‘ νμ΄λ΄€μ΅λλ€. λ§μ§λ§ νμΈμ bool λ³μλ₯Ό μ¬μ©νκ±° λ§κ³ λ μ 체μ μΌλ‘ λΉμ·ν λ‘μ§μΌλ‘ μ§ κ² κ°μμ!
PR μκ³ νμ
¨μ΅λλ€
#include <iostream>
using namespace std;
int main() {
int w[9], s[9];
for (auto& i : w) {
cin >> i;
}
for (auto& i : s) {
cin >> i;
}
int sumW = 0, sumS = 0;
bool leading = false;
for (int i = 0; i < 9; i++) {
sumW += w[i];
if (sumW > sumS) {
leading = true;
}
sumS += s[i];
}
if (leading) cout << "Yes";
else cout << "No";
return 0;
}
π λ¬Έμ λ§ν¬
https://www.acmicpc.net/problem/14582
βοΈ μμλ μκ°
30λΆ
β¨ μλ μ½λ
i[9]
,j[9]
μ μ μ₯j_score
μ 걸리λ²μ€ μ μg_scroe
μ μ μ₯νλ©° κ° νμ μ μλ₯Ό λΉκ΅j_score > g_score
λΌλ©΄win = 1
μΌλ‘ μ λ―Έλμ€κ° μ΄κΈ΄ μμ μ μ€μ j_score < g_score && win = 1
μΌ λyes
μΆλ ₯π₯οΈ μ½λ
π μλ‘κ² μκ²λ λ΄μ©
λ¬Έμ νΈμνλλΌ νκ³ μΆμ λ¬Έμ λ§ νμλλ° λ€μ prλΆν°λ μ λ μλ£κ΅¬μ‘° μ¬μ© ν΄λ³΄κ² μ΅λλ€... γ