Warning: session_start(): open(/tmp/sess_c7829552dbb61fa6100bf00fa83f5ccc, O_RDWR) failed: No space left on device (28) in /data/wiki/inc/init.php on line 239

Warning: session_start(): Failed to read session data: files (path: ) in /data/wiki/inc/init.php on line 239

Warning: Cannot modify header information - headers already sent by (output started at /data/wiki/inc/init.php:239) in /data/wiki/inc/auth.php on line 430

Warning: mkdir(): No space left on device in /data/wiki/lib/plugins/dw2pdf/vendor/mpdf/mpdf/src/Cache.php on line 19
Temporary files directory "/data/wiki/data/tmp/dwpdf/46/" is not writable
Writing /data/wiki/data/cache/5/51ec7b82cfe09dc5224ab801ce5c00c3.captchaip failed

Warning: Cannot modify header information - headers already sent by (output started at /data/wiki/inc/init.php:239) in /data/wiki/inc/actions.php on line 38

Warning: Cannot modify header information - headers already sent by (output started at /data/wiki/inc/init.php:239) in /data/wiki/lib/tpl/dokuwiki/main.php on line 12
2020-2021:teams:too_low:cfedu92hj [CVBB ACM Team]

用户工具

站点工具


2020-2021:teams:too_low:cfedu92hj

这是本文档旧的修订版!


A.LCM Problem

https://codeforces.com/contest/1389/problem/A

题意: 找到[l, r]范围内的两个数x < y使得其最小公倍数也在[l, r]范围内。

设x = p * gcd(x, y) ,y = q * gcd(x, y) ,pq互质。lcm(x, y) = pq*gcd(x, y)。 x确定时y = 2x 时lcm(x, y) = y取到最小值

x = l时存在解有= 2*l。判断r是否小于2*l即可。

点击以显示 ⇲

点击以隐藏 ⇱

#include <bits/stdc++.h>
 
using namespace std;
typedef long long LL;
 
 
 
int main() {
    int t = 0;
    cin >> t;
    while (t--) {
        LL l, r;
        cin>>l>>r;
        if(r < 2 * l)cout<<-1<<' '<<-1<<endl;
        else cout<<l<<' '<<2*l<<endl;
    }
 

B.Array Walk

题意:找到[l, r]范围内的两个数x, y使得其最小公倍数也在[l, r]范围内。

点击以显示 ⇲

点击以隐藏 ⇱

 

C.Good String

https://codeforces.com/contest/1389/problem/A 题意:找到[l, r]范围内的两个数x, y使得其最小公倍数也在[l, r]范围内。

点击以显示 ⇲

点击以隐藏 ⇱

 

D.Segment Intersections

https://codeforces.com/contest/1389/problem/A 题意:找到[l, r]范围内的两个数x, y使得其最小公倍数也在[l, r]范围内。

点击以显示 ⇲

点击以隐藏 ⇱

 

E.Segment Intersections

2020-2021/teams/too_low/cfedu92hj.1596186713.txt.gz · 最后更改: 2020/07/31 17:11 由 jim