답안 #1022586

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1022586 2024-07-13T19:02:13 Z grafff 메기 농장 (IOI22_fish) C++17
3 / 100
55 ms 15212 KB
#include<bits/stdc++.h>

using namespace std;

long long group1(vector <int> W)
{
    long long sum = 0;
    for(int i : W)
    {
        sum += i;
    }
    return sum;
}

long long group2(int N, int M, vector <int> X, vector <int> Y, vector <int> W)
{
    long long pref[2][N], cord = -1, mx = 0;
    for(int i = 0; i < 2; i++)
    {
        for(int j = 0; j < N; j++)
        {
            pref[i][j] = 0;;
        }
    }
    for(int i = 0; i < M; i++)
    {
        pref[X[i]][Y[i]] = W[i];
    }
    for(int i = 0; i < 2; i++)
    {
        for(int j = 1; j < N; j++)
        {
            pref[i][j] = pref[i][j - 1];
        }
    }
    for(int i = 0; i < N; i++)
    {
        if(pref[0][i] - pref[1][i] > mx)
        {
            mx = pref[0][i] - pref[1][i];
            cord = i;
        }
    }
    return pref[1][N - 1] + mx;
}

long long group3()
{
}

long long group4()
{
}

long long group5()
{
}

long long group6()
{
}

long long group7()
{
}

long long full()
{
}

long long max_weights(int N, int M, vector <int> X, vector <int> Y, vector <int> W)
{
    bool flag1 = true;
    bool flag2 = true;
    bool flag3 = true;
    bool flag4 = true;
    for(int i = 0; i < M; i++)
    {
        if(X[i] % 2 != 0)
        {
            flag1 = false;
        }
        if(X[i] >= 1)
        {
            flag2 = false;
        }
        if(Y[i] != 0)
        {
            flag3 = false;
        }
        if(Y[i] > 8)
        {
            flag4 = false;
        }
    }
    if(flag1)
    {
        return group1(W);
    }
    if(flag2)
    {
        return group2(N, M, X, Y, W);
    }
    if(flag3)
    {
        return group3();
    }
    if(flag4)
    {
        return group4();
    }
    return full();
}
/**
int main()
{
    ios_base::sync_with_stdio(false);
}
/**/

Compilation message

fish.cpp:119:1: warning: "/*" within comment [-Wcomment]
  119 | /**/
      |  
fish.cpp: In function 'long long int group2(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
fish.cpp:17:27: warning: variable 'cord' set but not used [-Wunused-but-set-variable]
   17 |     long long pref[2][N], cord = -1, mx = 0;
      |                           ^~~~
fish.cpp: In function 'long long int group3()':
fish.cpp:49:1: warning: no return statement in function returning non-void [-Wreturn-type]
   49 | }
      | ^
fish.cpp: In function 'long long int group4()':
fish.cpp:53:1: warning: no return statement in function returning non-void [-Wreturn-type]
   53 | }
      | ^
fish.cpp: In function 'long long int group5()':
fish.cpp:57:1: warning: no return statement in function returning non-void [-Wreturn-type]
   57 | }
      | ^
fish.cpp: In function 'long long int group6()':
fish.cpp:61:1: warning: no return statement in function returning non-void [-Wreturn-type]
   61 | }
      | ^
fish.cpp: In function 'long long int group7()':
fish.cpp:65:1: warning: no return statement in function returning non-void [-Wreturn-type]
   65 | }
      | ^
fish.cpp: In function 'long long int full()':
fish.cpp:69:1: warning: no return statement in function returning non-void [-Wreturn-type]
   69 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 3920 KB Output is correct
2 Correct 17 ms 4796 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 436 KB Output is correct
5 Correct 54 ms 15188 KB Output is correct
6 Correct 55 ms 15212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 344 KB 1st lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Runtime error 2 ms 3676 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB 1st lines differ - on the 1st token, expected: '3', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB 1st lines differ - on the 1st token, expected: '3', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB 1st lines differ - on the 1st token, expected: '3', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Runtime error 2 ms 3676 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 3920 KB Output is correct
2 Correct 17 ms 4796 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 436 KB Output is correct
5 Correct 54 ms 15188 KB Output is correct
6 Correct 55 ms 15212 KB Output is correct
7 Incorrect 1 ms 344 KB 1st lines differ - on the 1st token, expected: '2', found: '1'
8 Halted 0 ms 0 KB -