제출 #1117315

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

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

password.cpp: In function 'std::string guess(long long int, long long int)':
password.cpp:9:18: error: 'i' was not declared in this scope
    9 |     for(int j=1; i<=s; j++){
      |                  ^
password.cpp:10:12: error: 'query' was not declared in this scope
   10 |         if(query(a)==1)c.push_back(a);
      |            ^~~~~
password.cpp:13:19: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |     for(int j=0; j<c.size(); j++){
      |                  ~^~~~~~~~~
password.cpp:15:23: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |         for(int i=0; i<c.size(); i++){
      |                      ~^~~~~~~~~
password.cpp:17:20: error: 'query' was not declared in this scope
   17 |                 if(query(c[i]+c[j])==2)cnt++;
      |                    ^~~~~
password.cpp:21:1: warning: no return statement in function returning non-void [-Wreturn-type]
   21 | }
      | ^