QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#291969 | #5436. DRX vs. T1 | xiaolang# | WA | 0ms | 3780kb | C++14 | 2.3kb | 2023-12-27 14:55:03 | 2023-12-27 14:55:03 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=2e6+5;
int a[N];
struct List{
int pre,nxt;
}li[N];
int tail;
struct Node{
int lazy,lazyc,lazy_eq,max_x;
}t[N<<2];
int id1,id2,cc;
void pushdown(int id){
if(t[id].lazy_eq!=-1){
t[id<<1]=t[id<<1|1]=(Node){0,0,t[id].lazy_eq,t[id].lazy_eq};
t[id].lazy_eq=-1;
}
if(t[id].lazyc){
id1=id<<1;
id2=id<<1|1;
cc=t[id].lazyc;
t[id1].lazyc+=cc;
t[id1].max_x+=cc;
t[id2].lazyc+=cc;
t[id2].max_x+=cc;
t[id].lazyc=0;
}
}
int ccc;
void change(int id,int l,int r,int l1,int r1,bool typ){//0:= 1:+
if(l1==l&&r1==r){
if(typ){
t[id].lazyc+=ccc;
t[id].max_x+=ccc;
return;
}
t[id].lazy_eq=t[id].max_x=ccc;
t[id].lazyc=0;
return;
}
pushdown(id);
int mid=l1+r1>>1;
if(mid>=r)change(id<<1,l,r,l1,mid,typ);
else if(mid+1<=l)change(id<<1|1,l,r,mid+1,r1,typ);
else{
change(id<<1,l,mid,l1,mid,typ);
change(id<<1|1,mid+1,r,mid+1,r1,typ);
}
t[id].max_x=max(t[id<<1].max_x,t[id<<1|1].max_x);
}
void changee(int id,int l,int r,int l1,int r1){
if(l1==l&&r1==r){
t[id].lazy=((ccc>t[id].lazy)?ccc:t[id].lazy);
return;
}
int mid=l1+r1>>1;
if(mid>=r)changee(id<<1,l,r,l1,mid);
else if(mid+1<=l)changee(id<<1|1,l,r,mid+1,r1);
else{
changee(id<<1,l,mid,l1,mid);
changee(id<<1|1,mid+1,r,mid+1,r1);
}
}
int query1(int id,int pos,int l1,int r1){
if(l1==r1)return t[id].max_x;
pushdown(id);
int mid=l1+r1>>1;
if(mid>=pos)return query1(id<<1,pos,l1,mid);
else return query1(id<<1|1,pos,mid+1,r1);
}
int query2(int id,int pos,int l1,int r1){
if(l1==r1)return t[id].lazy;
int mid=l1+r1>>1;
if(mid>=pos)return max(query2(id<<1,pos,l1,mid),t[id].lazy);
else return max(query2(id<<1|1,pos,mid+1,r1),t[id].lazy);
}
struct Que{
int l,r;
int id,ans;
}q[N];
int last[N],pre[N],nxt[N];
bool cmp(Que x,Que y){
return x.r<y.r;
}
bool cmp1(Que x,Que y){
return x.l>y.l;
}
int ans[N];
int read(){
register int sum=0,op=1;
char ch=getchar();
while(ch<'0'||ch>'9'){
if(ch=='-')op=-1;
ch=getchar();
}
while(ch>='0'&&ch<='9'){
sum=(sum<<3)+(sum<<1)+ch-'0';
ch=getchar();
}
return sum*op;
}
int main(){
string s;
cin>>s;
int sum=0;
for(int i=0;i<4;i++){
if(s[i]=='T')sum++;
}
if(sum>=3)cout<<"T1\n";
else cout<<"DRX\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3488kb
input:
TDTT?
output:
T1
result:
ok single line: 'T1'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3488kb
input:
DTDD?
output:
DRX
result:
ok single line: 'DRX'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3516kb
input:
DDD??
output:
DRX
result:
ok single line: 'DRX'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
DDTD?
output:
DRX
result:
ok single line: 'DRX'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
DDTTD
output:
DRX
result:
ok single line: 'DRX'
Test #6:
score: -100
Wrong Answer
time: 0ms
memory: 3544kb
input:
DDTTT
output:
DRX
result:
wrong answer 1st lines differ - expected: 'T1', found: 'DRX'