QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#115446#6628. Flip it and Stick itmikefeng#1 1ms4128kbC++172.0kb2023-06-26 09:38:212024-05-31 14:13:31

Judging History

你现在查看的是最新测评结果

  • [2024-05-31 14:13:31]
  • 评测
  • 测评结果:1
  • 用时:1ms
  • 内存:4128kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-26 09:38:21]
  • 提交

answer

bool M1;
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#include<climits>
#include<iomanip>
#include<cassert>
#include<random>
#include<cstdio>
#include<vector>
#include<bitset>
#include<stack>
#include<queue>
#include<deque>
#include<cmath>
#include<ctime>
#include<map>
#include<set>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/hash_policy.hpp>
//#include<ext/pb_ds/priority_queue.hpp>
#define fi first
#define se second
#define LD double
#define name(x) #x
#define ll long long
#define Vector Point
#define I128 __int128
#define ull unsigned ll
#define pii pair<int,int>
#define pb(x) push_back(x)
#define dek(x) debug(x)<<" "
#define deh(x) debug(x)<<endl
#define syt cerr<<"sytakioi\n"
#define debug(x) cout<<name(x)<<":"<<x
#define F(i,a,b) for(int i=a,i##end=b;i<=i##end;++i)
#define UF(i,a,b) for(int i=a,i##end=b;i>=i##end;--i)
#define look_memory cerr<<abs(&M2-&M1)/1024.0/1024<<'\n'
#define rd_i(l,r) uniform_int_distribution<int>(l,r)(rd)
#define rd_r(l,r) uniform_real_distribution<double>(l,r)(rd)
#define look_time cerr<<(clock()-Time)*1.0/CLOCKS_PER_SEC<<'\n'
using namespace std;
//using namespace __gnu_cxx;
mt19937 rd(time(0));
int num0,num1;
string s,t;
namespace sub1{
inline void mian(){
	F(i,0,s.size()-1) if(s[i]==t[0]) return void(cout<<"-1\n");
	cout<<"0\n";
}
}
namespace sub2{
inline void solve1(){
	int num=1;
	if(s[0]=='1'||s.back()=='1') num=0;
	F(i,1,s.size()-1) if(s[i]=='1'&&s[i-1]=='0') ++num;
	cout<<num<<'\n';
}
inline void solve2(){
	
}
inline void mian(){
	if(t[0]!=t[1]) solve1();
	else solve2();
}
}
namespace sub3{
inline void mian(){
	
}
}
bool M2;
int main(){
	int Time=clock();
	look_memory;
	cin.tie(nullptr)->sync_with_stdio(false);
	cin>>s>>t;
	F(i,0,t.size()-1)
		if(t[i]=='0') ++num0;
		else ++num1;
	if(num1>num0){
		F(i,0,t.size()-1) t[i]^=1;
		F(i,0,s.size()-1) s[i]^=1;
	}
	if(t.size()==1) sub1::mian();
	else if(t.size()==2) sub2::mian();
	else sub3::mian();
	look_time;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 1
Accepted

Test #1:

score: 1
Accepted
time: 1ms
memory: 3864kb

input:

1
0

output:

0

result:

ok 1 number(s): "0"

Test #2:

score: 1
Accepted
time: 0ms
memory: 3996kb

input:

1
1

output:

-1

result:

ok 1 number(s): "-1"

Test #3:

score: 1
Accepted
time: 1ms
memory: 4076kb

input:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

-1

result:

ok 1 number(s): "-1"

Test #4:

score: 1
Accepted
time: 1ms
memory: 4124kb

input:

111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

0

result:

ok 1 number(s): "0"

Test #5:

score: 1
Accepted
time: 1ms
memory: 4128kb

input:

101001000011101010101001001010010110111111001100110001111101111110110110101011111010001101111001101101010111101100000110001110001100000101111100000110111110001010101101101110001000011010000101000110110010110110100001110001111001010000000010000000101000000100110011101110100111111101111111111110010101...

output:

-1

result:

ok 1 number(s): "-1"

Test #6:

score: 1
Accepted
time: 1ms
memory: 4120kb

input:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

0

result:

ok 1 number(s): "0"

Test #7:

score: 1
Accepted
time: 0ms
memory: 4080kb

input:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

-1

result:

ok 1 number(s): "-1"

Subtask #2:

score: 0
Wrong Answer

Test #8:

score: 0
Wrong Answer
time: 0ms
memory: 3948kb

input:

0
01

output:

1

result:

wrong answer 1st numbers differ - expected: '0', found: '1'

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Wrong Answer

Test #40:

score: 0
Wrong Answer
time: 0ms
memory: 3928kb

input:

11
011

output:


result:

wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements

Subtask #5:

score: 0
Wrong Answer

Test #53:

score: 0
Wrong Answer
time: 0ms
memory: 3952kb

input:

11
011

output:


result:

wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements

Subtask #6:

score: 0
Skipped

Dependency #4:

0%