ia-toki / tlx

Pusat Pelaporan Isu TLX Training Gate
18 stars 2 forks source link

Wrong Answer - Gemastik 2016 Membangun Menara #51

Closed ajisubarkah closed 5 years ago

ajisubarkah commented 5 years ago

Test pertama selalu berhasil sedangkan tes kedua selalu salah

include

include

include

include <bits/stdc++.h>

using namespace std;

vector membangunMenara(int n, int a[], int b[], int c[]) { vector result; long hasil[2] = {0,0}; for(int i = 0; i < n; i++){ hasil[0] += minmax({a[i],b[i],c[i]}).first; hasil[1] += minmax({a[i],b[i],c[i]}).second; } result.push_back(hasil[0]); result.push_back(hasil[1]); return result; }

int main(){ int t; cin >> t; int n, a[t], b[t], c[t]; for(int i = 0; i < t; i++) { cin >> n; for (int i = 0; i < n; i++) { cin >> a[i] >> b[i] >> c[i]; } vector hasil = membangunMenara(n,a,b,c); cout << hasil[0] << " " << hasil[1] << endl; } }

dewa251202 commented 5 years ago

1 3 1 2 3 4 5 6 7 8 9

lebih bagus ditanyakan di grup fb https://www.facebook.com/groups/olimpinfo/