社区讨论

5个测试点RE

P1076[NOIP 2012 普及组] 寻宝参与者 2已保存回复 1

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
1 条
当前快照
1 份
快照标识符
@mi6gxknw
此快照首次捕获于
2025/11/20 04:42
4 个月前
此快照最后确认于
2025/11/20 04:42
4 个月前
查看原帖
CPP
#include <stdio.h>
#include <cstdlib>
#include <iostream>
#include <math.h>
#include <time.h>
#include <sstream>
#include <string.h>
#include <list>
#include <algorithm>
using namespace std;
long long a,b,c[2000010],d[2000010],e,f=0,g,h[1100],h1=1, x,y,z;
int main()
{
    cin>>a>>b;
    for(x=1;x<=a*b;++x)
    {
        cin>>c[x]>>d[x];
        if(c[x])
            ++h[h1];
        if(x%b==0)
            ++h1;
    }
    cin>>e;
    ++e;
    for(x=1;x<=a;++x,--e)
    {
        f+=d[e+(x-1)*b];
        if(d[e+(x-1)*b]%h[x])
            g=d[e+(x-1)*b]%h[x];
        else
            g=h[x];
        for(y=0;y<g;++e)
        {
            if(e==b+1)
                e=1;
            if(c[e+(x-1)*b])
                ++y;
        }
        f%=20123;
    }
    cout<<f;
    return 0;
}

回复

1 条回复,欢迎继续交流。

正在加载回复...