結果

問題 No.1256 連続整数列
ユーザー tsuishitsuishi
提出日時 2020-12-29 13:33:46
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 1,102 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 27,776 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-15 14:26:48
合計ジャッジ時間 1,019 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 1 ms
6,944 KB
testcase_09 AC 1 ms
6,944 KB
testcase_10 AC 1 ms
6,944 KB
testcase_11 AC 1 ms
6,940 KB
testcase_12 AC 1 ms
6,944 KB
testcase_13 AC 1 ms
6,944 KB
testcase_14 AC 1 ms
6,940 KB
testcase_15 AC 1 ms
6,940 KB
testcase_16 AC 1 ms
6,940 KB
testcase_17 AC 1 ms
6,944 KB
testcase_18 AC 1 ms
6,944 KB
testcase_19 AC 1 ms
6,944 KB
testcase_20 AC 1 ms
6,940 KB
testcase_21 AC 1 ms
6,940 KB
testcase_22 AC 1 ms
6,940 KB
testcase_23 AC 1 ms
6,940 KB
testcase_24 AC 1 ms
6,940 KB
testcase_25 AC 1 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#define DEBUGe

#define NOP do{}while(0)

#ifdef DEBUG
#define TRACE(...) do{printf(__VA_ARGS__);fflush(stdout);}while(0)
#define TRACECR do{printf("\n");fflush(stdout);}while(0)
#else
#define TRACE(...) NOP
#define TRACECR NOP
#endif
int main( void ) {
    unsigned long    aa;
    unsigned long    wid = 3;
    unsigned long    stp = 3;
    unsigned long   val;

    scanf("%d", &aa );
    if( aa != 1 ) {
        printf("YES\n");
        return 0;
    }
#if 0
    while( (wid+stp) <= aa+aa ) {
        //TRACE("%d,",wid);
        if( (( aa - stp ) % wid) == 0 ) {
            val = ( aa - stp ) / wid;
            if( val > aa ) {
                printf("NO\n");
                return 0;
            }
            for( int i=0;i<wid;i++) {
                if(i) TRACE(" + ");
                TRACE("%ld",val+i);
            }
            TRACE("= %d\n",aa);
            printf("YES\n");
            return 0;
        }
        stp += wid;
        wid++;
    }
    TRACE("(wid+stp)=%ld, wid=%ld,stp=%ld,aa=%ld\n", wid+stp, wid, stp,aa);
#endif
    printf("NO\n");
    return 0;
}
0