結果
問題 | No.909 たぴの配置 |
ユーザー | ate |
提出日時 | 2019-10-18 21:45:25 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 304 ms / 3,000 ms |
コード長 | 1,301 bytes |
コンパイル時間 | 2,308 ms |
コンパイル使用メモリ | 201,880 KB |
実行使用メモリ | 6,284 KB |
最終ジャッジ日時 | 2023-09-07 21:48:02 |
合計ジャッジ時間 | 8,119 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,380 KB |
testcase_01 | AC | 2 ms
4,380 KB |
testcase_02 | AC | 1 ms
4,380 KB |
testcase_03 | AC | 1 ms
4,376 KB |
testcase_04 | AC | 1 ms
4,376 KB |
testcase_05 | AC | 291 ms
5,948 KB |
testcase_06 | AC | 296 ms
6,168 KB |
testcase_07 | AC | 281 ms
5,960 KB |
testcase_08 | AC | 289 ms
6,012 KB |
testcase_09 | AC | 292 ms
6,148 KB |
testcase_10 | AC | 274 ms
6,004 KB |
testcase_11 | AC | 272 ms
6,020 KB |
testcase_12 | AC | 296 ms
5,916 KB |
testcase_13 | AC | 304 ms
6,284 KB |
testcase_14 | AC | 280 ms
6,016 KB |
testcase_15 | AC | 275 ms
6,020 KB |
コンパイルメッセージ
main.cpp:18:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type] 18 | main(){ | ^~~~
ソースコード
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(ll i=0;i<(n);++i) #define reps(i,n) for(ll i=1;i<=(n);++i) using ll = long long; using str = string; constexpr long long INF = (1LL<<60); constexpr long long MOD = (1e9+7); template<class T>inline bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;} template<class T>inline bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;} inline void dump(){cout<<endl;} template<class Head,class... Tail>inline void dump(Head&& head, Tail&&... tail){cout<<head<<", ";dump(forward<Tail>(tail)...);} template<typename T>inline istream &operator>>(istream&input,vector<T>&v){for(auto &elemnt:v)input>>elemnt;return input;} template<class T>vector<T> make_vector(size_t a){return vector<T>(a);} template<class T, class... Ts>auto make_vector(size_t a, Ts... ts){return vector<decltype(make_vector<T>(ts...))>(a, make_vector<T>(ts...));} main(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(10); ll n; cin>>n; vector<ll> x(n),y(n); cin>>x>>y; ll ans=INF; rep(i,n){ chmin(ans,abs(x[i]+y[i])); } cout<<(ans)<<endl; cout<<0<<endl; rep(i,n){ if(x[i]<abs(ans-y[i])){ cout<<x[i]<<endl; }else{ cout<<abs(ans-y[i])<<endl; } } cout<<(ans)<<endl; }