这个真的是一个 \(nb\) 题。

考试快要结束的时候,在机房中只能听到此起彼伏的撕吼。

啊~~~~~~~~~~

然后人们预测这自己的得分。

\(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\) \(\color{red}{\huge{0}}\)

然后,没有然后了。

一共一半左右爆 \(\color{red}{\huge{0}}\)

然后战神直接 \(\color{gold}{\huge{260}}\)

\(\huge{\text{ % % %}}\)

Emotional Flutter

一个细节很多很多的贪心题目,然后只有一个水的一批的样例。

然后自己用着假的暴力拍着假的正解然后使用假的数据生成器拍了一堆 \(\color{green}{\huge{Accepted}}\)

然后险些有分,反正就是这个题目抱零了。。。

贪心一下,然后注意细节就好。。



#include<bits/stdc++.h>
using std::cout; using std::endl;
#define try(i,a,b) for(register signed i=a;i<=b;++i)
#define throw(i,a,b) for(register signed i=a;i>=b;--i)
#define asm(i,x) for(register signed i=head[x];i;i=edge[i].next)
namespace xin_io
{
#define sb(x) cout<<#x" = "<<x<<' '
#define jb(x) cout<<#x" = "<<x<<endl
#define debug cout<<"debug"<<endl
#define gc() p1 == p2 and (p2 = (p1 = buf) + fread(buf,1,1<<20,stdin),p1 == p2) ? EOF : *p1++
char buf[1<<20],*p1 = buf,*p2 = buf; int ak; typedef long long ll; typedef unsigned long long ull;
class xin_stream{public:template<typename type>inline xin_stream &operator >> (type &s)
{
register int f = 0;s = 0; register char ch = gc();
while(!isdigit(ch)) {f |= ch == '-'; ch = gc();}
while( isdigit(ch)) s = (s << 1) + (s << 3) + (ch xor 48),ch = gc(); return s = f ? -s : s,*this;
}}io;
}
#define int long long
using namespace xin_io; static const int maxn = 1e6+10,inf = 1e9+7; const ll llinf = 1e18+7;
namespace xin
{
int l[maxn],r[maxn],sum[maxn];
int T;
class xin_data
{
private:
friend bool operator < (xin_data x,xin_data y)
{return x.l == y.l ? x.r < y.r : x.l < y.l;}
public:
int l,r;
xin_data(){}
xin_data(int l,int r):l(l),r(r){}
}d[maxn]; int zhi = 0;
inline short main()
{
io >> T;
while(T--)
{
register int s,k,n,ok = 1; io >> s >> k >> n;
zhi = 0;
try(i,1,n)
{
register int x; io >> x;
if(i & 1) x += s;
else x -= s,x %= k;
if(x > k) ok = 0;
sum[i] = sum[i-1] + x;
if(i & 1)
l[i] = sum[i-1] + 1,r[i] = sum[i] - 1;
// sb(l[i]); jb(r[i]);
}
if(!ok) {puts("NIE"); continue;}
if(((n & 1) and sum[n] <= k) or (!(n & 1) and sum[n-1] <= k)) {puts("TAK"); continue;}
for(register int i=1;i<=n;++i,++i)
{
register int temp_l = l[i] % k,temp_r = r[i] % k;
if(temp_r < temp_l)
d[++zhi] = xin_data(0,temp_r),d[++zhi] = xin_data(temp_l,k-1);
else d[++zhi] = xin_data(temp_l,temp_r);
}
ok = 1;
std::sort(d+1,d+zhi+1);
if(d[1].l) {puts("TAK"); continue;}
int maxx = 0;
try(i,1,zhi)
{
if(maxx < d[i].l - 1) {puts("TAK"); ok = 0;break;}
maxx = std::max(maxx,d[i].r);
}
if(!ok) continue;
if(maxx < k - 1) puts("TAK");
else puts("NIE");
}
return 0;
}
}
signed main() {return xin::main();}

Medium Counting

这个计数题目看起来就不是很友好。。。。

我们考虑狂搜,然后抱零。

因为没有给任何狂搜的分数。

这么不给我 \(XIN\) 面子的嘛???

然后气展了。。。

然后应该是用记忆化来做。。

好办的很。。。



