結果
| 問題 |
No.909 たぴの配置
|
| コンテスト | |
| ユーザー |
bal4u
|
| 提出日時 | 2019-10-19 19:32:31 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 21 ms / 3,000 ms |
| コード長 | 904 bytes |
| コンパイル時間 | 329 ms |
| コンパイル使用メモリ | 30,464 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-27 15:34:16 |
| 合計ジャッジ時間 | 2,648 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 |
ソースコード
// 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[200005];
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;
}
bal4u