I have recorded a screencast & editorial for Codeforces Round 947 (Div. 1 + Div. 2). It will upload on https://youtu.be/DrBmSO86xUQ in an hour or two.
UPD: the video is uploaded.
| № | Пользователь | Рейтинг |
|---|---|---|
| 1 | Benq | 3676 |
| 2 | Kevin114514 | 3657 |
| 3 | jiangly | 3638 |
| 4 | turmax | 3442 |
| 5 | tourist | 3380 |
| 6 | Um_nik | 3353 |
| 7 | strapple | 3350 |
| 8 | squareOf105 | 3346 |
| 9 | heuristica | 3322 |
| 10 | maroonrk | 3310 |
| Страны | Города | Организации | Всё → |
| № | Пользователь | Вклад |
|---|---|---|
| 1 | Qingyu | 158 |
| 2 | nik_exists | 150 |
| 2 | maspy | 150 |
| 4 | AmShZ | 144 |
| 5 | Um_nik | 143 |
| 6 | Errichto | 139 |
| 7 | adamant | 137 |
| 8 | BledDest | 135 |
| 9 | maroonrk | 133 |
| 10 | qwexd | 130 |
I have recorded a screencast & editorial for Codeforces Round 947 (Div. 1 + Div. 2). It will upload on https://youtu.be/DrBmSO86xUQ in an hour or two.
UPD: the video is uploaded.
| Название |
|---|



You should add "screencast" to the title so that it differs from the announcement title.
Thank you!
Auto comment: topic has been updated by orz (previous revision, new revision, compare).
I guess there is some issue in judgement of question B
Below are the two solutions , both are accepted
but both are giving diffrent answers on this test case
n = 4
arr = [4 , 8 , 20 , 10] answer should be yes
this is the first solution( giving YES for the above test case)
include<bits/stdc++.h>
using namespace std;
int main() { int tt; cin >> tt; for(int t = 0; t < tt; t++ ) { int n; cin >> n; int a[n]; set s; for(int i=0; i<n; i++) { cin>>a[i]; s.insert(a[i]); } sort(a,a+n);
if(*s.begin() == 1 || s.size() == 1 ) { cout << "YES" << endl; } else { int a1 = *s.begin(); int a2 = *(++s.begin()); for(int i=0; i<n; i++) { if( a[i] % a[0] != 0 ) { a2 = a[i]; break; } // if( __gcd(a[i] , a[0]) == 1 ) { // a2 = a[i]; // break; // } } // cout << a1 << " " << a2 << endl; bool flag = 1; for(int i=0; i<n; i++ ) { if( (a[i]%a1 != 0) && (a[i]%a2 != 0) ) { flag = 0; break; } } if( flag ) cout << "YES" << endl; else cout << "NO" << endl; } }}
Below is the second one (giving NO for the above test case)
include<bits/stdc++.h>
using namespace std;
int main() { int tt; cin >> tt; for(int t = 0; t < tt; t++ ) { int n; cin >> n; int a[n]; sets; for(int i=0; i<n; i++) { cin>>a[i]; s.insert(a[i]); } sort(a,a+n);
if(*s.begin() == 1 || s.size() == 1 ) { cout << "YES" << endl; } else { int a1 = *s.begin(); int a2 = *(++s.begin()); for(int i=0; i<n; i++) { // if( a[i] % a[0] != 0 ) { // a2 = a[i]; // break; // } if( __gcd(a[i] , a[0]) == 1 ) { a2 = a[i]; break; } } // cout << a1 << " " << a2 << endl; bool flag = 1; for(int i=0; i<n; i++ ) { if( (a[i]%a1 != 0) && (a[i]%a2 != 0) ) { flag = 0; break; } } if( flag ) cout << "YES" << endl; else cout << "NO" << endl; } }}
why both are accepting
Please send both solutions to the problem and hack one of them using the corresponding interface.
Auto comment: topic has been updated by orz (previous revision, new revision, compare).