04 2020 档案
摘要:```c++ #include #include int a[100010]; int main() { int n, q; scanf("%d", &n); for (int i = 1; i > 1; if (a[mid] >= x) { ans = mid; r = mid - 1; } else l = mid + 1; } if (ans == -1 || a[ans] != x) pr
阅读全文
摘要:数据结构大师 时间限制: 1 Sec 内存限制: 128 MB [提交] [状态] 题目描述 小Z是个数据结构高手,这天他得到了一个由左括号和右括号组成的字符串。随之而来的是m次询问,对于第i次询问,小Z需要回答出这个字符串的第li到ri个字符组成的字串中最长的合法括号子序列的长度。 小Z认为一个由
阅读全文
摘要:问题 D: Olympic Bus 时间限制: 1 Sec 内存限制: 128 MB 题目描述 There are N cities in JOI Kingdom, numbered from 1 to N. There are M bus lines connecting cities, numb
阅读全文
摘要:```c++ ll pow_mod(ll a,ll b) { ll res = 1; while (b) { if (b & 1) res = res * a % mod; a = a * a % mod; b >>= 1; } return res; } ```
阅读全文
摘要:```#include using namespace std;const int maxn=1e5+10;int a[maxn];int n;int up(int n) { int i = n; while (i != 1 && a[i] a[i + 1]) { i++; } if (a[i] = 1; i--) { ...
阅读全文

浙公网安备 33010602011771号