結果
| 問題 | No.3184 Make Same |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-13 16:25:32 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 682 bytes |
| 記録 | |
| コンパイル時間 | 1,255 ms |
| コンパイル使用メモリ | 223,524 KB |
| 実行使用メモリ | 13,056 KB |
| 最終ジャッジ日時 | 2026-07-16 11:37:58 |
| 合計ジャッジ時間 | 11,086 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 4 WA * 20 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
map<int,int> nums;
for(int i = 0;i<n;i++){
int a;
cin >> a;
nums[a] ++;
}
vector<tuple<int,int,int>> answer;
while(nums.size() >= 2){
auto itr = nums.begin();
pair<int,int> left = *itr;
itr++;
pair<int,int> right = *itr;
answer.push_back( {1,left.second,right.first-left.first} );
itr->second += left.second;
nums.erase(left.first);
}
cout << answer.size() << endl;
for(tuple<int,int,int> x : answer){
cout << get<0>(x) << " " << get<1>(x) << " " << get<2>(x) << endl;
}
}