Submission #269841

# Submission time Handle Problem Language Result Execution time Memory
269841 2020-08-17T10:46:32 Z barsbold Combo (IOI18_combo) C++14
0 / 100
1 ms 200 KB
#include "combo.h"
#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
std::string guess_sequence(int N) {
  std::string p = "";
  std::string s = "";
  s = p + 'A';
  if(s[s.size() - 1] == 'A'){
    int coins = press(s);
    if(coins = s.size()){
      p+="A";
    }
  }
  s = p + "B";
  if(s[s.size() - 1] == 'B'){
    int coins = press(s);
    if(coins = s.size()){
      p+="B";
    }
  }
  s = p +"X";
  if(s[s.size() - 1] == 'X'){
    int coins = press(s);
    if(coins = s.size()){
      p+="X";
    }
  }
  s = p + 'Y';
  if(s[s.size() - 1] == 'Y'){
    int coins = press(s);
    if(coins = s.size()){
      p+="Y";
    }
  }
  return p;
}

Compilation message

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:12:14: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   12 |     if(coins = s.size()){
      |        ~~~~~~^~~~~~~~~~
combo.cpp:19:14: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   19 |     if(coins = s.size()){
      |        ~~~~~~^~~~~~~~~~
combo.cpp:26:14: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   26 |     if(coins = s.size()){
      |        ~~~~~~^~~~~~~~~~
combo.cpp:33:14: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   33 |     if(coins = s.size()){
      |        ~~~~~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Wrong Answer: wrong guess.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 200 KB Wrong Answer: wrong guess.
2 Halted 0 ms 0 KB -