transfer.cpp: In function 'bool jump(int)':
transfer.cpp:18:5: error: 'cout' was not declared in this scope
18 | cout<<x<<endl;
| ^~~~
transfer.cpp:2:1: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
1 | #include "transfer.h"
+++ |+#include <iostream>
2 |
transfer.cpp:18:14: error: 'endl' was not declared in this scope
18 | cout<<x<<endl;
| ^~~~
transfer.cpp:2:1: note: 'std::endl' is defined in header '<ostream>'; did you forget to '#include <ostream>'?
1 | #include "transfer.h"
+++ |+#include <ostream>
2 |
transfer.cpp:20:5: error: 'cin' was not declared in this scope
20 | cin>>ans;
| ^~~
transfer.cpp:20:5: note: 'std::cin' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
transfer.cpp: In function 'vi get_attachment(vi)':
transfer.cpp:26:12: error: conversion from 'int' to non-scalar type 'vi' {aka 'std::vector<int>'} requested
26 | vi x = 0;
| ^
transfer.cpp:29:10: error: no match for 'operator^=' (operand types are 'vi' {aka 'std::vector<int>'} and 'int')
29 | x^=i*(source[i-1]);
transfer.cpp:33:25: error: no match for 'operator&' (operand types are 'int' and 'vi' {aka 'std::vector<int>'})
33 | ans[i] = ((1<<i)&x ? 1 : 0);
| ~~~~~~^~
| | |
| int vi {aka std::vector<int>}
transfer.cpp: In function 'vi retrieve_data(vi)':
transfer.cpp:56:9: error: redeclaration of 'int x'
56 | int x = 0;
| ^
transfer.cpp:43:9: note: 'int x' previously declared here
43 | int x = 0;
| ^
transfer.cpp:72:21: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
72 | ans1[x^y-1]^=1;
| ~^~
transfer.cpp:79:21: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
79 | ans1[x^y-1]^=1;
| ~^~