/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 324.0 KiB
#2 Wrong Answer 2ms 520.0 KiB

Code

#include <iostream>
using namespace std;
int main()
{
    int t;
    cin>>t;
    for(int j=0;j<t;j++)
    {
    int N;
	cin>>N;
	int A[N],B[N],C[N],D[N];
	for(int i=1;i<=N;i++)
	{
		cin>>A[i];
	
		cin>>B[i];

		cin>>C[i];
	}
	for(int i=1;i<=N;i++)
	{
		if(A[i]>B[i]&&A[i]>C[i])
		{ D[i]=A[i];}
		else if (B[i]>A[i]&&B[i]>C[i])
		{ D[i]=B[i];}
		else{D[i]=C[i];}
	}
	int sum=0;
	for(int i=1;i<=N;i++)
	{
		sum =sum+D[i];
	}
	cout<<sum<<endl;
    }
}

Information

Submit By
Type
Submission
Problem
P1046 Maximum sum in 3-array
Contest
TLE_Headquarters - round #1
Language
C++17 (G++ 13.2.0)
Submit At
2024-03-27 18:19:02
Judged At
2024-11-11 03:37:11
Judged By
Score
0
Total Time
2ms
Peak Memory
520.0 KiB