Submission #975528

# Submission time Handle Problem Language Result Execution time Memory
975528 2024-05-05T12:20:53 Z De3b0o Koala Game (APIO17_koala) C++14
4 / 100
3 ms 344 KB
#include "koala.h"
#include<bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define in insert
#define pb push_back
#define ppb pop_back()
#define d3 ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define cans cout << ans << "\n";
#define yes cout << "Yes" << "\n";
#define no cout << "No" << "\n";
#define pll pair<ll,ll>
#define lin cout << "\n";
#define sqr 340
#define mod 1000000007
#define mid ((l+r)/2)
#define lc (2*n)
#define rc (2*n+1)

using namespace std;

int minValue(int N, int W)
{
    ll n = N;
    int r[n];
    int b[n] = {0};
    b[0]++;
    playRound(b,r);
    ll ans;
    for(int i = 0 ; n>i ; i++)
        if(r[i]==0)
            ans=i;
    return ans;
}

int maxValue(int N, int W)
{
    ll n = N;
    ll ans;
    vector<ll> v;
    for(int i = 0 ; n>i ; i++)
        v.pb(i);
    while(true)
    {
        if(v.size()==1)
        {
            ans=v[0];
            break;
        }
        int b[n] = {0};
        int r[n];
        for(auto it : v)
            b[it]=1;
        playRound(b,r);
        v.clear();
        for(int i = 0 ; n>i ; i++)
        {
            if(r[i]==2)
                v.pb(i);
        }
    }
    return ans;
}

int greaterValue(int N, int W)
{
}

void allValues(int N, int W, int *P)
{
}

Compilation message

koala.cpp: In function 'int greaterValue(int, int)':
koala.cpp:68:1: warning: no return statement in function returning non-void [-Wreturn-type]
   68 | }
      | ^
koala.cpp: In function 'int minValue(int, int)':
koala.cpp:34:12: warning: 'ans' may be used uninitialized in this function [-Wmaybe-uninitialized]
   34 |     return ans;
      |            ^~~
# Verdict Execution time Memory Grader output
1 Correct 3 ms 344 KB Output is correct
2 Correct 3 ms 344 KB Output is correct
3 Correct 3 ms 344 KB Output is correct
4 Correct 3 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -