QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#153613#5436. DRX vs. T1organput#AC ✓2ms3528kbC++141.7kb2023-08-30 14:04:162023-08-30 14:04:17

Judging History

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

  • [2023-08-30 14:04:17]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3528kb
  • [2023-08-30 14:04:16]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define fo(x,a,b) for(int x=a;x<=b;x++)
#define of(x,a,b) for(int x=a;x>=b;x--)
#define close(); std::ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);
#define PI acos(-1)
#define pb push_back
#define INF 0x3f3f3f3f
#define lowbit(a) ((a)&-(a))
#define lbit(a) (__builtin_ffsll(a))
#define ubit(a) (64-__builtin_clzll(a))
#define fi first
#define se second
bool isprime(ll x){
    if(x==1)return false;
    for(ll i=2;i<=x/i;i++){
        if(x%i==0)return false;
    }
    return true;
}
ll popcnt(ll x){
    ll cnt=0;
    while(x){
        if(x&1)cnt++;
        x>>=1;
    }
    return cnt;
}
ll qmi(ll a,ll b,ll p){
    a%=p;
    ll res=1;
    while(b){
        if(b&1)res=res*a%p;
        a=a*a%p;
        b>>=1;
    }
    return res;
}
ll exgcd(ll a,ll b,ll &x,ll &y){
    if(!b){
        x=1,y=0;
        return a;
    }
    ll d=exgcd(b,a%b,y,x);
    y-=a/b*x;
    return d;
}
const int N=2e5+10;
const int mod=1e9+7;
ll fact[N],in_fact[N];
ll C(ll n,ll m) {
    if (n < m || m < 0)return 0;
    return fact[n] * qmi(fact[m] * fact[n - m] % mod, mod - 2, mod) % mod;
}
//ll C(ll n,ll m){
//    if (n < m || m < 0)return 0;
//    return fact[n]%mod*in_fact[m]%mod*in_fact[n-m]%mod;
//}

void sol(){
    string s;
    cin>>s;
    int t,d,cnt;
    t=d=cnt=0;
    for(auto x:s){
        if(x=='T') t++;
        else if(x=='D') d++;
        else cnt++;
    }
    if(t==3){
        cout<<"T1"<<endl;
    }
    else cout<<"DRX"<<endl;
}

int main(){
    close();
    int t=1;
    //cin>>t;
    while(t--){
        sol();
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3472kb

input:

TDTT?

output:

T1

result:

ok single line: 'T1'

Test #2:

score: 0
Accepted
time: 2ms
memory: 3460kb

input:

DTDD?

output:

DRX

result:

ok single line: 'DRX'

Test #3:

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

input:

DDD??

output:

DRX

result:

ok single line: 'DRX'

Test #4:

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

input:

DDTD?

output:

DRX

result:

ok single line: 'DRX'

Test #5:

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

input:

DDTTD

output:

DRX

result:

ok single line: 'DRX'

Test #6:

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

input:

DDTTT

output:

T1

result:

ok single line: 'T1'

Test #7:

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

input:

DTDTD

output:

DRX

result:

ok single line: 'DRX'

Test #8:

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

input:

DTDTT

output:

T1

result:

ok single line: 'T1'

Test #9:

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

input:

DTTDD

output:

DRX

result:

ok single line: 'DRX'

Test #10:

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

input:

DTTDT

output:

T1

result:

ok single line: 'T1'

Test #11:

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

input:

DTTT?

output:

T1

result:

ok single line: 'T1'

Test #12:

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

input:

TDDD?

output:

DRX

result:

ok single line: 'DRX'

Test #13:

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

input:

TDDTD

output:

DRX

result:

ok single line: 'DRX'

Test #14:

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

input:

TDDTT

output:

T1

result:

ok single line: 'T1'

Test #15:

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

input:

TDTDD

output:

DRX

result:

ok single line: 'DRX'

Test #16:

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

input:

TDTDT

output:

T1

result:

ok single line: 'T1'

Test #17:

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

input:

TTDDD

output:

DRX

result:

ok single line: 'DRX'

Test #18:

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

input:

TTDDT

output:

T1

result:

ok single line: 'T1'

Test #19:

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

input:

TTDT?

output:

T1

result:

ok single line: 'T1'

Test #20:

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

input:

TTT??

output:

T1

result:

ok single line: 'T1'