結果

問題 No.1256 連続整数列
ユーザー tsuishitsuishi
提出日時 2020-12-29 13:12:59
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 910 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 30,080 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-15 14:03:01
合計ジャッジ時間 1,235 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>
#define DEBUG5

#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 int    aa;
    unsigned int    wid = 3;
    unsigned int    stp = 3;
    unsigned int    val;

    scanf("%d", &aa );

    while( (wid+stp) <= aa ) {
        //TRACE("%d,",wid);
        if( (( aa - stp ) % wid) == 0 ) {
            val = ( aa - stp ) / wid;
            for( int i=0;i<wid;i++) {
                if(i) TRACE(" + ");
                TRACE("%d",val+i);
            }
            TRACE("= %d\n",aa);
            printf("YES\n");
            return 0;
        }
        stp += wid;
        wid++;
    }
    //TRACE("(wid+stp)=%d, wid=%d,stp=%d,aa=%d\n", wid+stp, wid, stp,aa);
    printf("NO\n");
    return 0;
}
0