답안 #239886

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
239886 2020-06-17T12:44:05 Z abacaba 곤돌라 (IOI14_gondola) C++14
컴파일 오류
0 ms 0 KB
#include <iostream>
#include <string>
#include "gondola.h"
#include <unordered_map>
#include <unordered_set>
#include <cstring>
#include <chrono>
#include <vector>
#include <map>
#include <random>
#include <set>
#include <algorithm>
#include <math.h>
#include <cstdio>
#include <stdio.h>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <deque>
#include <cassert>
#include <stack>
using namespace std;

#define mp make_pair
#define f first
#define se second
#define pb push_back
#define ppb pop_back
#define emb emplace_back
#define ll long long
#define ull unsigned long long
#define cntbit(x) __builtin_popcount(x)
#define endl '\n'
#define uset unordered_set
#define umap unordered_map
#define pii pair<int, int>
#define ld long double
#define pll pair<long long, long long>

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

template <typename T> inline T range(T l, T r) {
    return uniform_int_distribution<T>(l, r)(rng);
}

inline void setin(string s) {
    freopen(s.c_str(), "r", stdin);
}

inline void setout(string s) {
    freopen(s.c_str(), "w", stdout);
}

template <typename T> void Min(T &a, T b) {
    a = min(a, b);
}

template <typename T> void Max(T &a, T b) {
    a = max(a, b);
}

const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const int N = 3e5 + 15;

int gondolaSequence[N];
int replacementSequence[N];

int a[N], b[N];

int valid(int n, int inputSeq[]) {
    for(int i = 0; i < n; ++i)
        a[i] = inputSeq[i] - 1;
    for(int i = 0; i < n; ++i) {
        if(a[i] < n) {
            int cnt = a[i];
            for(int j = i; j <= n; ++j, cnt = (cnt + 1) % n)
                b[j] = cnt;
            for(int j = 0; j < i; ++j, cnt = (cnt + 1) % n)
                b[j] = cnt;
        }
    }
    for(int i = 0; i < n; ++i)
        if(a[i] < n && b[i] < n && a[i] != b[i])
            return 0;
    return 1;
}

int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
  return -2;
}

int countReplacement(int n, int inputSeq[])
{
  return -3;
}

Compilation message

/tmp/cc4sChJV.o:(.bss+0xf4260): multiple definition of `gondolaSequence'
/tmp/ccF8rhQ1.o:(.bss+0x36ef40): first defined here
/usr/bin/ld: Warning: size of symbol `gondolaSequence' changed from 1200060 in /tmp/ccF8rhQ1.o to 400004 in /tmp/cc4sChJV.o
/tmp/cc4sChJV.o:(.bss+0x0): multiple definition of `replacementSequence'
/tmp/ccF8rhQ1.o:(.bss+0x249f80): first defined here
/usr/bin/ld: Warning: size of symbol `replacementSequence' changed from 1200060 in /tmp/ccF8rhQ1.o to 1000004 in /tmp/cc4sChJV.o
collect2: error: ld returned 1 exit status