[백준] 24544 카카오뷰 큐레이팅 효용성 분석

0

백준

목록 보기
261/271
post-thumbnail
post-custom-banner

[백준] 24544 카카오뷰 큐레이팅 효용성 분석

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);

	int N;
	cin >> N;

	vector<int> fun;
	for (int i = 0; i < N; ++i) {
		int input;
		cin >> input;
		fun.push_back(input);
	}

	long long sum1 = 0;
	long long sum2 = 0;
	for (int i = 0; i < N; ++i) {
		int flag;
		cin >> flag;
		
		sum1 += (long long)fun[i];
		if (!flag) sum2 += (long long)fun[i];
	}
	cout << sum1 << "\n" << sum2;
	return 0;
}

profile
Be able to be vulnerable, in search of truth
post-custom-banner

0개의 댓글