Submission #816867

#TimeUsernameProblemLanguageResultExecution timeMemory
816867finn__메기 농장 (IOI22_fish)C++17
0 / 100
26 ms4268 KiB
#include "fish.h"

#include <bits/stdc++.h>
using namespace std;

constexpr size_t N = 3000;

struct state
{
    int64_t zero;
};

long long max_weights(int n, int m, vector<int> x, vector<int> y, vector<int> w)
{
    // subtask 1
    {
        bool all_even = 1;
        for (size_t i = 0; i < n; ++i)
            all_even &= !(x[i] & 1);
        if (all_even)
            return accumulate(w.begin(), w.end(), 0);
    }

    // subtask 2
    {
        bool le1 = 1;
        for (size_t i = 0; i < n; ++i)
            le1 &= x[i] <= 1;
        if (le1)
        {
            int64_t u = 0, v = 0;
            for (size_t i = 0; i < n; ++i)
                (x[i] ? v : u) += w[i];
            return max(u, v);
        }
    }
}

Compilation message (stderr)

fish.cpp: In function 'long long int max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
fish.cpp:18:30: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   18 |         for (size_t i = 0; i < n; ++i)
      |                            ~~^~~
fish.cpp:27:30: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   27 |         for (size_t i = 0; i < n; ++i)
      |                            ~~^~~
fish.cpp:32:34: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   32 |             for (size_t i = 0; i < n; ++i)
      |                                ~~^~~
fish.cpp:37:1: warning: control reaches end of non-void function [-Wreturn-type]
   37 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...