QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#132974#6628. Flip it and Stick itblackyuki#1 3ms3976kbC++14695b2023-08-01 12:24:292024-07-04 01:04:06

Judging History

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

  • [2024-07-04 01:04:06]
  • 评测
  • 测评结果:1
  • 用时:3ms
  • 内存:3976kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-08-01 12:24:29]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define REP(i,k,n) for(ll i=(ll)(k);i<(ll)(n);i++)
#define all(a) a.begin(),a.end()
template<class T> void out(T a){cout<<a<<'\n';}
ll sol1(ll n,string s,string t){
    rep(i,n)if(s[i]==t[0])return -1;
    return 0;
}
ll sol2(ll n,string s,string t){
    return -1;
}
ll sol3(ll n,string s,string t){
    return -1;
}
int main(){
    string s,t;cin>>s>>t;
    ll n=s.size();
    ll res=-1;
    if(t.size()==1)res=sol1(n,s,t);
    else if(t.size()==2&&t[0]!=t[1])res=sol2(n,s,t);
    else if(t.size()==2)res=sol3(n,s,t);
    out(res);
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 1
Accepted

Test #1:

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

input:

1
0

output:

0

result:

ok 1 number(s): "0"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

1
1

output:

-1

result:

ok 1 number(s): "-1"

Test #3:

score: 0
Accepted
time: 3ms
memory: 3800kb

input:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

-1

result:

ok 1 number(s): "-1"

Test #4:

score: 0
Accepted
time: 3ms
memory: 3976kb

input:

111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

0

result:

ok 1 number(s): "0"

Test #5:

score: 0
Accepted
time: 3ms
memory: 3800kb

input:

101001000011101010101001001010010110111111001100110001111101111110110110101011111010001101111001101101010111101100000110001110001100000101111100000110111110001010101101101110001000011010000101000110110010110110100001110001111001010000000010000000101000000100110011101110100111111101111111111110010101...

output:

-1

result:

ok 1 number(s): "-1"

Test #6:

score: 0
Accepted
time: 3ms
memory: 3936kb

input:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

0

result:

ok 1 number(s): "0"

Test #7:

score: 0
Accepted
time: 3ms
memory: 3716kb

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: 3592kb

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: 3588kb

input:

11
011

output:

-1

result:

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

Subtask #5:

score: 0
Wrong Answer

Test #53:

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

input:

11
011

output:

-1

result:

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

Subtask #6:

score: 0
Skipped

Dependency #4:

0%