#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
using namespace std;
string longest_common_suffix(string a,string b)
{
string tmp="";
int len1=a.size()-1;
int len2=b.size()-1;
while(len1>=0 && len2>=0)
{
if(a[len1]==b[len2]) {
tmp=a[len1]+tmp;
len1--;
len2--;
}
else break;
}
if(tmp=="") tmp="nai";
return tmp;
}
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
cin.get();
string a,b,c;
getline(cin,a);
for(int i=1;i<n;i++)
{
getline(cin,b);
c=longest_common_suffix(a,b);
a=c;
}
printf("%s\n",a.c_str());
}
return 0;
}
相关推荐
PotPlayer自用皮肤
自用 PotPlayer 皮肤,仅微调了字体大小与颜色,是按个人习惯调整,未做适配性调整。
浙大版《C语言程序设计(第3版)》题目集 练习4-3 求给定精度的简单交错序列部分和 (15 分)...
练习4-3 求给定精度的简单交错序列部分和 (15 分) 本题要求编写程序,计算序列部分和 1 - 1/4 + 1/7 - 1/10 + ... 直到最后一项的绝对值不大于给定精度eps。 输入格式: 输入在一行中给出一个正实数eps。 输出格式: 在一行中按照“sum = S”的格式输出部分和的值S,精确到小数点后六位。题目保证计算结果不超过双精度范围。 输入样例...
2-shell及常用命令-续.pdf
2-shell及常用命令-续.pdf
寒假作业2——Pintia小作业及编程题
编程题(电梯) Click to Github 听华一大大说可以用回溯算法,熟练运用搜索引擎的我就百度了一下,琢磨了很多天以为自己会了,真的看到题目还是一脸懵逼(#`-_ゝ-),提交的代码并没有用到回溯(因为不会),而且只能处理几组非常特殊的数据,但是担心截止时间前改不完就先提交了。 我的想法 -将五组数据按照请求时间进行排序 -根据时间顺序载客并作出选择 ...
R语言clusterProfiler实战:GO与KEGG富集分析从入门到精通
本文提供了一份详尽的R语言clusterProfiler实战指南,从环境配置、数据导入、基因ID转换到GO与KEGG富集分析及可视化,手把手教你解读生物学意义。文章重点介绍了如何利用clusterProfiler这一强大工具,将差异基因列表转化为清晰的生物学通路与功能故事,并分享了结果解读、可视化以及处理非模式生物等进阶技巧与避坑指南。
逆向工程师视角:拆解DataDome滑块验证码的3层防护机制与绕过思路
本文从逆向工程师视角,深入剖析DataDome滑块验证码的三层核心防护机制。第一层通过动态加密参数实现会话绑定与抗重放;第二层采集TLS指纹、鼠标轨迹动力学等多维行为数据进行一致性验证;第三层则是基于机器学习的后端异步风险决策引擎。文章不仅拆解了其技术原理,更分享了模拟、钩取等超越单纯工具调用的底层分析与绕过思路。
ZJU-PAT 1010. Radix (25)
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is "yes", if 6 is a decimal number and 110 is a binary number. Now for any pair of positive
36 Agent Memory:如何让智能体记住该记的东西
Agent 会调用工具,只能说明它有了行动能力。要让它跨会话、跨任务持续工作,还需要一套可治理的 Memory 系统。本文讲清上下文窗口、RAG 和 Agent Memory 的区别,以及工作记忆、情景记忆、语义记忆、程序记忆该如何分层设计。
ZJU-PAT 1065. A+B and C (64bit) (20)
Given three integers A, B and C in [-263, 263], you are supposed to tell whether A+B > C. Input Specification: The first line of the input gives the positive number of test cases, T ( Output
飞牛fnNAS个人小账本导入微信账单
本文介绍了将微信支付账单导入ezBookkeeping个人记账系统的详细方法。首先通过微信申请导出账单文件,接收后需进行Excel预处理:删除前导行、添加账户和分类列、整理金额格式等。在ezBookkeeping中需预先设置"微信"分类和账户。导入时需注意列映射关系,包括交易时间、账户名称等关键字段的对应设置。文章还提到处理交易标签、格式转换等细节问题,并建议避免使用"修改余额"功能。该方法同样适用于支付宝账单导入,解决了直接导入可能出现的格式不兼容问题。
基于YOLOv13+CBAM注意力机制
本教程详细介绍了CBAM注意力机制的原理及其在YOLOv13中的集成方法。CBAM通过通道注意力和空间注意力两个模块,动态调整特征权重以增强模型性能。通道模块利用池化操作和共享MLP生成通道权重,空间模块则通过池化和卷积生成空间权重。教程提供了在YOLOv13中实现CBAM的具体步骤,包括模块代码定义、模型配置修改等关键环节,帮助开发者在目标检测任务中提升模型表现。
ZJU-PAT 1080. Graduate Admission (30) 浙大2014年上机复试第四题
#include #include #include #include using namespace std; const int maxn=40005; const int maxm=101; int n,m,k; int num[maxm]; int lastRank[maxm]; vector mm[maxm]; struct stu { int id; int G
YOLOv8首创原创改进:即插即用|创新的轻量化非对称多级压缩LADH检测头
总结而言,本文介绍了一种名为轻量化非对称多级压缩LADH检测头的原创改进,该改进可与YOLOv8无缝适配,并显著提升了检测器的性能。在本文中,我们介绍了一种原创改进的检测头,名为轻量化非对称多级压缩LADH检测头,它可与YOLOv8无缝适配,显著提升了检测器的性能。此外,我们引入了多级压缩的概念,通过在不同的检测层级上应用不同程度的压缩,进一步提升了检测头的轻量化特性。具体而言,我们采用了逐级减少卷积核数量和通道数量的策略,以降低模型的参数量和计算复杂度,同时保持较高的检测精度。
ZJU-PAT 1079. Total Sales of Supply Chain (25) 浙大2014年上机复试第三题
#include #include using namespace std; struct Node { int parent; //父节点 bool flag; //是否是retailers int level; //第几层 int num; //销售多少个 }; Node tt[100005]; int n; double p,r,sum;
Unity 如何使用命令模式
命令模式 游戏中,当你想通过一种通用的方式来存储命令并能够撤消命令时,那么命令模式最有用。 在“示例”中,你将看到一个可以通过GUI按钮移动的简单点。 采取行动后,您可以撤消并重做。我在屏幕上添加了一个简单的OnGUI标签输出,因此您可以看到命令列表,并指出哪个是当前命令。 在此示例中使用了4个类: Command-这是任何命令模式都可以继承的基本结构(抽象类)。您可以在任何项目中使用此类。 MoveCommand-这是从Command类继承的结构,将使用Execute和UnExecute(撤消)。每个移
数字游民产业小报告 · 2025
2025 年全球数字游民约(不同统计口径差异很大,低估法约 4,000 万,高估法 8,000 万),美国来源占比最高。:2025 Q1 约岗位允许一定程度远程;2024 年美国员工至少部分远程(全球 2023 年约 28%)。:到 2025 年,提供数字游民/远程工作签证(媒体口径 50–73 个不等;福布斯 66、Citizen Remote 50+、有机构清单称 73)。:以英国为例,期望未来一年全勤到岗、企业因强制返岗出现离职,说明“灵活/远程”仍是劳动力市场的筹码之一。
ZJU-PAT 1057. Stack (30) 浙大2013年上机复试第三题
#pragma warning (disable:4786) #include #include #include #include #include using namespace std; int n,d;; int A[10005],B[10005]; int select(int num) { for(int i=1;i<=d;i++) B[i]=A[i];
汉书HE8,好用的汇编代码编写工具
汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大
ZJU-PAT 1070. Mooncake (25)
Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region's culture. Now
温度PID控制PLC程序
温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值
VC中sqlite的使用
在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示
ZJU-PAT 1081. Rational Sum (20)
模拟题 #pragma warning (disable:4786) #include #include #include #include #include #include #include using namespace std; long long int sum,ans,sum1; int n; struct Node { long long int numerato
廖雪峰Python教程[完整版]
廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白
ZJU-PAT 1054. The Dominant Color (20) 浙大2013年上机复试第一题
#pragma warning (disable:4786) #include #include #include #include using namespace std; int main() { int m,n; while(scanf("%d%d",&m,&n)!=EOF) { int i,j; string s; map ans;
ZJU-PAT 1055. The World's Richest (25) 浙大2013年上机复试第二题
#pragma warning (disable:4786) #include #include #include #include #include using namespace std; int m,n; int num,Min,Max; struct people { string name; int age,money; }; people TT[
ZJU-PAT 1056. Mice and Rice (25) 浙大2013年上机复试第四题
#pragma warning (disable:4786) #include #include #include #include #include #include using namespace std; int n,m; int B[100005]; int flag; int cnt;//第几轮次被淘汰 int group[1005],num_i
ZJU PAT 1012 The Best Rank
#include #include #include #include using namespace std; #define Min(a,b)(a<b?a:b) int n,m; struct student { int id,ctest,math,english; double avg; int crank,mrank,erank,arank; int bestrank; st
ZJU-PAT 1050
#include #include using namespace std; /* Sample Input: They are students. aeiou Sample Output: Thy r stdnts. */ bool myhash[150]; string s1,s2; void run() { getline(cin,s2); int i; string
ZJU-PAT 1051 Pop Sequence
#include #include #include using namespace std; int m,n,cases; stack f; int a[1005]; bool Judge() { while(f.empty()==false) f.pop(); int i,j; for(i=0;i<n;i++) scanf("%d",&a[i]); if(a[0]>m) re
2477



被折叠的 条评论
为什么被折叠?



