結果

問題 No.909 たぴの配置
ユーザー fura
提出日時 2020-05-05 17:42:37
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 364 bytes
コンパイル時間 4,632 ms
コンパイル使用メモリ 192,932 KB
最終ジャッジ日時 2025-01-10 06:54:00
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 3 WA * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
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",x[i]);
	printf("%d\n",mn);

	return 0;
}
0