Submission #841044

# Submission time Handle Problem Language Result Execution time Memory
841044 2023-09-01T07:06:01 Z Muhammad_Aneeq A Plus B (IOI23_aplusb) C++17
30 / 100
6 ms 288 KB
#include <vector>
#include <algorithm>
#include "aplusb.h"
using namespace std;
vector<int> smallest_sums(int n,vector<int> a ,vector<int> b)
{
  long long st=0,en=2e9+10;
  while (st+1<en)
  {
    int mid=(st+en)/2;
    int k=n;
    for (int i=0;i<n&&k;i++)
    {
      for (int j=0;j<n&&k;j++)
      {
        if (a[i]+b[j]<=mid)
          k--;
      }
    }
    if (k==0)
      en=mid;
      else
      st=mid;  
  }
  vector<int>ans(n);
  int k=0;
  for (int i=0;i<n&&k<n;i++)
    {
      for (int j=0;j<n&&k<n;j++)
      {
        if (a[i]+b[j]<=en)
        {
          ans[k++]=a[i]+b[j];
        }
      }
    }
    sort(ans.begin(), ans.end());
    return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 288 KB Output is correct
3 Correct 0 ms 240 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 288 KB Output is correct
3 Correct 0 ms 240 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 ms 284 KB Output is correct
12 Correct 0 ms 284 KB Output is correct
13 Correct 1 ms 284 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 284 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 288 KB Output is correct
3 Correct 0 ms 240 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 ms 284 KB Output is correct
12 Correct 0 ms 284 KB Output is correct
13 Correct 1 ms 284 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 284 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Incorrect 6 ms 212 KB 1st lines differ - on the 63rd token, expected: '1401', found: '1404'
24 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 288 KB Output is correct
3 Correct 0 ms 240 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 ms 284 KB Output is correct
12 Correct 0 ms 284 KB Output is correct
13 Correct 1 ms 284 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 284 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Incorrect 6 ms 212 KB 1st lines differ - on the 63rd token, expected: '1401', found: '1404'
24 Halted 0 ms 0 KB -