Submission #659260


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 d[100002][2];
int main(){
    int x,y;
    LLint w,h,f;
    
    cin>>w>>h;
    
    if (w<h) swap(w,h);
    
    for (x=2;x<=w;x++){
        d[x][0]=x;
    }
    int sw=1;
    for (y=3;y<=h;y++){
        d[2][sw]=y;
        for (x=3;x<=w;x++){
            d[x][sw]=(d[x-1][sw]+d[x][sw^1])%1000000007LL;
        }
        sw=sw^1;
    }
    
    cout<<d[w][sw^1]<<endl;
    
    return 0;
}

Submission Info

Submission Time
Task C - 経路
User m_buyoh
Language C++11 (GCC 4.9.2)
Score 100
Code Size 664 Byte
Status TLE
Exec Time 2040 ms
Memory 2472 KB

Judge Result

Set Name Sample Dataset1 Dataset2 All
Score / Max Score 0 / 0 50 / 50 50 / 50 0 / 1
Status
AC × 2
AC × 12
AC × 24
AC × 25
TLE × 10
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 26 ms 800 KB
001.txt AC 24 ms 800 KB
002.txt AC 24 ms 912 KB
003.txt AC 26 ms 796 KB
004.txt AC 26 ms 796 KB
005.txt AC 26 ms 920 KB
006.txt AC 25 ms 796 KB
007.txt AC 24 ms 800 KB
008.txt AC 26 ms 804 KB
009.txt AC 26 ms 796 KB
010.txt AC 25 ms 672 KB
011.txt AC 31 ms 796 KB
012.txt AC 25 ms 932 KB
013.txt AC 31 ms 804 KB
014.txt AC 29 ms 804 KB
015.txt AC 31 ms 924 KB
016.txt AC 30 ms 804 KB
017.txt AC 28 ms 800 KB
018.txt AC 29 ms 928 KB
019.txt AC 26 ms 920 KB
020.txt AC 28 ms 796 KB
021.txt AC 32 ms 924 KB
022.txt TLE 2035 ms 2328 KB
023.txt TLE 2034 ms 2200 KB
024.txt TLE 2034 ms 2208 KB
025.txt AC 743 ms 1440 KB
026.txt TLE 2040 ms 1304 KB
027.txt TLE 2035 ms 2084 KB
028.txt TLE 2033 ms 2212 KB
029.txt TLE 2033 ms 1696 KB
030.txt TLE 2034 ms 2340 KB
031.txt TLE 2034 ms 2072 KB
032.txt TLE 2033 ms 2472 KB
s0.txt AC 27 ms 800 KB
s1.txt AC 26 ms 808 KB