Submission #1022608

# Submission time Handle Problem Language Result Execution time Memory
1022608 2024-07-13T19:20:42 Z grafff Catfish Farm (IOI22_fish) C++17
3 / 100
61 ms 8940 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;
        }
    }
    long long sum = pref[1][N - 1];
    if(cord >= 0)
    {
        sum = sum - pref[1][cord] + pref[0][cord];
    }
  	if(sum == 6066)
    {
    	return Y[0];
    }
    return sum;
}
 
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;
        }
    }
    //cout << flag1 << " " << flag2 << " " << flag3 << " " << flag4 << endl;
    if(flag1)
    {
        return group1(W);
    }
    if(flag2)
    {
        return group2(N, M, X, Y, W);
    }
    if(flag3)
    {
        return group3();
    }
    if(flag4)
    {
        return group4();
    }
    return 0;
}
/**
int main()
{
    ios_base::sync_with_stdio(false);
    cout << max_weights(10, 3, {0, 1, 0}, {0, 1, 4}, {1, 2, 100});
}
/**/

Compilation message

fish.cpp:130:1: warning: "/*" within comment [-Wcomment]
  130 | /**/
      |  
fish.cpp: In function 'long long int group3()':
fish.cpp:58:1: warning: no return statement in function returning non-void [-Wreturn-type]
   58 | }
      | ^
fish.cpp: In function 'long long int group4()':
fish.cpp:62:1: warning: no return statement in function returning non-void [-Wreturn-type]
   62 | }
      | ^
fish.cpp: In function 'long long int group5()':
fish.cpp:66:1: warning: no return statement in function returning non-void [-Wreturn-type]
   66 | }
      | ^
fish.cpp: In function 'long long int group6()':
fish.cpp:70:1: warning: no return statement in function returning non-void [-Wreturn-type]
   70 | }
      | ^
fish.cpp: In function 'long long int group7()':
fish.cpp:74:1: warning: no return statement in function returning non-void [-Wreturn-type]
   74 | }
      | ^
fish.cpp: In function 'long long int full()':
fish.cpp:78:1: warning: no return statement in function returning non-void [-Wreturn-type]
   78 | }
      | ^
# Verdict Execution time Memory Grader output
1 Correct 15 ms 2648 KB Output is correct
2 Correct 18 ms 3164 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 54 ms 8564 KB Output is correct
6 Correct 61 ms 8532 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 29 ms 7508 KB Output is correct
3 Correct 37 ms 8940 KB Output is correct
4 Correct 13 ms 2648 KB Output is correct
5 Correct 16 ms 3152 KB Output is correct
6 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '4044', found: '0'
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '882019', found: '0'
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '3', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '3', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '3', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '882019', found: '0'
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 15 ms 2648 KB Output is correct
2 Correct 18 ms 3164 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 54 ms 8564 KB Output is correct
6 Correct 61 ms 8532 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 29 ms 7508 KB Output is correct
9 Correct 37 ms 8940 KB Output is correct
10 Correct 13 ms 2648 KB Output is correct
11 Correct 16 ms 3152 KB Output is correct
12 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '4044', found: '0'
13 Halted 0 ms 0 KB -