Submission #658456


Source Code Expand


#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <cmath>
#include <stack>
using namespace std;
typedef unsigned char byte;
typedef long long int LLint;
typedef unsigned long long int uLLint;

LLint combi(LLint n, LLint r){
    LLint i;
    LLint p=1;

    for (i=1;i<=r;i++)
        p=p*(n-i+1)/i%1000000007LL;
    return p;
}

int calcr(int w,int h,int x,int y){
    if (x==w && h==y) return 1;
    if (w<x || h<y) return 0;
    return calcr(w,h,x+1,y)+calcr(w,h,x,y+1);
}

int calc(int w,int h){
    if (w<h) return calc(h,w);
    return calcr(w,h,1,1);
}

int main(){
    LLint w,h,f;
    
    cin>>w>>h;
    
    cout<<calc(w,h)<<endl;
    
    return 0;
}

Submission Info

Submission Time
Task C - 経路
User m_buyoh
Language C++11 (GCC 4.9.2)
Score 50
Code Size 740 Byte
Status TLE
Exec Time 2037 ms
Memory 7068 KB

Judge Result

Set Name Sample Dataset1 Dataset2 All
Score / Max Score 0 / 0 50 / 50 0 / 50 0 / 1
Status
AC × 1
TLE × 1
AC × 12
AC × 12
TLE × 12
AC × 12
TLE × 23
Set Name Test Cases
Sample s0.txt, s1.txt
Dataset1 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, s0.txt
Dataset2 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, s0.txt, s1.txt
All 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, 023.txt, 024.txt, 025.txt, 026.txt, 027.txt, 028.txt, 029.txt, 030.txt, 031.txt, 032.txt, s0.txt, s1.txt
Case Name Status Exec Time Memory
000.txt AC 24 ms 796 KB
001.txt AC 25 ms 800 KB
002.txt AC 24 ms 808 KB
003.txt AC 24 ms 924 KB
004.txt AC 26 ms 804 KB
005.txt AC 23 ms 928 KB
006.txt AC 25 ms 804 KB
007.txt AC 26 ms 800 KB
008.txt AC 26 ms 928 KB
009.txt AC 26 ms 920 KB
010.txt AC 25 ms 800 KB
011.txt TLE 2037 ms 868 KB
012.txt TLE 2034 ms 928 KB
013.txt TLE 2033 ms 928 KB
014.txt TLE 2034 ms 936 KB
015.txt TLE 2034 ms 932 KB
016.txt TLE 2034 ms 936 KB
017.txt TLE 2033 ms 944 KB
018.txt TLE 2033 ms 928 KB
019.txt TLE 2034 ms 940 KB
020.txt TLE 2032 ms 828 KB
021.txt TLE 2033 ms 924 KB
022.txt TLE 2035 ms 6684 KB
023.txt TLE 2033 ms 6180 KB
024.txt TLE 2034 ms 6176 KB
025.txt TLE 2034 ms 3228 KB
026.txt TLE 2034 ms 2596 KB
027.txt TLE 2036 ms 5788 KB
028.txt TLE 2036 ms 6428 KB
029.txt TLE 2035 ms 4376 KB
030.txt TLE 2035 ms 6812 KB
031.txt TLE 2035 ms 5656 KB
032.txt TLE 2034 ms 7068 KB
s0.txt AC 26 ms 812 KB
s1.txt TLE 2033 ms 928 KB