#include "Anna.h"
#include <vector>
namespace {
int variable_example = 0;
}
void Anna(int N, std::vector<char> S) {
for(int i=0;i<N;i++){
if(S[i]=='X'){
Send(0);
Send(0);
}
if(S[i]=='Y'){
Send(0);
Send(1);
}
if(S[i]=='Z'){
Send(1);
Send(0);
}
}
}
#include "Bruno.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
namespace {
int variable_example = 0;
int FunctionExample(int P) { return 1 - P; }
} // namespace
void Bruno(int N, int L, std::vector<int> A) {
vector<int> arr(N);
for(int i=0;i<N;i++){
int c = 2*A[2*i] + A[2*i+1];
arr[i]=c;
}
queue<int> z;
vector<bool> taken(N,0);
vector<tuple<int,int,int> > dostuff;
for(int i=0;i<N;i++){
if(arr[i]==2) z.push(i);
}
stack<int> x;
for(int i=0;i<N;i++){
if(arr[i]==0){
x.push(i);
continue;
}
if(arr[i]==1){
while(x.size() && x.top()>i) x.pop();
while(z.size() && z.front()<i) z.pop();
if(x.size() && z.size()){
taken[x.top()]=1;
taken[z.front()]=1;
taken[i]=1;
dostuff.push_back({x.top(),i,z.front()});
x.pop();
z.pop();
}
}
}
for(int i=0;i<N;i++) if(!taken[i]) Remove(i);
for(auto i : dostuff){
Remove(get<1>(i));
Remove(get<0>(i));
Remove(get<2>(i));
}
}
Compilation message
Anna.cpp:6:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
6 | int variable_example = 0;
| ^~~~~~~~~~~~~~~~
Bruno.cpp:10:5: warning: 'int {anonymous}::FunctionExample(int)' defined but not used [-Wunused-function]
10 | int FunctionExample(int P) { return 1 - P; }
| ^~~~~~~~~~~~~~~
Bruno.cpp:8:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
8 | int variable_example = 0;
| ^~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
784 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
60 ms |
10484 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |