結果

問題 No.909 たぴの配置
ユーザー bal4ubal4u
提出日時 2019-10-19 19:31:15
言語 C
(gcc 12.3.0)
結果
RE  
実行時間 -
コード長 904 bytes
コンパイル時間 1,134 ms
コンパイル使用メモリ 29,240 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-09 23:05:00
合計ジャッジ時間 6,261 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 0 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 0 ms
4,380 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

// yuki 909 たぴの配置
// 2019.10.19 bal4u

#include <stdio.h>
#include <ctype.h>

int getchar_unlocked(void);
int putchar_unlocked(int c);
#define gc() getchar_unlocked()
#define pc(c) putchar_unlocked(c)

int in() {   // 非負整数の入力
	int n = 0; int c;
	do c = gc(); while (isspace(c));
	do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
	return n;
}

void out(int n) { // 非負整数の表示(出力)
	int i; char b[30];

	if (!n) pc('0');
	else {
		i = 0; while (n) b[i++] = n % 10 + '0', n /= 10;
		while (i--) pc(b[i]);
	}
	pc('\n');
}

int X[100005];

int main()
{
	int i, a, mi, N;
	
    N = in(); mi = 0x7ffffff;
    for (i = 0; i < N; ++i) X[i] = in();
    for (i = 0; i < N; ++i) {
        if ((a = X[i] + in()) < mi) mi = a;
    }
    out(mi);
    out(0);
    for (i = 0; i < N; i++){
        if (X[i] > mi) X[i] = mi;
        out(X[i]);
    }
    out(mi);
	return 0;
}
0