hdu 5063 Operation the Sequence】的更多相关文章

HDU 5063 Operation the Sequence 题目链接 把操作存下来.因为仅仅有50个操作,所以每次把操作逆回去执行一遍,就能求出在原来的数列中的位置.输出就可以 代码: #include <cstdio> #include <cstring> #include <algorithm> using namespace std; typedef long long ll; const int N = 100005; const ll MOD = 1000…
Operation the Sequence                                                                     Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)                                                                            …
http://acm.hdu.edu.cn/showproblem.php?pid=5063 题目大意: 题目意思还是比较简单.所以就不多少了.注意这句话,对解题有帮助. Type4: Q i query current value of a[i], this operator will have at most 50. 解题思路: 因为给定n和m都是100000,我们每一步都做具体的操作,时间将是O(n*m),肯定超时.最开始的时候 我怎么想都不知道怎么解决.以为是线段树.比赛完了以后,看了解…
http://acm.hdu.edu.cn/showproblem.php?pid=5063 思路:因为3查询最多50,所以可以在查询的时候逆操作找到原来的位置,然后再求查询的值. #include <cstdio> #include <iostream> #include <cstring> #include <algorithm> #define ll long long using namespace std; ; int n,m; ]; ]; ll…
题目链接:pid=5063" target="_blank">http://acm.hdu.edu.cn/showproblem.php?pid=5063 Problem Description You have an array consisting of n integers: a1=1,a2=2,a3=3,-,an=n. Then give you m operators, you should process all the operators in order…
注意到查询次数不超过50次,那么能够从查询位置逆回去操作,就能够发现它在最初序列的位置,再逆回去就可以求得当前查询的值,对于一组数据复杂度约为O(50*n). Operation the Sequence Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 463    Accepted Submission(s): 187 Problem…
#include <cstdio> #include <cstring> #include <cstdlib> #define MAXN 100005 #define MOD 1000000007 , rear = ; int n; void query(int index) { int r = rear; ; )>>; while (r-- > front) { ) { ++square; } ) { index = n+-index; } else…
Problem Description You have an array consisting of n integers: a1=1,a2=2,a3=3,-,an=n. Then give you m operators, you should process all the operators in order. Each operator is one of four types: Type1: O 1 call fun1(); Type2: O 2 call fun2(); Type3…
p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-size: 10.5000pt } h1 { margin-top: 5.0000pt; margin-bottom: 5.0000pt; text-align: center; font-family: 宋体; color: rgb(26,92,200); font-weight: bold; fo…
// 判断相同区间(lazy) 多校8 HDU 5828 Rikka with Sequence // 题意:三种操作,1增加值,2开根,3求和 // 思路:这题与HDU 4027 和HDU 5634 差不多 // 注意开根号的话,遇到极差等于1的,开根号以后有可能还是差1.如 // 2 3 2 3... // 8 9 8 9... // 2 3 2 3... // 8 9 8 9... // 剩下就是遇到区间相等的话,就直接开根号不往下传 #include <bits/stdc++.h> u…