AtCoder Beginner Contest 034

Submission #659260

Source codeソースコード

#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

Task問題 C - 経路
User nameユーザ名 舞葉
Created time投稿日時
Language言語 C++11 (GCC 4.9.2)
Status状態 TLE
Score得点 100
Source lengthソースコード長 664 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
Sample - s0.txt,s1.txt
Dataset1 50 / 50 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 50 / 50 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 0 / 1 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

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
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
023.txt TLE
024.txt TLE
025.txt AC 743 ms 1440 KB
026.txt TLE
027.txt TLE
028.txt TLE
029.txt TLE
030.txt TLE
031.txt TLE
032.txt TLE
s0.txt AC 27 ms 800 KB
s1.txt AC 26 ms 808 KB