QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#96260 | #2923. Code Guessing | mariam# | AC ✓ | 2ms | 3460kb | C++17 | 2.5kb | 2023-04-13 18:11:15 | 2023-04-13 18:11:18 |
Judging History
answer
//#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <set>
#include <unordered_set>
#include <queue>
#include <map>
#include <cmath>
#include <climits>
#include <iomanip>
#include <unordered_map>
#include <stdio.h>
#include <stack>
#include <list>
#include "complex"
#include <assert.h>
#define el '\n'
#define ll long long
#define ld long double
using namespace std;
//
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//
//using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
const int N = 2e5 + 5, mod = 1e9 + 7, MAX = 1e9 + 1, M = 1e5;
long double PI = 3.14159265358979323846;;
#define point complex<long double>
#define vec(a, b) b-a
#define dot(a, b) (long double)(conj(a)*b).real()
#define cross(a, b) (long double)(conj(a)*b).imag()
#define length(a) (hypot((a).imag(), (a).real()))
#define angle(a) atan2((a).imag(), (a).real())
int h, w;
//char a[201][201];
//int dx[] = {0, 0, -1, 1, 1, -1, -1, 1}, dy[] = {-1, 1, 0, 0, 1, -1, 1, -1};
//int dx[] = {-1, -1, 0, 0, 1, 1}, dy[] = {-1, 0, -1, 1, 0, 1};
//
//bool valid(int i, int j) {
// return (i < h && i >= 0 && j < w && j >= 0);
//}
//
//bool vis[201][201];
ll mul(ll a, ll b) {
return ((a % mod) * (b % mod)) % mod;
}
ll add(ll a, ll b) {
return ((a % mod) + (b % mod)) % mod;
}
ll sub(ll a, ll b) {
return ((((a + mod) % mod) - ((b + mod) % mod)) + mod) % mod;
}
ll fastpow(ll b, ll p) {
if (p == 0)
return 1;
if (p == 1) {
return b;
}
ll hp = fastpow(b, p / 2);
ll ans = ((hp % mod) * (hp % mod)) % mod;
if (p % 2) {
ans = (ans * b) % mod;
}
return ans % mod;
}
void m() {
int a,b;
cin>>a>>b;
string s;
cin>>s;
if(a>b)swap(a,b);
//
if(s=="AABB"&&b==7){
cout<<"8 9\n";
}else if(s=="BBAA"&&a==3){
cout<<"1 2\n";
}else if(s=="ABBA"&&b-a==3){
cout<<a+1<<" "<<a+2<<"\n";
}else if(s=="BABA"&&a==2&&b==4){
cout<<"1 3\n";
}else if(s=="ABAB"&&b==8&&a==6){
cout<<"7 9\n";
}else if(s=="BAAB"&&a==2&&b==8){
cout<<"1 9\n";
}else cout<<"-1\n";
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t = 1;
// cin>>t;
while (t--) {
m();
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3352kb
input:
3 4 BBAA
output:
1 2
result:
ok single line: '1 2'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3352kb
input:
3 7 BBAA
output:
1 2
result:
ok single line: '1 2'
Test #3:
score: 0
Accepted
time: 2ms
memory: 3404kb
input:
3 9 BBAA
output:
1 2
result:
ok single line: '1 2'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3360kb
input:
5 6 BBAA
output:
-1
result:
ok single line: '-1'
Test #5:
score: 0
Accepted
time: 2ms
memory: 3344kb
input:
6 7 AABB
output:
8 9
result:
ok single line: '8 9'
Test #6:
score: 0
Accepted
time: 2ms
memory: 3348kb
input:
3 7 AABB
output:
8 9
result:
ok single line: '8 9'
Test #7:
score: 0
Accepted
time: 1ms
memory: 3340kb
input:
1 7 AABB
output:
8 9
result:
ok single line: '8 9'
Test #8:
score: 0
Accepted
time: 2ms
memory: 3352kb
input:
4 5 AABB
output:
-1
result:
ok single line: '-1'
Test #9:
score: 0
Accepted
time: 1ms
memory: 3384kb
input:
1 4 ABBA
output:
2 3
result:
ok single line: '2 3'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3312kb
input:
3 6 ABBA
output:
4 5
result:
ok single line: '4 5'
Test #11:
score: 0
Accepted
time: 2ms
memory: 3352kb
input:
4 7 ABBA
output:
5 6
result:
ok single line: '5 6'
Test #12:
score: 0
Accepted
time: 2ms
memory: 3388kb
input:
5 9 ABBA
output:
-1
result:
ok single line: '-1'
Test #13:
score: 0
Accepted
time: 1ms
memory: 3308kb
input:
1 5 ABBA
output:
-1
result:
ok single line: '-1'
Test #14:
score: 0
Accepted
time: 2ms
memory: 3372kb
input:
2 7 ABBA
output:
-1
result:
ok single line: '-1'
Test #15:
score: 0
Accepted
time: 1ms
memory: 3432kb
input:
1 9 ABBA
output:
-1
result:
ok single line: '-1'
Test #16:
score: 0
Accepted
time: 2ms
memory: 3352kb
input:
2 8 BAAB
output:
1 9
result:
ok single line: '1 9'
Test #17:
score: 0
Accepted
time: 2ms
memory: 3436kb
input:
3 8 BAAB
output:
-1
result:
ok single line: '-1'
Test #18:
score: 0
Accepted
time: 2ms
memory: 3432kb
input:
2 6 BAAB
output:
-1
result:
ok single line: '-1'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3384kb
input:
4 5 BAAB
output:
-1
result:
ok single line: '-1'
Test #20:
score: 0
Accepted
time: 0ms
memory: 3340kb
input:
6 8 ABAB
output:
7 9
result:
ok single line: '7 9'
Test #21:
score: 0
Accepted
time: 2ms
memory: 3460kb
input:
4 8 ABAB
output:
-1
result:
ok single line: '-1'
Test #22:
score: 0
Accepted
time: 1ms
memory: 3360kb
input:
3 7 ABAB
output:
-1
result:
ok single line: '-1'
Test #23:
score: 0
Accepted
time: 2ms
memory: 3384kb
input:
5 7 ABAB
output:
-1
result:
ok single line: '-1'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3344kb
input:
1 3 ABAB
output:
-1
result:
ok single line: '-1'
Test #25:
score: 0
Accepted
time: 0ms
memory: 3372kb
input:
2 4 BABA
output:
1 3
result:
ok single line: '1 3'
Test #26:
score: 0
Accepted
time: 2ms
memory: 3308kb
input:
2 5 BABA
output:
-1
result:
ok single line: '-1'
Test #27:
score: 0
Accepted
time: 0ms
memory: 3400kb
input:
3 5 BABA
output:
-1
result:
ok single line: '-1'
Test #28:
score: 0
Accepted
time: 2ms
memory: 3396kb
input:
7 9 BABA
output:
-1
result:
ok single line: '-1'
Test #29:
score: 0
Accepted
time: 0ms
memory: 3304kb
input:
6 9 ABBA
output:
7 8
result:
ok single line: '7 8'
Test #30:
score: 0
Accepted
time: 2ms
memory: 3368kb
input:
2 5 BAAB
output:
-1
result:
ok single line: '-1'