Submission #1117314

#TimeUsernameProblemLanguageResultExecution timeMemory
1117314CiprianPassword (RMI18_password)C++14
Compilation error
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(quess(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(guess(c[i]+c[j])==2)cnt++; } }b[cnt]=c[j]; }for(int j=0; j<n; j++)cout<<b[j]; }

Compilation message (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: 'quess' was not declared in this scope; did you mean 'guess'?
   10 |         if(quess(a)==1)c.push_back(a);
      |            ^~~~~
      |            guess
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:35: error: too few arguments to function 'std::string guess(long long int, long long int)'
   17 |                 if(guess(c[i]+c[j])==2)cnt++;
      |                                   ^
password.cpp:5:8: note: declared here
    5 | string guess(int n, int s){
      |        ^~~~~
password.cpp:21:1: warning: no return statement in function returning non-void [-Wreturn-type]
   21 | }
      | ^