跳到正文

leozhao123

1283988

不是这咕值要多久才能掉到 0 啊

在洛谷打开
资料、奖项与版本

资料

编号
1283988
抓取

noi linux 2.0 https://www.luogu.com.cn/discuss/1096885

KMP

%**████████████████████████████████████████████████████████**

Graph Editor

KaTeX\KaTeX 数学公式大全 | KaTeX\KaTeX supported

Markmap 在线思维导图

专栏 / 剪贴板 / 讨论区 保存站

Graph Editor

SHA 加密

原题机

历年真题题单

Template

C++
#include<map>
#include<set>
#include<queue>
#include<bitset>
#include<vector>
#include<climits>
#include<cstring>
#include<iostream>
#include<unordered_map>
using namespace std;
namespace leozhao123{

using ll=long long;
using ull=unsigned long long;
using pll=pair<ll,ll>;

//constexpr ll N=;
//constexpr ll M=;

void main() {
	cout<<'\n';
}

}
int main() {
	cin.tie(0)->sync_with_stdio(0);
	int _Task=1;
//	cin>>_Task;
	while(_Task--) leozhao123::main();
	return 0;
}

big 佬の bigint

AT_past202005_n ↓\Large\downarrow ↓\Large\downarrow

C++
int main() {
  scanf("%lld%lld", &n, &q);
  for (ll i = 0; i < n; i++) now[i] = i;
  set<ll> rev;
  for (ll i = 0; i < q; i++) {
    scanf("%lld%lld%lld", &t, &x, &y);
    x--; y--;
    if (t == 1) {
      if (now[x] < now[x+1]) counter[now[x]]++;
      else counter[now[x+1]]--;
      swap(now[x], now[x+1]);
      rev.erase(x);
      rev.erase(x+1);
      if (counter[now[x]] > 0) rev.insert(x);
      if (counter[now[x+1]] > 0) rev.insert(x+1);
    } else {
      for (auto it = rev.upper_bound(x); it != rev.end() && *it <= y;) {
        ll tmp = *it;
        while (x < tmp && now[tmp-1] > now[tmp]) {
          counter[now[tmp]]--;
          swap(now[tmp-1], now[tmp]), tmp--;
        }
        auto t = it;
        it++;
        rev.erase(t);
      }
      for (ll i = x; i <= y && counter[now[i]] > 0; i++) rev.insert(i);
    }
    //for (ll i = 0; i < n; i++) printf("%lld%c", now[i]+1, i == n-1 ? '\n' : ' ');
    //for (ll i = 0; i < n; i++) printf("%lld%c", counter[i], i == n-1 ? '\n' : ' ');
  }
  for (ll i = 0; i < n; i++) printf("%lld%c", now[i]+1, i == n-1 ? '\n' : ' ');
}

锑 1

锑 2

锑 3

共 3 篇
  1. 题解

    题解:P12747 [POI 2016 R3] 庆典巡游 Parade

    传送门 | AC 记录 题意:给定树,对于一条起点与终点不同的简单路径 P,称它的「权值」为满足 u∈ V_P 且 vnotin V_P 的边 (u,v) 的数量。求所有 P 的权值的最大值。 先不考虑起点与终点是否相同。记 f_u 为以节点 u 为起点、u 的子树中的节点(包括…

    1 赞
  2. 个人记录

    模板

    快速读写 离散化 矩阵 高精度 : )

    1 赞