#include<bits/stdc++.h>
using std::cout; using std::endl;
#define try(i,a,b) for(register signed i=a;i<=b;++i)
#define throw(i,a,b) for(register signed i=a;i>=b;--i)
#define asm(i,x) for(register signed i=head[x];i;i=edge[i].next)
namespace xin_io
{
#define sb(x) cout<<#x" = "<<x<<' '
#define jb(x) cout<<#x" = "<<x<<endl
#define debug cout<<"debug"<<endl
#define gc() p1 == p2 and (p2 = (p1 = buf) + fread(buf,1,1<<20,stdin),p1 == p2) ? EOF : *p1++
#define cin std::cin
int ak; typedef long long ll; typedef unsigned long long ull;
#define scanf ak = scanf
}
#define int long long
using namespace xin_io; static const int maxn = 1e6+10,inf = 1e9+7,mod = 990804011; const ll llinf = 1e18+7;
namespace xin
{
int n,m;
int f[55][51][51][30];
int a[51][51];
int xin_team(int l,int r,int p,int c)
{
register int &temp = f[l][r][p][c];
if(~temp) return temp; if(r < l) return temp = 1;
if(p > m) return temp = (l == r); if(c > 26) return temp = 0;
temp = xin_team(l,r,p,c+1);
try(i,l,r)
{
if(!(a[i][p] == c or (a[i][p] == 27 and c))) break;
(temp += (xin_team(l,i,p+1,0) * xin_team(i+1,r,p,c+1)) % mod) %= mod;
}
return temp;
}
char s[maxn];
inline short main()
{
scanf("%lld",&n);
memset(f,-1,sizeof(f));
try(i,1,n)
{
scanf("%s",s+1);
int len = strlen(s+1);
m = std::max(m,len);
try(j,1,len) a[i][j] = (s[j] == '?') ? 27 : s[j] - 'a' + 1;
}
cout<<xin_team(1,n,1,0)<<endl;
return 0;
}
}
signed main() {return xin::main();}

Huge Counting

不会,先鸽了。。

字符消除2

题目就看了老半天。。。

我们用 \(KMP\) 求出来 \(next\) 数组就可以开始狂跳了。。

真好



#include<bits/stdc++.h>
using std::cout; using std::endl;
#define try(i,a,b) for(register signed i=a;i<=b;++i)
#define throw(i,a,b) for(register signed i=a;i>=b;--i)
#define asm(i,x) for(register signed i=head[x];i;i=edge[i].next)
namespace xin_io
{
#define gc() p1 == p2 and (p2 = (p1 = buf) + fread(buf,1,1<<20,stdin),p1 == p2) ? EOF : *p1++
#define debug cout<<"debug"<<endl
#define sb(x) cout<<#x" = "<<x<<' '
#define jb(x) cout<<#x" = "<<x<<endl
#define scanf ak = scanf
typedef long long ll; typedef unsigned long long ull; int ak;
}
using namespace xin_io; static const int maxn = 1e6+10,ms = 2e5;
namespace xin
{
char s[maxn];
ull a[maxn],p[maxn];
int T,n,temp;
int next[maxn];
int b[maxn];
ull base = 13331;
void kmp(int l,int r)
{
try(i,l+1,r)
{
while(temp and b[i] xor b[temp + 1]) temp = next[temp];
if(b[i] == b[temp + 1]) temp ++;
next[i] = temp;
}
}
int q[maxn];
inline short main()
{
scanf("%d",&T); p[1] = 1;
try(i,2,ms) p[i] = p[i-1] * base;
while(T--)
{
scanf("%s",s+1);
memset(next,0,sizeof(int) * (n + 1));
memset(b,0,sizeof(int) * (n + 1));
q[0] = temp = 0;
n = strlen(s+1);
try(i,1,n) a[i] = a[i-1] * base + s[i] - 'A' + 1;
try(i,0,n)
if(a[i+1] == a[n] - a[n-i-1] * p[i + 2]) q[++q[0]] = i + 1;
if(q[1] > 1) b[q[1]] = 1; kmp(1,q[1]);
try(i,2,q[0])
{
if(q[i] <= q[i-1] * 2)
{
try(j,q[i-1]+1,q[i])
b[j] = b[j + q[i-1] - q[i]];
kmp(q[i-1],q[i]);
}
else
{
kmp(q[i-1],q[i] - q[i-1] - 1);
register int now = temp,z = 1,len =q[i] - q[i-1];
while(now)
{
if(!b[now+1] and !(len % (len - now - 1))) {b[len] = 1; break;}
now = next[now];
}
if(!b[now+1] and !(len % (len - now - 1))) b[len] = 1;
kmp(len - 1,len);
next[len] = temp;
len = q[i] - q[i-1];
try(j,1,q[i-1]) b[len + j] = b[j];
kmp(len,len+q[i-1]);
}
}
try(i,1,n) cout<<b[i];
cout<<endl;
}
return 0;
}
}
signed main() {return xin::main();}

