結果

問題 No.46 はじめのn歩
ユーザー mannshi222mannshi222
提出日時 2019-07-14 20:03:11
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 1,086 bytes
コンパイル時間 127 ms
コンパイル使用メモリ 29,056 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-03 14:18:59
合計ジャッジ時間 689 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
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
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>

#define ENDD '\0'
#define KIGY '\n'

#define TRUE 0
#define FALSE 1

int main()
{
        int ch;
        char buff[100000+1];
        long long int buffi;
        long long int N;
        long long int jen[100000+1];

        buffi = 0;
/*
        while( (ch=getc(stdin)) != KIGY) {
                buff[buffi++] = ch;
        }
        buff[buffi] = ENDD;
        N = atoi(buff);
*/


        buffi=0;
        int count = 1;
        int jeni = 0;
        while( (ch=getc(stdin)) != EOF) {
                        if( ch==' ' ||  ch==KIGY   ) {
                                buff[buffi] = ENDD;
                                jen[jeni++] = atoll( buff );
                                buffi = 0;
                        }
                        else {
                                buff[buffi++] = ch;
                        }
        }

        if( jen[1] % jen[0] == 0) {
                buffi = 0;
        }
        else {
                buffi = 1;
        }

        printf("%lld\n", jen[1] / jen[0] + buffi );

        return 0;
}
0