いろはちゃんとマス目 / Iroha and a Grid AtCoder - 1974 45分钟AK赛

Problem Statement

 

We have a large square grid with H rows and W columns. Iroha is now standing in the top-left cell. She will repeat going right or down to the adjacent cell, until she reaches the bottom-right cell.

However, she cannot enter the cells in the intersection of the bottom A rows and the leftmost B columns. (That is, there are A×B forbidden cells.) There is no restriction on entering the other cells.

Find the number of ways she can travel to the bottom-right cell.

Since this number can be extremely large, print the number modulo 109+7.

Constraints

 

  • 1≦H,W≦100,000
  • 1≦A<H
  • 1≦B<W

Input

 

The input is given from Standard Input in the following format:

H W A B

Output

 

Print the number of ways she can travel to the bottom-right cell, modulo 109+7.

Sample Input 1

 

2 3 1 1

Sample Output 1

 

2

We have a 2×3 grid, but entering the bottom-left cell is forbidden. The number of ways to travel is two: "Right, Right, Down" and "Right, Down, Right".

Sample Input 2

 

10 7 3 4

Sample Output 2

 

3570

There are 12 forbidden cells.

Sample Input 3

 

100000 100000 99999 99999

Sample Output 3

 

1

Sample Input 4

 

100000 100000 44444 55555

Sample Output 4

 

738162020
//44m36sAK!!!
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
#include <queue>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
ll gcd(ll a,ll b){
    return b?gcd(b,a%b):a;
}
bool cmp(int x,int y)
{
    return x>y;
}
const int N=2e5+20;
const ll mod=1e9+7;
ll f[N],n,m,A,B;
ll powmod(ll x,ll n)
{
    ll s=1;
    while(n){
        if(n&1)
            s=(s*x)%mod;
        x=(x*x)%mod;
        n>>=1;
    }
    return s;
}
ll C(ll n,ll m)
{
    ll a=f[n];
    ll b=(f[m]*f[n-m])%mod;
    return (a*powmod(b,mod-2))%mod;
}
int main()
{
    f[0]=1;
    for(ll i=1;i<N;i++)
        f[i]=(f[i-1]*i)%mod;
    while(cin>>n>>m>>A>>B){
        ll res=0;
        for(ll i=B+1;i<=m;i++){
            ll tmp=(C(i-1+n-A-1,n-A-1)*C(m-i+A-1,m-i))%mod;
            res=(res+tmp)%mod;
        }
        cout<<res<<endl;
    }
    return 0;
}

 

转载于:https://www.cnblogs.com/upstart/p/8982402.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
区块链系统性能测试流程主要包括功能测试、性能测试、可靠性测试和安全性测试。 功能测试是测试区块链平台是否按照设计要求正确运行,其中节点管理是功能测试的一个关键点。节点管理测试可以验证一个节点的正常运行是否代表整个系统正常运行。由于区块链是一个分布式的系统软件,测试过程需要融入分布式思想,而不是仅停留在中心化软件上。在场景模拟的过程中,需要验证软件、硬件以及区块链自身操作的各种组合,这被称为混沌测试。 性能测试是测试区块链平台在不同负载下的性能表现。一个常用的区块链性能测试框架是Caliper,它可以测试不同的区块链实现,如fabric、sawtooth和Iroha。通过性能测试,可以评估区块链系统在处理交易、执行智能合约等方面的性能指标。 可靠性测试是测试区块链平台在各种异常情况下的可靠性表现。例如,模拟网络中断、节点故障、数据损坏等情况,验证区块链系统是否能够正确处理异常并恢复正常运行。 安全性测试是测试区块链平台的安全性能。这包括验证区块链系统的身份验证、数据隐私、数据完整性和防止非法操作等方面的安全性。安全性测试可以通过模拟各种攻击场景,并对区块链平台的安全机制进行评估和验证。 综上所述,区块链系统性能测试流程包括功能测试、性能测试、可靠性测试和安全性测试,以确保区块链平台的功能正常、性能优越、可靠性高和安全性强。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [区块链测试(二):区块链测试](https://blog.csdn.net/qq_24792941/article/details/122541495)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [区块链性能测试工具caliper](https://blog.csdn.net/get_set/article/details/81055220)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值