[考试总结]noip模拟44的更多相关文章

  1. 2021.8.19考试总结[NOIP模拟44]

    T1 emotional flutter 把脚长合到黑条中. 每个黑条可以映射到统一区间,实际操作就是左右端点取模.长度大于$k$时显然不合法. 然后检查一遍区间内有没有不被黑条覆盖的点即可. 区间端 ...

  2. noip模拟44[我想我以后会碰见计数题就溜走的]

    noip模拟44 solutions 这一场抱零的也忒多了,我也只有45pts 据说好像是把几套题里面最难的收拾出来让我们考得 好惨烈啊,这次的考试我只有第一题骗了40pts,其他都抱零了 T1 Em ...

  3. 6.17考试总结(NOIP模拟8)[星际旅行·砍树·超级树·求和]

    6.17考试总结(NOIP模拟8) 背景 考得不咋样,有一个非常遗憾的地方:最后一题少取膜了,\(100pts->40pts\),改了这么多年的错还是头一回看见以下的情景... T1星际旅行 前 ...

  4. 5.23考试总结(NOIP模拟2)

    5.23考试总结(NOIP模拟2) 洛谷题单 看第一题第一眼,不好打呀;看第一题样例又一眼,诶,我直接一手小阶乘走人 然后就急忙去干T2T3了 后来考完一看,只有\(T1\)骗到了\(15pts\)[ ...

  5. 5.22考试总结(NOIP模拟1)

    5.22考试总结(NOIP模拟1) 改题记录 T1 序列 题解 暴力思路很好想,分数也很好想\(QAQ\) (反正我只拿了5pts) 正解的话: 先用欧拉筛把1-n的素数筛出来 void get_Pr ...

  6. 2021.9.17考试总结[NOIP模拟55]

    有的考试表面上自称NOIP模拟,背地里却是绍兴一中NOI模拟 吓得我直接文件打错 T1 Skip 设状态$f_i$为最后一次选$i$在$i$时的最优解.有$f_i=max_{j<i}[f_j+a ...

  7. [考试总结]noip模拟23

    因为考试过多,所以学校的博客就暂时咕掉了,放到家里来写 不过话说,vscode的markdown编辑器还是真的很好用 先把 \(noip\) 模拟 \(23\) 的总结写了吧.. 俗话说:" ...

  8. 「考试」noip模拟9,11,13

    9.1 辣鸡 可以把答案分成 每个矩形内部连线 和 矩形之间的连线 两部分 前半部分即为\(2(w-1)(h-1)\),后半部分可以模拟求(就是讨论四种相邻的情况) 如果\(n^2\)选择暴力模拟是有 ...

  9. 6.11考试总结(NOIP模拟7)

    背景 时间分配与得分成反比,T1 20min 73pts,T2 1h 30pts,T3 2h 15pts(没有更新tot值,本来应该是40pts的,算是本次考试中最遗憾的地方了吧),改起来就是T3比较 ...

随机推荐

  1. 复杂多变场景下的Groovy脚本引擎实战

    一.前言 因为之前在项目中使用了Groovy对业务能力进行一些扩展,效果比较好,所以简单记录分享一下,这里你可以了解: 为什么选用Groovy作为脚本引擎 了解Groovy的基本原理和Java如何集成 ...

  2. Kotlin高阶函数实战

    前言 1. 高阶函数有多重要? 高阶函数,在 Kotlin 里有着举足轻重的地位.它是 Kotlin 函数式编程的基石,它是各种框架的关键元素,比如:协程,Jetpack Compose,Gradle ...

  3. clickhouse的windowFunnel(漏斗)

    1.WindowFunnel 关于官网的解释: Returned value:Integer. The maximum number of consecutive triggered conditio ...

  4. STM32—驱动DHT11数字温湿度传感器

    文章目录 DHT11模块简介 DHT11数据传输 DHT11通信时序 代码实现 相关引脚初始化 复位模块 判断响应模块 读取数据包模块 DHT11模块简介 DHT11数字温湿度传感器,用来测量环境的温 ...

  5. linux中文件内核数据结构

    3.文件io 3.1 文件内核数据结构 3.2 复制文件描述符的内核数据结构 3.3 对指定的描述符打印文件标志 #include "apue.h" #include <fc ...

  6. MySQL基本概念及增删改查操作

    SQL.DB.DBMS关系 DB: DataBase(数据库,数据库实际上在硬盘上以文件的形式存在) DBMS: DataBase Management System(数据库管理系统,常见的有:MyS ...

  7. 题解 marshland

    传送门 是个最大费用可行流 这题的建边很毒瘤 首先有危险度的点肯定要拆点 关键在于其它点怎么办 如果拆了不好保证每个点只经过一次 不拆连网络流都跑不了 但仔细观察题面,不能不难(???)发现一个L中那 ...

  8. SynchronizedMap和ConcurrentHashMap有什么区别

    SynchronizedMap实现上在调用Map的所有方法是,对整个map进行了同步! public V put(K key, V value) { synchronized (mutex) {ret ...

  9. 在Activity和附贴的Fragment中同时使用多Surface错乱解决

    SurfaceView因为独特的双缓冲机制,在android应用中十分普遍,视频播放器.摄像机预览等都会用到,如果在两个Fragment或者一个Fragment和Activity同时使用都会造成无法正 ...

  10. C#中的信号量---Semaphore

    emaphore是System.Threading下的类,限制可同时访问某一资源或资源池的线程数. 常用构造方法 https://msdn.microsoft.com/zh-cn/library/e1 ...