제출 #403742

#제출 시각아이디문제언어결과실행 시간메모리
403742yoavL코알라 (APIO17_koala)C++14
컴파일 에러
0 ms0 KiB

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <bitset>
#include <math.h>
#include <fstream>
#include <iomanip>
#include "koala.h"

using namespace std;

using ll = int;
using ld = long double;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vvvvll = vector<vvvll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using vld = vector<ld>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
using vvpll = vector<vpll>;
using pb = pair<bool, bool>;
using vpb = vector<pb>;
using vvpb = vector<vpb>;
using vi = vector<int>;
using vvi = vector<vi>;

const ll mod = (ll)1e9 + 7;
const ll inf = (ll)1e18;


#define F           first
#define S           second

#define FAST        ios_base::sync_with_stdio(0)
#define FASTIN		cin.tie(0)
#define FASTOUT		cout.tie(0)

#define upmin(a, b) a = min(a, b)
#define upmax(a, b) a = max(a, b)

#define whatvec(v) cout << #v << ": "; for(auto it = v.begin(); it != v.end(); ++it) cout << *it << " "; cout << endl;
#define prv(v) cout << #v << ": "; for(auto it = v.begin(); it != v.end(); ++it) cout << *it << " "; cout << endl;
#define wpr(x) cout << #x << " = " << (x) << endl;
#define wprv(v) cout << #v << ": "; for(auto it = v.begin(); it != v.end(); ++it) cout << *it << " "; cout << endl;
#define what(x) cout << #x << " = " << (x) << "\n";
#define pr(x) cout <<x << endl;

#define rep(i,s,e) for(ll i = s;i < e; i++)
#define rep(i, e) for(ll i = 0; i < e; i++)
#define all(x) x.begin(),x.end()
#define pb push_back


ll a[100], b[100];
void fill(ll ind)
{
    for (ll i = 0; i < 100; i++) a[i] = 1;
    a[ind] = 0;
}



int minValue(int N, int W) {
    // TODO: Implement Subtask 1 solution here.
    // You may leave this function unmodified if you are not attempting this
    // subtask.
    ll n = N, w = W;

    //vll a(n, 1);
    fill(0);
    
    playRound(a, b);
    for (ll i = 0; i < 100; i++) {
        if (b[i] == 0) return i;
    }
    fill(1);
    playRound(a, b);
    rep(i, 0, 100) {
        if (b[i] == 0) return i;
    }
    return 0;
}

int maxValue(int N, int W) {
    // TODO: Implement Subtask 2 solution here.
    // You may leave this function unmodified if you are not attempting this
    // subtask.



    return 0;
}

int greaterValue(int N, int W) {
    // TODO: Implement Subtask 3 solution here.
    // You may leave this function unmodified if you are not attempting this
    // subtask.
    return 0;
}

void allValues(int N, int W, int* P) {
    if (W == 2 * N) {
        // TODO: Implement Subtask 4 solution here.
        // You may leave this block unmodified if you are not attempting this
        // subtask.
    }
    else {
        // TODO: Implement Subtask 5 solution here.
        // You may leave this block unmodified if you are not attempting this
        // subtask.
    }
}

컴파일 시 표준 에러 (stderr) 메시지

koala.cpp:62: warning: "rep" redefined
   62 | #define rep(i, e) for(ll i = 0; i < e; i++)
      | 
koala.cpp:61: note: this is the location of the previous definition
   61 | #define rep(i,s,e) for(ll i = s;i < e; i++)
      | 
koala.cpp:91:18: error: macro "rep" passed 3 arguments, but takes just 2
   91 |     rep(i, 0, 100) {
      |                  ^
koala.cpp:62: note: macro "rep" defined here
   62 | #define rep(i, e) for(ll i = 0; i < e; i++)
      | 
koala.cpp: In function 'int minValue(int, int)':
koala.cpp:91:5: error: 'rep' was not declared in this scope
   91 |     rep(i, 0, 100) {
      |     ^~~
koala.cpp:80:8: warning: unused variable 'n' [-Wunused-variable]
   80 |     ll n = N, w = W;
      |        ^
koala.cpp:80:15: warning: unused variable 'w' [-Wunused-variable]
   80 |     ll n = N, w = W;
      |               ^