Submission #1007116

#TimeUsernameProblemLanguageResultExecution timeMemory
1007116christinelynnCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> /* Pragmaaa */ #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") /* Primitive Data */ #define ll long long #define db double /* Pair Macro */ #define pii pair<int,int> #define pll pair<ll,ll> #define fi first #define sc second /* Vector Macro */ #define vi vector<int> #define vll vector<ll> #define pb push_back /* All Rounder */ #define all(x) x.begin(),x.end() #define forn(i,n) for(int (i) = 1; i<= int (n); i++) #define for0(i,n) for(int (i) = 0; i < int (n); i++) #define INF 1e9 #define LLINF 1e18 #define nl '\n' #define tab ' ' // Hati-hati kalau mau ngeflush tapi endl jadi nya '\n' #define flushmanual ios_base::sync_with_stdio(false); cin.tie(NULL) using namespace std; string guess_sequence(int N){ char a[9]; a[1] = 'A', a[2] = 'B', a[3] = 'X',a[4] = 'Y'; forn(i,4)forn(j,4)forn(k,4){ string c = a[i] + a[j] + a[k]; if(press(c) == 3){ return c; } } }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:24:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   24 | #define forn(i,n) for(int (i) = 1; i<= int (n); i++)
      |                           ^
combo.cpp:41:3: note: in expansion of macro 'forn'
   41 |   forn(i,4)forn(j,4)forn(k,4){
      |   ^~~~
combo.cpp:24:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
   24 | #define forn(i,n) for(int (i) = 1; i<= int (n); i++)
      |                           ^
combo.cpp:41:12: note: in expansion of macro 'forn'
   41 |   forn(i,4)forn(j,4)forn(k,4){
      |            ^~~~
combo.cpp:24:27: warning: unnecessary parentheses in declaration of 'k' [-Wparentheses]
   24 | #define forn(i,n) for(int (i) = 1; i<= int (n); i++)
      |                           ^
combo.cpp:41:21: note: in expansion of macro 'forn'
   41 |   forn(i,4)forn(j,4)forn(k,4){
      |                     ^~~~
combo.cpp:42:28: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   42 |     string c = a[i] + a[j] + a[k];
      |                ~~~~~~~~~~~~^~~~~~
combo.cpp:43:8: error: 'press' was not declared in this scope
   43 |     if(press(c) == 3){
      |        ^~~~~
combo.cpp:48:1: warning: control reaches end of non-void function [-Wreturn-type]
   48 | }
      | ^