結果

問題 No.909 たぴの配置
ユーザー 💕💖💞💕💖💞
提出日時 2019-10-26 15:33:33
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 52 ms / 3,000 ms
コード長 1,745 bytes
コンパイル時間 1,559 ms
コンパイル使用メモリ 166,660 KB
実行使用メモリ 5,548 KB
最終ジャッジ日時 2023-10-12 10:29:03
合計ジャッジ時間 4,444 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 1 ms
4,352 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 47 ms
5,356 KB
testcase_06 AC 49 ms
5,352 KB
testcase_07 AC 46 ms
5,440 KB
testcase_08 AC 50 ms
5,392 KB
testcase_09 AC 52 ms
5,348 KB
testcase_10 AC 47 ms
5,392 KB
testcase_11 AC 47 ms
5,548 KB
testcase_12 AC 49 ms
5,412 KB
testcase_13 AC 50 ms
5,360 KB
testcase_14 AC 47 ms
5,348 KB
testcase_15 AC 48 ms
5,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

#define endl '\n'
#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define F(i,j,k) fill(i[0],i[0]+j*j,k)
#define P(p) cout<<(p)<<endl;
#define SORT(v) sort(ALL(v))
#define SORTD(v) sort(ALL(v), greater<int>())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define INF 1<<30
#define v(T) vector<T>
#define vv(T) v(v(T))
#define print(x) cout<<(x)<<endl
#define printv(v) for(auto i : v){cout<<i<<" ";}cout<<endl
#define printu(v) for(auto i : v){print(i);}
#define readv(v, n) for (int i=0;i<n;i++)cin >> v[i]
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int,int> pii;
typedef pair<long,long> pll;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
void debug_print() {}
template <class Head, class... Tail>
void debug_print(Head&& head, Tail&&... tail)
{
        cout << (head) << endl;
        debug_print(forward<Tail>(tail)...);
}
int i, j, k;
int main()
{
        cin.tie(0);
        ios::sync_with_stdio(false);
        int N;
        cin >> N;

        vi xs;
        vi ys;
        rep(i, N) {
            int t;
            cin >> t;
            xs.push_back(t);
        }
        rep(i, N) {
            int t;
            cin >> t;
            ys.push_back(t);
        }
        int R = INF;
        rep(i, N) {
            R = min(xs[i] + ys[i], R);
        }

        print(R);
        print(0);
        rep(i,N) {
            print(max(0, R - ys[i]));
        }
        print(R);
        // write something.
        return 0;
}
0