# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1029466 | vjudge1 | CATS (NOI14_cats) | C++17 | 1585 ms | 1732 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "bits/stdc++.h"
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
long long q, x, l, n;
cin>>q;
vector<int> Patronear;
long long Cos = 32;
long long Contador = Cos;
bool Seguir = 1;
while(q--){
cin>>x>>l>>n;
long long xx = x;
long long ll = l;
long long nn = n;
vector<long long> s1(2222, 0);
vector<long long> s2(2222, 0);
while(x > 0){
/*cout<<s1.back()<<" ";
cout<<s1[s1.size() - 2]<<" ";
cout<<s1[s1.size() - 3]<<" ";
cout<<s1[s1.size() - 4]<<"\n";
cout<<s2.back()<<" ";
cout<<s2[s2.size() - 2]<<" ";
cout<<s2[s2.size() - 3]<<" ";
cout<<s2[s2.size() - 4]<<"\n";
cout<<"\n";*/
s2.push_back(s1.back());
s1.pop_back();
for(long long i = 0; i < s1.size(); i++) s1[i] ^= 1;
/*cout<<s1.back()<<" ";
cout<<s1[s1.size() - 2]<<" ";
cout<<s1[s1.size() - 3]<<" ";
cout<<s1[s1.size() - 4]<<"\n";
cout<<s2.back()<<" ";
cout<<s2[s2.size() - 2]<<" ";
cout<<s2[s2.size() - 3]<<" ";
cout<<s2[s2.size() - 4]<<"\n";
cout<<"\n";*/
if(s2.back() > l){
x--;
/*cout<<s2.back()<<" ";
Contador--;
//if(Seguir) cout<<s2.back() % 2<<", ";
if(Contador == 0){
cout<<"\n";
Contador = Cos;
Seguir = 0;
}*/
if(x == 0) cout<<s2.back()<<"\n";
//Patronear.push_back(s2.back());
} else {
s2.push_back(n);
s2.push_back(n);
long long Suma = s2.back();
s2.pop_back();
Suma += s2.back();
s2.back() = Suma;
Suma = s2.back();
s2.pop_back();
Suma += s2.back();
s2.back() = Suma;
s1.push_back(s2.back());
s1.push_back(s2.back());
s2.pop_back();
s2.pop_back();
}
}
}
/*for(long long i = 0; i < Patronear.size(); i++){
vector<int> Intento;
long long j = 0;
for(; j < i + 1; j++){
Intento.push_back(Patronear[j]);
}
bool Joya = 1;
while(j < Patronear.size()){
long long k;
for(k = 0; k < i + 1 and k < Patronear.size(); k++){
if(Intento[k] != Patronear[k + j]){
Joya = 0;
break;
}
}
j = k + 1;
}
if(Joya) cout<<i + 1;
if(Joya) break;
}*/
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |