-
Educational Codeforces Round 34 (Rated for Div. 2) - A.Hungry Student Problem코드포스(CodeForce) 2018. 8. 17. 18:20반응형
1. 문제
2. 알고리즘
키워드 - 구현
3. 코드
1234567891011121314151617181920212223242526272829303132333435#include <iostream>#include <vector>using namespace std;int main(){int n; cin >> n;vector<int> arr(n);for (int i = 0; i<n; i++)cin >> arr[i];for (int i = 0; i < n; i++) {bool bFind = false;for (int a = 0; a<=33; ++a) {int tmp = (arr[i] - 3 * a);if (tmp < 0)break;if (tmp % 7 == 0) {bFind = true;break;}}if(bFind)cout << "YES" << endl;elsecout << "NO" << endl;}return 0;}cs 반응형'코드포스(CodeForce)' 카테고리의 다른 글
Educational Codeforces Round 36 (Rated for Div. 2) - B. Browser (0) 2018.08.17 Educational Codeforces Round 35 (Rated for Div. 2) - A.Nearest Minimums (0) 2018.08.17 Educational Codeforces Round 33 (Rated for Div. 2) - A. Chess For Three (0) 2018.08.17 Educational Codeforces Round 32 - A. Local Extrema (0) 2018.08.17 Educational Codeforces Round 32 - B. Buggy Robot (0) 2018.08.17