제출 #1117318

#제출 시각아이디문제언어결과실행 시간메모리
1117318CiprianPassword (RMI18_password)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int query(string s); string guess(int n, int s){ char a='a'; vector<char>c; char b[30]; for(int j=1; j<=s; j++){ if(query(string(1,a))==1)c.push_back(a); a++; } for(int j=0; j<c.size(); j++){ int cnt=0; for(int i=0; i<c.size(); i++){ if(j!=i){ if(query(string(1,c[i])+c[j])==2)cnt++; } }b[cnt]=c[j]; }string w; for(int j=0; j<n; j++)w+=b[j]; return w; }

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

password.cpp: In function 'std::string guess(long long int, long long int)':
password.cpp:14:19: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |     for(int j=0; j<c.size(); j++){
      |                  ~^~~~~~~~~
password.cpp:16:23: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |         for(int i=0; i<c.size(); i++){
      |                      ~^~~~~~~~~
/usr/bin/ld: /tmp/ccho3x6O.o: in function `main':
grader.cpp:(.text.startup+0x66): undefined reference to `guess[abi:cxx11](int, int)'
collect2: error: ld returned 1 exit status