제출 #1145592

#제출 시각아이디문제언어결과실행 시간메모리
1145592KluydQ콤보 (IOI18_combo)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
 
#define respagold ios_base::sync_with_stdio(0), cin.tie(0);
#define ll long long
#define int long long
#define int2 __int128_t
#define FOR( i, x, n, d ) for( int i = x; i <= n; i += d )
#define FORR( i, x, n, d ) for( int i = x; i >= n; i -= d )
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x.size())
#define pb push_back
#define ins insert
#define lb lower_bound
#define ub upper_bound
#define pii pair <int, int>
#define mkp make_pair
 
using namespace std;
 
const int N = 3e5 + 123;
const int inf = 2e18;
const int MOD1 = 1e9 + 7;
const int MOD = 998244353;
const int P = 6547;
 
int b[N], nw[N], n, m, k, L, R, x, y, z, w, a[16][16], svb;

mt19937 rng( chrono::steady_clock::now().time_since_epoch().count());
 
int rand( int l, int r )
{
    uniform_int_distribution <int> uid( l, r );
    return uid( rng );
}
int press( string p )
{
	cin >> x;
	return x;
}
string guess_sequence( int n )
{
	string s = "";
	
	FOR( i, 1, n, 1 )
	{
		if( press( s + 'A' ) == i ) s += 'A';
		else if( press( s + 'B' ) == i ) s += 'B';
		else if( press( s + 'X' ) == i ) s += 'X';
		else if( press( s + 'Y' ) == i ) s += 'Y';
	}
	return s;
}
//void solve()
//{
//	
//}
//signed main() 
//{
////	freopen("newbarn.in", "r", stdin);
////	freopen("newbarn.out", "w", stdout);
//	    
//    respagold
//    
//    int test = 1;
//    
//    if( !test ) cin >> test;
//	
//	while( test -- )
//	{
//		solve();
//	}
//}
//// solved by KluydQ  

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

/usr/bin/ld: /tmp/cct4RPu2.o: in function `press(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
grader.cpp:(.text+0x0): multiple definition of `press(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'; /tmp/ccreILOx.o:combo.cpp:(.text+0x0): first defined here
/usr/bin/ld: /tmp/cct4RPu2.o: in function `main':
grader.cpp:(.text.startup+0x4c): undefined reference to `guess_sequence[abi:cxx11](int)'
collect2: error: ld returned 1 exit status