3 solutions

  • 2
    @ 2026-3-29 14:16:10

    • 0
      @ 2026-3-29 14:36:46

      #include<bits/stdc++.h>
      using namespace std;
      int main(){
      	int n,m,k;
      	cin>>n>>m>>k;
      	int res=-2e9;
      	for(int i=1;i<=n;i++){
      		int x;
      		cin>>x;
      		res=max(res,x);
      	}
      	for(int i=1;i<=k;i++){
      		int x;
      		cin>>x;
      		res=max(res,n-x);
      	}
      	cout<<res;
      	return 0;
      }
      
      
      • 0
        @ 2025-11-1 16:00:54
        #include<bits/stdc++.h>
        using namespace std;
        int main()
        {
            int n,m,k;
            cin>>n>>m>>k;
            int res=-2e9;
            for(int i=1;i<=m;i++)
            {
                int x;
                cin>>x;
                res=max(res,x);
            }
            for(int i=1;i<=k;i++)
            {
                int x;
                cin>>x;
                res=max(res,n-x);
            }
            cout<<res;
            return 0;
        }
        
        • 1

        Information

        ID
        259
        Time
        1000ms
        Memory
        256MiB
        Difficulty
        5
        Tags
        # Submissions
        20
        Accepted
        10
        Uploaded By