QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#282979 | #6651. 喵了个喵 III | one_god_and_two_dogs# | WA | 1ms | 3828kb | C++20 | 569b | 2023-12-13 16:38:06 | 2023-12-13 16:38:06 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int main(){
cin.tie(0)->sync_with_stdio(0);
int m;
cin>>m;
vector<int>A(m),B,C,mk(m);
for(int i=0;i<m;++i)cin>>A[i];
string ans="";
for(int i=0;i<m;++i){
if(mk[A[i]]){
C.emplace_back(A[i]);
ans+='2';
}else {
B.emplace_back(A[i]);
ans+='1';
}
mk[A[i]]=1;
while(!B.empty()&&!C.empty()&&C.back()==B.back()){
ans+='0';
C.erase(--C.end());
B.erase(--B.end());
}
}
if(B.empty()&&C.empty()){
cout<<"Cleared.\n";
cout<<ans.length()<<"\n";
cout<<ans;
}else cout<<"No solution.\n";
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3828kb
input:
1500 589 589 675 675 619 619 216 216 113 113 649 649 541 541 9 9 412 412 153 153 588 588 500 500 343 343 508 508 358 358 513 513 346 346 485 485 467 467 585 585 648 648 158 158 304 304 654 654 247 247 267 267 13 13 224 224 746 746 85 85 711 711 189 189 528 528 450 450 124 124 254 254 677 677 683 683...
output:
Cleared. 2250 1201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201...
result:
ok Accepted
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3652kb
input:
1500 750 749 748 747 746 745 744 743 742 741 740 739 738 737 736 735 734 733 732 731 730 729 728 727 726 725 724 723 722 721 720 719 718 717 716 715 714 713 712 711 710 709 708 707 706 705 704 703 702 701 700 699 698 697 696 695 694 693 692 691 690 689 688 687 686 685 684 683 682 681 680 679 678 677...
output:
No solution.
result:
wrong answer Wrong Answer