Wanted to know when it was initiated. When can i expect to have my ratings updated again....hours? days?
| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3611 |
| 4 | jiangly | 3583 |
| 5 | strapple | 3515 |
| 6 | tourist | 3470 |
| 7 | Radewoosh | 3415 |
| 8 | Um_nik | 3376 |
| 9 | maroonrk | 3361 |
| 10 | XVIII | 3345 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 162 |
| 2 | adamant | 148 |
| 3 | Um_nik | 146 |
| 4 | Dominater069 | 143 |
| 5 | errorgorn | 141 |
| 6 | cry | 138 |
| 7 | Proof_by_QED | 136 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 10 | soullless | 133 |
Wanted to know when it was initiated. When can i expect to have my ratings updated again....hours? days?
Here is the problem link. Although, I think pretty much understand the problem, I am getting wrong answer on the first test case even though I am allowed to output any possible sequence.
#include<bits/stdc++.h>
using namespace std;
void solve() {
int n; cin >> n;
vector<int> a(n);
for(int i = 0 ; i < n ; i++) cin >> a[i];
cout << 2*n-1 << endl;
for(int i = 0 ; i < n ; i++){
if(i == 0) cout << a[i] << " ";
else cout << max(1, a[i]-1) << " " << a[i] << " ";
}
cout << "\n";
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t = 1; cin >> t;
while (t--) solve();
}
The idea behind the solution is that since any a[i] in the original sequence 'a' can only be added if a[i-1] is less than equal to it I can greedily add a number less than or equal to b[i] before it in the final sequence 'b'. Help me understand faults in the logic/code.
| Name |
|---|


