• 个人简介

    inline int read() {int x=0,f=1;char ch=getchar();while(ch<'0'||ch>'9') {if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();return x*f;}
    

    zzx的考试宝典:考前必看mustseemustsee考前必看···must-see···must-see

    1.考试前不要太紧张,相信自己

    2.如果是模拟考,要严格要求自己,把他当成正常的比赛来做

    3.如果是排序题,还是2,4题,还是求最少操作几次,可以往求逆序对或求最长上升子序列的方向来想(最好往求最长上升子序列的方向来想)。

    4.思路往往是对的,但实现方式尽量选简短又容易找错的方式.

    1. 不要盲目追求高分:

    对于绝大多数选手而言,比赛拿奖、拿高分,最重要的是基础不失分,而不是难题多AC。

    因此,选手如考虑要去冲击高分,应先保证低分不丢,提前做好基础部分的检查工作。如果决定冲击高分,也可策略性地通过if语句对不同的数据规模执行不同的算法

    6.检查,检查,再检查:

    在比赛最后30分钟,选手应该开始检查的步骤。考试结束前,各位选手务必要二次确认自己的目录结构是否符合考场规范,同时检查各类文件名、程序内的输入输出语句等是否无误。切勿让此类低级错误影响自己的成绩。

    请确保自己的程序文件都成功提交且版本正确,是自己最后检查无误后的版本,最好提前十分钟提交,防止网络拥堵。

    《诗经·梅木》
    梅木冬溪,思慕晚意
    飞舞洒碧,碧漾东西
    梅覆梅木,梅游佳亭
    泉佳似广,梅忧寂极
    糙泥马壁,坻石洞溪
    时复思母,消愁东曦
    

    某些模板:

    二叉树前、中、后序遍历:
    #include <bits/stdc++.h>
    using namespace std;
    int n;
    vector<int> adj[1000001];
    void xian(int x)
    {
        cout<<x<<' ';
        if(adj[x][0]!=0)xian(adj[x][0]);
        if(adj[x][1]!=0)xian(adj[x][1]);
    }
    void zhong(int x)
    {
        if(adj[x][0]!=0)zhong(adj[x][0]);
        cout<<x<<' ';
        if(adj[x][1]!=0)zhong(adj[x][1]);
    }
    void hou(int x)
    {
        if(adj[x][0]!=0)hou(adj[x][0]);
        if(adj[x][1]!=0)hou(adj[x][1]);
        cout<<x<<' ';
    }
    int main()
    {
        // freopen("filename.in", "r", stdin);
        // freopen("filename.out", "w", stdout);
        cin>>n;
        for(int i=1;i<=n;i++)
        {
            int x,y;
            cin>>x>>y;
            adj[i].push_back(x);
            adj[i].push_back(y);
        }
        xian(1);
        cout<<endl;
        zhong(1);
        cout<<endl;
        hou(1);
        cout<<endl;
        return 0;
    }
    

    dij:

    struct nod
    {
    	int x,z;
    };
    bool operator <(nod xx,nod yy)
    {
    	return xx.z>yy.z;
    }
    vector<nod> adj[200100];
    int dis[1000001];
    bool flag[1000001];
    void sb(int s)
    {
    	priority_queue<nod> q;
    	q.push({s,0});
    	memset(dis,0x7f,sizeof(dis));
    	dis[s]=0;
    	while(!q.empty())
    	{
    		nod t=q.top();
    		q.pop();
    	//	cout<<t.x<<endl;
    		if(flag[t.x])
    			continue;
    		flag[t.x]=true;
    		for(int i=0;i<adj[t.x].size();i++)
    		{
    			nod tt=adj[t.x][i];
    			if(!flag[tt.x]&&dis[tt.x]>t.z+tt.z)
    			{
    				dis[tt.x]=t.z+tt.z;
    				q.push({tt.x,dis[tt.x]});
    			}
    		}
    	}
    }
    

    floyd:

    for(int k=1;k<=n;k++)
    {
    	for(int i=1;i<=n;i++)
    	{
    		for(int j=1;j<=n;j++)
    		{
    			if(i!=j && j!=k && i!=k)
    			{
    				c[i][j]=min(c[i][j],c[i][k]+c[k][j]);
    			}
    		}
    	}
    }
    

    快读:

    inline int read(){int x=0,f=1;char ch=getchar();while(ch<'0'||ch>'9') {if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9') x=(x<<3)+(x<<1)+(ch^48),ch=getchar();return x*f;}
    

    奇怪的东西

  • 通过的题目

  • 最近活动

    This person is lazy and didn't join any contests or homework.
  • 最近编写的题解

    This person is lazy and didn't write any solutions.
  • Stat

  • Rating

题目标签

系统测试
1