結果

問題 No.909 たぴの配置
ユーザー fura
提出日時 2020-05-05 17:43:47
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 77 ms / 3,000 ms
コード長 372 bytes
コンパイル時間 2,821 ms
コンパイル使用メモリ 193,068 KB
最終ジャッジ日時 2025-01-10 06:54:16
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:21: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         int n; scanf("%d",&n);
      |                ~~~~~^~~~~~~~~
main.cpp:12:23: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |         rep(i,n) scanf("%d",&x[i]);
      |                  ~~~~~^~~~~~~~~~~~
main.cpp:13:23: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   13 |         rep(i,n) scanf("%d",&y[i]);
      |                  ~~~~~^~~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

const int INF=1<<29;

int main(){
	int n; scanf("%d",&n);
	vector<int> x(n),y(n);
	rep(i,n) scanf("%d",&x[i]);
	rep(i,n) scanf("%d",&y[i]);

	int mn=INF;
	rep(i,n) mn=min(mn,x[i]+y[i]);

	printf("%d\n0\n",mn);
	rep(i,n) printf("%d\n",min(x[i],mn));
	printf("%d\n",mn);

	return 0;
}
0