ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#214984 | #2037. a | lbh_2008 | 0 | 9ms | 1208kb | C++ | 414b | 2024-11-25 19:13:51 | 2024-11-25 23:01:56 |
answer
#include<bits/stdc++.h>
using namespace std;
int ans;
int l,r;
char o[1145140];
int panduan(int c,int i)
{
if(l>i&&l-i>=c&&l+i+1<=r)
if(o[l-i-1]=='('&&o[l+i]==')')
{
ans+=2;
panduan(c,i+1);
return 0;
}
else return 0;
}
int main()
{
cin>>o;
int q;
cin>>q;
while(q--)
{
cin>>l>>r;
int c=l;
ans=0;
for(;l<=r;l++)
{
panduan(c,0);
}
cout<<ans<<endl;
}
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 0
Wrong Answer
time: 3ms
memory: 1208kb
input:
(()))())))(())()())()()))((((()()))((((()((())()))(()((((()(())(())(()))())()())()())(())(()()((((((...
output:
572 96 80 12 562 152 380 182 354 198 164 250 552 326 116 188 370 344 318 76 120 8 564 214 222 180 25...
result:
wrong answer 1st lines differ - expected: '854', found: '572'
Test #2:
score: 0
Wrong Answer
time: 0ms
memory: 1204kb
input:
)))((()())((())((()()())())(((())())((()((())(())()((((((())))((()(()())))(()()(())())()))(()()))(((...
output:
20 18 66 276 188 124 282 42 332 80 426 328 82 42 238 174 238 12 110 144 230 34 262 340 58 342 36 312...
result:
wrong answer 1st lines differ - expected: '30', found: '20'
Test #3:
score: 0
Wrong Answer
time: 3ms
memory: 1204kb
input:
(()((())))))))((())(()()))()))()()())(()))(())))))))(((())((((((((((()((()())()(()(())(()())(()))(((...
output:
488 142 78 116 148 172 276 538 128 158 154 430 292 202 176 268 162 340 124 320 144 494 178 172 566 2...
result:
wrong answer 1st lines differ - expected: '674', found: '488'
Test #4:
score: 0
Wrong Answer
time: 0ms
memory: 1204kb
input:
))))))))()))())()(()()())()())(((()())(((()(((()()))(()()()))())(()()(()()())()(())()())))))()((((()...
output:
120 264 194 274 382 226 50 342 512 202 138 282 50 324 284 140 138 426 134 106 636 300 372 40 76 308 ...
result:
wrong answer 1st lines differ - expected: '168', found: '120'
Test #5:
score: 0
Wrong Answer
time: 3ms
memory: 1204kb
input:
((())))(()((()()))()))))((((()()()()()()()))()()(()(())(()((()))()((())))))()(((()())()))()())))(())...
output:
442 280 258 6 172 266 156 294 196 114 186 320 220 84 384 92 422 558 88 116 56 340 178 110 20 228 384...
result:
wrong answer 1st lines differ - expected: '634', found: '442'
Test #6:
score: 0
Wrong Answer
time: 0ms
memory: 1208kb
input:
))((()))()(())())(()()))))()()((((()()())()((())(())))))(())))()())()()(())()(())())(()())))(()()))(...
output:
510 180 400 158 552 112 198 152 0 480 184 218 446 226 582 334 278 514 66 104 286 318 104 12 204 546 ...
result:
wrong answer 1st lines differ - expected: '728', found: '510'
Test #7:
score: 0
Time Limit Exceeded
input:
((((()))()()())(()))((()())(((())))(()((()))))))()()))()))((((()(()(()()()(()(())(()())))(((()())))(...
output:
95456 157344 298512 507110 89750 500094 56172 457902 21346 382202 244386 45204 12394 403172 631638 6...
result:
Test #8:
score: 0
Time Limit Exceeded
input:
())))()))))(()))()())(()(()))((()))))(()))((())()((()(()()((())(())()))(()))))())(((()(())()(())()()...
output:
390382 284760 170368 300136 134538 172126 111938 77286 37142 294470 92696 588618 388370 303214 65752...
result:
Test #9:
score: 0
Time Limit Exceeded
input:
)()((()())(())())(()())))(((()())()()(((((()(()()(()(())(()())((()(((()()))()))))()(((())(((((()()()...
output:
31960 160936 216670 370288 74484 13858 34852 113570 55236 83236 72004 536856 82508 182488 90826 4780...
result:
Test #10:
score: 0
Time Limit Exceeded
input:
())()()(()())))())())))))))(()((()()(((()))(()(())))(())))())(()((()))()))(()))()((((((())(())(())((...
output:
325656 284008 281034 118204 329266 522422 42614 18556 73334 205328 236954 202258 465640 2154 96962 1...