Submission #58215049


Source Code Expand

Copy
#include <iostream>
#include <string>
#include <cstdlib>
#include <atcoder/dsu>
#include <algorithm>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
int main(){
int a=0,b=0,c,d,n;
cin >> n;
cin >> a;
for(int i=0;i<n-1;i++){
cin >> c;
a=max(a,c);
}
cin >> b;
for(int i=0;i<n-1;i++){
cin >> d;
b=max(b,d);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <iostream>
#include <string>
#include <cstdlib>
#include <atcoder/dsu>
#include <algorithm>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
int main(){
 int a=0,b=0,c,d,n;
 cin >> n;
 cin >> a;
 for(int i=0;i<n-1;i++){
   cin >> c;
   a=max(a,c);
 }
 cin >> b;
 for(int i=0;i<n-1;i++){
   cin >> d;
   b=max(b,d);
 }
 cout << b+a;
}

Submission Info

Submission Time
Task C - Max Ai+Bj
User p2bananan
Language C++ 23 (gcc 12.2)
Score 250
Code Size 560 Byte
Status AC
Exec Time 278 ms
Memory 3656 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 250 / 250
Status
AC × 2
AC × 22
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt
All 00_sample_01.txt, 00_sample_02.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt, 02_handmade_05.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 1 ms 3436 KB
00_sample_02.txt AC 1 ms 3492 KB
01_random_01.txt AC 236 ms 3472 KB
01_random_02.txt AC 257 ms 3460 KB
01_random_03.txt AC 73 ms 3508 KB
01_random_04.txt AC 256 ms 3468 KB
01_random_05.txt AC 88 ms 3496 KB
01_random_06.txt AC 255 ms 3444 KB
01_random_07.txt AC 101 ms 3528 KB
01_random_08.txt AC 256 ms 3496 KB
01_random_09.txt AC 199 ms 3444 KB
01_random_10.txt AC 255 ms 3496 KB
01_random_11.txt AC 230 ms 3656 KB
01_random_12.txt AC 255 ms 3528 KB
01_random_13.txt AC 166 ms 3552 KB
01_random_14.txt AC 255 ms 3568 KB
01_random_15.txt AC 137 ms 3460 KB
02_handmade_01.txt AC 1 ms 3528 KB
02_handmade_02.txt AC 259 ms 3628 KB
02_handmade_03.txt AC 278 ms 3508 KB
02_handmade_04.txt AC 270 ms 3556 KB
02_handmade_05.txt AC 266 ms 3564 KB


2025-04-04 (Fri)
06:10:19 +00:00