結果
問題 | No.2210 equence Squence Seuence |
ユーザー | FplusFplusF |
提出日時 | 2023-02-10 22:37:16 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 860 bytes |
コンパイル時間 | 1,907 ms |
コンパイル使用メモリ | 202,644 KB |
実行使用メモリ | 6,780 KB |
最終ジャッジ日時 | 2023-09-21 23:47:37 |
合計ジャッジ時間 | 4,569 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,384 KB |
testcase_01 | AC | 1 ms
4,380 KB |
testcase_02 | AC | 2 ms
4,380 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | AC | 25 ms
4,376 KB |
testcase_07 | AC | 63 ms
6,492 KB |
testcase_08 | WA | - |
testcase_09 | AC | 1 ms
4,380 KB |
testcase_10 | AC | 1 ms
4,376 KB |
testcase_11 | AC | 2 ms
4,376 KB |
testcase_12 | AC | 2 ms
4,376 KB |
testcase_13 | AC | 78 ms
6,676 KB |
testcase_14 | AC | 79 ms
6,556 KB |
testcase_15 | AC | 79 ms
6,624 KB |
testcase_16 | AC | 79 ms
6,736 KB |
testcase_17 | WA | - |
testcase_18 | AC | 1 ms
4,380 KB |
testcase_19 | AC | 2 ms
4,380 KB |
testcase_20 | WA | - |
testcase_21 | AC | 2 ms
4,380 KB |
testcase_22 | WA | - |
testcase_23 | AC | 61 ms
6,448 KB |
testcase_24 | AC | 47 ms
5,092 KB |
testcase_25 | AC | 54 ms
6,112 KB |
testcase_26 | AC | 72 ms
6,780 KB |
testcase_27 | AC | 21 ms
4,376 KB |
ソースコード
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for (long long i=0;i<(long long)(n);i++) #define all(v) v.begin(),v.end() using ll=long long; using pll=pair<ll,ll>; using tll=tuple<ll,ll,ll>; const ll INF=(1ll<<60); template<class T> void chmin(T &a,T b){ if(a>b){ a=b; } } template<class T> void chmax(T &a,T b){ if(a<b){ a=b; } } ll f(ll x,ll a,ll b){ return a*x+b; } ll n,k; vector<ll> a,ans; void f(ll x){ if((n-1-x==k&&a[x]<a[x+1])||(k==0&&a[x+1]<=a[x])){ for(ll i=x+1;i<n;i++) ans.push_back(a[i]); return; }else{ ans.push_back(a[x]); if(a[x+1]<=a[x]) k--; if(x+1<n-1) f(x+1); else return; } } int main(){ cin >> n >> k; k--; a.resize(n); rep(i,n) cin >> a[i]; f(0); for(auto &i:ans) cout << i << " "; cout << endl; }