UOJ Logo TKD的博客

博客

标签

大家都新年快乐啊

2015-02-18 13:14:17 By TKD

(话说这好像是第一个拜年的文章)

祝进队:vfleaking saffah

祝NOI金牌:WuHongxun matthew99 sunflower 1756500824

祝noip不考挂:TKD

(为什么@ 不能用= =)

以及祝所有UOJ的伙伴们达到自己的目标,实现自己的梦想。

祝所有OIer新年更开心、幸福。

吐槽

2014-11-30 12:31:47 By TKD

1.为神马没有uoj创建&维护人员的名单

2.为神马没有更新记录

3.为神马没有解题排名,就是像BZOJ的那种

4.为啥比赛那么少,不是每周一次吗

没了。。。

毕竟我只是个HB的大蒟蒻。。。

orz vfleaking


Do not go gentle into that good night, Old age should burn and rave at close of day; Rage, rage against the dying of the light.

Though wise men at their end know dark is right, Because their words had forked no lightning they Do not go gentle into that good night.   

Good men, the last wave by, crying how bright Their frail deeds might have danced in a green bay, Rage, rage against the dying of the light.   

Wild men who caught and sang the sun in flight, And learn, too late, they grieved it on its way, Do not go gentle into that good night.

Grave men, near death, who see with blinding sight Blind eyes could blaze like meteors and be gay, Rage, rage against the dying of the light.   

And you, my father, there on the sad height, Curse, bless, me now with your fierce tears, I pray. Do not go gentle into that good night. Rage, rage against the dying of the light.

求教

2014-11-11 13:30:19 By TKD

为啥我的时间复杂度不够小?

D2T3

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#define MOD1 1000000010
#define MOD2 1000000008
using namespace std;
struct BIG_NUM
{
    long long s[10010];
    int l;
}k[110];
long long ss[10010];
int next[1000010],last[1000010];
int n,m,flag[110],flags[1000010];
int ans[1000010],nums,numo;
long long o[110][4];
long long mod_it(BIG_NUM u,int d)
{
    long long b=1000000000000000000%d;
    for(int i=u.l;i>=1;i--)
    {
        long long p=u.s[i]%d;
        if(i-1!=0)
            u.s[i-1]+=(b*p)%d;
        else
            return p;
    }
    return 0;
}
void get_it(int x)
{
    char c[10010];
    scanf("%s",c);
    int len=strlen(c);
    if(c[0]=='0'&&len==1)
    {
        k[x].l=0;
        return;
    }
    if(c[0]=='-')
    {
        flag[x]=1;
        int nows=0;
        k[x].l=(len+16)/18;
        for(int i=len-1;i>=1;i-=18)
        {
            nows++;
            for(int j=max(i-17,1);j<=i;j++)
            {
                k[x].s[nows]*=10;
                k[x].s[nows]+=(c[j]-'0');
            }
        }
        return;
    }
    int nows=0;
    k[x].l=(len+17)/18;        
    for(int i=len-1;i>=0;i-=18)
    {
        nows++;
        for(int j=max(i-17,0);j<=i;j++)
        {
            k[x].s[nows]*=10;
            k[x].s[nows]+=(c[j]-'0');
        }
    }
    return;
}
void read_in()
{
    scanf("%d%d",&n,&m);
    for(int i=0;i<=n;i++)
        get_it(i);
    return;
}
void about_zero()
{
    for(int i=1;i<=m;i++)
    {
        next[i]=i+1;
        last[i]=i-1;
    }
    for(int i=1;i<=m;i=next[i])
    {
        if(mod_it(k[0],i)==0)
        {
            nums++;
            ans[nums]=i;
            continue;
        }
        for(int j=2*i;j<=m;j+=i)
        {
            if(flags[j])
                continue;
            flags[j]=1;
            next[last[j]]=next[j];
            last[next[j]]=last[j];
        }
    }
    return;
}
void judge_them()
{
    for(int i=0;i<=n;i++)
    {
        o[i][1]=mod_it(k[i],MOD1);
        o[i][2]=mod_it(k[i],MOD2);
    }
    for(int i=1;i<=nums;i++)
    {
        long long p=ans[i],c[3];
        long long ans1[3],ans2[3];
        ans1[1]=0;
        ans1[2]=0;
        ans2[1]=0;
        ans2[2]=0;
        c[1]=1;
        c[2]=1;
        for(int j=0;j<=n;j++)
        {
            if(flag[j])
            {
                ans1[1]+=(o[j][1]*c[1])%MOD1;
                ans1[2]+=(o[j][2]*c[2])%MOD2;
            }
            else
            {
                ans2[1]+=(o[j][1]*c[1])%MOD1;
                ans2[2]+=(o[j][2]*c[2])%MOD2;
            }
            c[1]=(c[1]*p)%MOD1;
            c[2]=(c[2]*p)%MOD2;
        }
        ans1[1]%=MOD1;
        ans1[2]%=MOD2;
        ans2[1]%=MOD1;
        ans2[2]%=MOD2;
        if(ans1[1]==ans2[1]&&ans1[2]==ans2[2])
        {
            numo++;
            ans[numo]=ans[i];
        }
    }
    return;
}
void put_out()
{
    printf("%d\n",numo);
    for(int i=1;i<=numo;i++)
        printf("%d\n",ans[i]);
    return;
}
int main()
{
    freopen("equation.in","r",stdin);
    freopen("equation.out","w",stdout);
    read_in();
    about_zero();
    judge_them();
    put_out();
}

难道是a0太坑了?1~100000都是它的约数?

。。。。。。。不明白

O(a0的约数个数 乘 压位的高精度(约555)+a0的约数个数 乘 n)

(吐槽一下,markdown打不出乘号。。。。)

求为何爆时限







看啥看,我是个蒟蒻~

我是来干正事的。。。(怎么感觉说出来没自信呢)

2014-11-04 19:47:50 By TKD

@vfleaking

这个题目怎么样?

数据在这

(我可以推荐一下题目吧

总觉得这个题目的解法很巧妙(虽然简单),而且也很适合uoj。。。)

PS:在私信里为何不能Ctrl+Enter发送。。。

对签名/格言也是很期待的。。。。。

Do not go gentle into that good night, Old age should burn and rave at close of day; Rage, rage against the dying of the light.

Though wise men at their end know dark is right, Because their words had forked no lightning they Do not go gentle into that good night.   

Good men, the last wave by, crying how bright Their frail deeds might have danced in a green bay, Rage, rage against the dying of the light.   

Wild men who caught and sang the sun in flight, And learn, too late, they grieved it on its way, Do not go gentle into that good night.

Grave men, near death, who see with blinding sight Blind eyes could blaze like meteors and be gay, Rage, rage against the dying of the light.   

And you, my father, there on the sad height, Curse, bless, me now with your fierce tears, I pray. Do not go gentle into that good night. Rage, rage against the dying of the light.

祝大家联赛好运(至于NOI Au大神就算了。。。。)

共 14 篇博客