Submission #625845

# Submission time Handle Problem Language Result Execution time Memory
625845 2022-08-10T22:09:31 Z kkkkkkkk Catfish Farm (IOI22_fish) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;

long long max_weights(int n,int m,vector<int> x,vector<int> y,vector<int> w)
{
    bool 1st=true;
    for (int i=0;i<m;i++)
        if (w[i]%2==1)
        {
            1st=false;
            break;
        }
    if (1st)
    {
        long long vk=0;
        for (int i=0;i<m;i++)
            vk+=w[i];
    }
    else
    {
        long long kaj_nula=0,kaj_eden=0;
        for (int i=0;i<m;i++)
        {
            if (x[i]==0)
                kaj_nula+=w[i];
            else
                kaj_eden+=w[i];
        }
        vk=max(kaj_nula,kaj_eden);
    }
    return vk;
}

Compilation message

fish.cpp: In function 'long long int max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
fish.cpp:8:10: error: expected unqualified-id before numeric constant
    8 |     bool 1st=true;
      |          ^~~
fish.cpp:12:13: error: unable to find numeric literal operator 'operator""st'
   12 |             1st=false;
      |             ^~~
fish.cpp:12:13: note: use '-fext-numeric-literals' to enable more built-in suffixes
fish.cpp:15:9: error: unable to find numeric literal operator 'operator""st'
   15 |     if (1st)
      |         ^~~
fish.cpp:15:9: note: use '-fext-numeric-literals' to enable more built-in suffixes
fish.cpp:31:9: error: 'vk' was not declared in this scope
   31 |         vk=max(kaj_nula,kaj_eden);
      |         ^~
fish.cpp:33:12: error: 'vk' was not declared in this scope
   33 |     return vk;
      |            ^~