λ°μν
https://www.acmicpc.net/problem/1267
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> v(n);
for(int i=0; i<n; i++)
cin >> v[i];
int y=0, m=0;
for(int i : v) {
i++;
y += (i/30)*10;
y += i%30>0 ? 10 : 0;
m += (i/60)*15;
m += i%60>0 ? 15 : 0;
}
if(y==m)
cout << "Y M " << y;
else if(y>m)
cout << "M " << m;
else
cout << "Y " << y;
return 0;
}
λ°μν
'π Baaaaaarking > 0x02κ° - κΈ°μ΄ μ½λ μμ± μλ Ή II' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[BOJ][C++] λ°±μ€ 2441λ²: λ³ μ°κΈ° - 4 (0) | 2023.05.19 |
---|---|
[BOJ][C++] λ°±μ€ 2440λ²: λ³ μ°κΈ° - 3 (0) | 2023.05.18 |
[BOJ][C++] λ°±μ€ 2587λ²: λνκ°2 (μμ½λ) (0) | 2023.05.12 |
[BOJ][C++] λ°±μ€ 2576λ²: νμ (0) | 2023.05.11 |
[BOJ][C++] λ°±μ€ 2490λ²: μ·λμ΄ (0) | 2023.05.10 |