답안 #625845

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
625845 2022-08-10T22:09:31 Z kkkkkkkk 메기 농장 (IOI22_fish) C++17
컴파일 오류
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;
      |            ^~