Submission #833507

# Submission time Handle Problem Language Result Execution time Memory
833507 2023-08-22T06:19:09 Z Trumling Catfish Farm (IOI22_fish) C++17
0 / 100
17 ms 2152 KB
#include "fish.h"
#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define all(x) x.begin(),x.end()
typedef long long ll;
#define pb push_back
#define INF 9999999999999999

long long max_weights(int N, int M, vector<int> X, vector<int> Y,vector<int> W) 
{
  ll sum1=0,sum2;
  for(int i=0;i<M;i++)
  {
    if(X[i])
    sum1+=W[i];
    else
    sum2+=W[i];

  }
    

  return max(sum1,sum2);
}

Compilation message

fish.cpp: In function 'long long int max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
fish.cpp:14:13: warning: 'sum2' may be used uninitialized in this function [-Wmaybe-uninitialized]
   14 |   ll sum1=0,sum2;
      |             ^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 17 ms 2152 KB 1st lines differ - on the 1st token, expected: '40313272768926', found: '40313272858926'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '2', found: '4'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '10082010', found: '10182010'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB 1st lines differ - on the 1st token, expected: '3', found: '5'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB 1st lines differ - on the 1st token, expected: '3', found: '5'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB 1st lines differ - on the 1st token, expected: '3', found: '5'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '10082010', found: '10182010'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 17 ms 2152 KB 1st lines differ - on the 1st token, expected: '40313272768926', found: '40313272858926'
2 Halted 0 ms 0 KB -