From 80315d4d96bb676ad3eb89d17fdc94f6d724c217 Mon Sep 17 00:00:00 2001 From: EthanH3514 <1326414961@qq.com> Date: Thu, 23 Nov 2023 00:51:55 +0800 Subject: [PATCH] Site updated: 2023-11-23 00:51:52 --- .../index.html" | 4 +- .../index.html" | 2 +- .../index.html" | 4 +- .../index.html" | 4 +- .../23/\351\232\217\350\256\260/index.html" | 2 +- .../index.html" | 4 +- .../index.html" | 4 +- .../index.html" | 2 +- .../index.html" | 2 +- .../index.html" | 8 +- .../index.html" | 8 +- .../index.html" | 4 +- .../index.html" | 4 +- .../index.html" | 6 +- .../index.html" | 12 +- .../index.html" | 8 +- .../index.html" | 12 +- .../index.html" | 4 +- .../index.html" | 6 +- .../index.html" | 8 +- .../index.html" | 8 +- .../index.html" | 6 +- .../index.html" | 10 +- .../index.html" | 10 +- .../index.html" | 2 +- .../index.html" | 4 +- .../index.html" | 8 +- .../index.html" | 10 +- .../index.html" | 12 +- .../index.html" | 4 +- .../FFT\346\250\241\346\235\277/index.html" | 6 +- .../index.html" | 6 +- .../index.html" | 2 +- .../index.html" | 8 +- .../index.html" | 4 +- .../index.html" | 8 +- .../index.html" | 8 +- .../index.html" | 6 +- .../index.html" | 2 +- .../03/\351\232\217\350\256\260-1/index.html" | 2 +- .../index.html" | 8 +- .../index.html" | 4 +- .../index.html" | 4 +- .../index.html" | 8 +- .../index.html" | 6 +- .../index.html" | 6 +- .../index.html" | 8 +- .../index.html" | 6 +- 2023/06/16/HDU-4578-Transformation/index.html | 4 +- .../index.html" | 4 +- .../index.html" | 8 +- .../index.html" | 8 +- .../index.html" | 6 +- .../index.html" | 8 +- .../index.html" | 4 +- .../index.html" | 4 +- .../index.html" | 8 +- .../index.html" | 8 +- .../index.html" | 10 +- .../index.html" | 8 +- .../index.html" | 12 +- .../index.html" | 24 +- .../index.html" | 10 +- archives/2022/10/index.html | 386 ++--- archives/2022/12/index.html | 418 +++--- archives/2022/index.html | 406 +++--- archives/2022/page/2/index.html | 400 +++--- archives/2023/01/index.html | 412 +++--- archives/2023/01/page/2/index.html | 404 +++--- archives/2023/02/index.html | 408 +++--- archives/2023/03/index.html | 410 +++--- archives/2023/04/index.html | 422 +++--- archives/2023/05/index.html | 412 +++--- archives/2023/06/index.html | 406 +++--- archives/2023/06/page/2/index.html | 404 +++--- archives/2023/11/index.html | 412 +++--- archives/2023/index.html | 394 +++--- archives/2023/page/2/index.html | 418 +++--- archives/2023/page/3/index.html | 400 +++--- archives/2023/page/4/index.html | 408 +++--- archives/2023/page/5/index.html | 408 +++--- archives/2023/page/6/index.html | 386 ++--- archives/index.html | 432 +++--- archives/page/2/index.html | 406 +++--- archives/page/3/index.html | 414 +++--- archives/page/4/index.html | 408 +++--- archives/page/5/index.html | 404 +++--- archives/page/6/index.html | 414 +++--- archives/page/7/index.html | 414 +++--- atom.xml | 6 +- index.html | 94 +- page/2/index.html | 62 +- page/3/index.html | 54 +- page/4/index.html | 58 +- page/5/index.html | 92 +- page/6/index.html | 40 +- page/7/index.html | 10 +- tags/153/index.html | 156 +- tags/2021/index.html | 148 +- tags/2022/index.html | 172 +-- tags/2023/index.html | 202 +-- tags/284/index.html | 146 +- tags/AtCoder/index.html | 164 ++- tags/Beginner-Contest/index.html | 162 ++- tags/C/index.html | 444 +++--- tags/C/page/2/index.html | 434 +++--- tags/C/page/3/index.html | 430 +++--- tags/C/page/4/index.html | 430 +++--- tags/CCPC/index.html | 156 +- tags/ChatGPT/index.html | 150 +- tags/CodeForce/index.html | 170 +-- tags/Codeforces/index.html | 204 +-- tags/Div-1-Div-2/index.html | 164 ++- tags/Div-2/index.html | 166 ++- tags/Div-3/index.html | 180 +-- tags/Div-4/index.html | 156 +- tags/FFT/index.html | 154 +- tags/GCPC/index.html | 158 ++- tags/HNCPC/index.html | 152 +- tags/Hello-2023/index.html | 148 +- tags/ICPC/index.html | 154 +- tags/Linux/index.html | 160 ++- tags/NEERC/index.html | 148 +- tags/NEUQ/index.html | 138 +- tags/Profile-Readme/index.html | 144 +- tags/RSS/index.html | 150 +- tags/Region/index.html | 152 +- tags/Regular-Contest/index.html | 156 +- tags/Round-842/index.html | 150 +- tags/Round-844/index.html | 146 +- tags/Round-849/index.html | 156 +- .../Stein\347\256\227\346\263\225/index.html" | 162 ++- tags/TLE/index.html | 144 +- tags/VSCode/index.html | 150 +- tags/XJTUPC/index.html | 158 ++- tags/gcd/index.html | 224 ++- tags/host/index.html | 148 +- tags/index.html | 152 +- tags/markdown/index.html | 150 +- tags/particlex/index.html | 152 +- .../index.html" | 148 +- .../index.html" | 148 +- .../index.html" | 142 +- .../index.html" | 142 +- "tags/\345\215\227\344\272\254/index.html" | 144 +- .../index.html" | 148 +- "tags/\345\221\275\344\273\244/index.html" | 146 +- .../index.html" | 152 +- "tags/\345\237\272\347\241\200/index.html" | 150 +- .../index.html" | 152 +- "tags/\345\250\201\346\265\267/index.html" | 164 ++- .../index.html" | 184 +-- .../index.html" | 174 ++- .../index.html" | 142 +- .../index.html" | 148 +- .../index.html" | 154 +- "tags/\345\277\253\350\257\273/index.html" | 154 +- "tags/\346\200\235\347\273\264/index.html" | 1257 +++++++++++++++++ "tags/\346\214\207\344\273\244/index.html" | 152 +- "tags/\346\220\234\347\264\242/index.html" | 158 ++- "tags/\346\225\231\347\250\213/index.html" | 158 ++- "tags/\346\225\260\345\255\246/index.html" | 168 +-- "tags/\346\225\260\350\256\272/index.html" | 158 ++- "tags/\346\226\260\345\206\240/index.html" | 148 +- "tags/\346\234\237\346\234\233dp/index.html" | 160 ++- .../index.html" | 146 +- "tags/\346\250\241\346\235\277/index.html" | 166 ++- "tags/\346\264\233\350\260\267/index.html" | 172 +-- "tags/\346\267\261\345\234\263/index.html" | 156 +- .../index.html" | 156 +- "tags/\347\211\233\345\256\242/index.html" | 220 +-- .../index.html" | 150 +- .../index.html" | 162 ++- "tags/\347\256\227\346\263\225/index.html" | 166 ++- .../index.html" | 454 +++--- .../page/2/index.html" | 458 +++--- .../page/3/index.html" | 448 +++--- .../page/4/index.html" | 490 ++++--- "tags/\347\263\273\347\273\237/index.html" | 138 +- .../index.html" | 150 +- "tags/\347\276\216\350\265\233/index.html" | 150 +- .../index.html" | 146 +- "tags/\350\256\260\345\275\225/index.html" | 152 +- .../index.html" | 152 +- "tags/\350\270\251\345\235\221/index.html" | 142 +- "tags/\351\200\206\345\205\203/index.html" | 130 +- "tags/\351\232\217\350\256\260/index.html" | 140 +- "tags/\351\242\230\350\247\243/index.html" | 370 ++--- .../page/2/index.html" | 378 ++--- .../page/3/index.html" | 372 ++--- .../index.html" | 158 ++- .../index.html" | 150 +- 192 files changed, 16620 insertions(+), 13775 deletions(-) create mode 100644 "tags/\346\200\235\347\273\264/index.html" diff --git "a/2022/10/05/SHU\351\253\230\346\225\260\346\240\241\350\265\233\344\270\255\344\270\200\351\201\223\346\235\277\351\242\230/index.html" "b/2022/10/05/SHU\351\253\230\346\225\260\346\240\241\350\265\233\344\270\255\344\270\200\351\201\223\346\235\277\351\242\230/index.html" index 462eb7adf..87a367e84 100644 --- "a/2022/10/05/SHU\351\253\230\346\225\260\346\240\241\350\265\233\344\270\255\344\270\200\351\201\223\346\235\277\351\242\230/index.html" +++ "b/2022/10/05/SHU\351\253\230\346\225\260\346\240\241\350\265\233\344\270\255\344\270\200\351\201\223\346\235\277\351\242\230/index.html" @@ -304,14 +304,14 @@
给一个长度为
对数组进行多次查询,每次查询数组的一个连续区间
一开始以为是预处理,想了很久不知道怎么搞,想过st表,线段树,但感觉都做不了
突然发现后缀的
然后想到后缀gcd可能收敛的特别快,以至于可以改变复杂度
想了一下发现是log的速度,设目前的后缀gcd为
于是暴力就是对的
但是需要注意一下没有贡献的
而相等的一串是可以直接跳过去的,采用静态链表跳转,保证了复杂度是
#pragma GCC optimize(2)#include<bits/stdc++.h>using namespace std;typedef long long ll;#define int long longtypedef unsigned long long ull;#define dmp(x) cerr<<"DEBUG"<<__LINE__<<":"<<#x<<" "<<x<<endlconst ll INF=0x3f3f3f3f3f3f3f3fLL;typedef pair<int,int> pii;const int N=6e5+5;int a[N],lt[N];signed main() {::sync_with_stdio(false);cin.tie(0); iosint n,m; >>n>>m; cinfor(int i=1;i<=n;i++){ >>a[i]; cin} for(int i=1;i<=n;i++) [i]=i-1; ltfor(int i=1;i<=n;i++){ if(a[i-1]%a[i]==0) [i]=lt[i-1]; lt} for(int i=1;i<=m;i++){ int l,r; >>l>>r; cinint ans=1,now=a[r]; for(int j=r;j>=l;j=lt[j]){ int tmp=__gcd(now,a[j]); if(tmp!=now) ++; ans=tmp; nowif(now==1) break; } <<ans<<'\n'; cout} return 0; }