結果
| 問題 |
No.3184 Make Same
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-06-20 22:25:33 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 641 bytes |
| コンパイル時間 | 2,067 ms |
| コンパイル使用メモリ | 204,240 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-06-20 22:25:48 |
| 合計ジャッジ時間 | 14,081 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 1 WA * 23 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int N; cin >> N;
vector<int> A(N);
for(auto &a : A) cin >> a;
vector<tuple<int,int,int>> answer;
while(answer.size() < 30){
sort(A.begin(),A.end());
int mina = A.at(0),maxa = A.back();
int add = (maxa-mina+1)/2;
int r = N-1;
for(int i=0; i<N; i++) if(A.at(i)+add > maxa){r = i-1; break;}
answer.push_back({0,r,add});
for(int i=0; i<=r; i++) A.at(i) += add;
}
for(auto &[l,r,v] : answer) cout << l+1 << " " << r+1 << " " << v << "\n";
}