QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#111008#6559. A Tree and Two EdgesOOBMABTRAMS#WA 0ms3436kbC++17708b2023-06-05 13:39:052023-06-05 13:39:09

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-05 13:39:09]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3436kb
  • [2023-06-05 13:39:05]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int N=1013,mod=998244353;
typedef long long ll;
typedef long double ld;
int input=0;
const ll inf=2e18;
//i day j site
string s[N];
int k[N],b[N],d[N];
void solve(){
    int dep=0,n;cin>>n;
    for(int i=1;i<=n;i++){
        cin>>s[i];
        d[i]=dep;
        if(s[i].back()=='{')dep++;else dep--,d[i]--;
        for(auto c:s[i])if(c=='s')b[i]++;else if(c=='t')k[i]++;
    }
    for(int i=1;i<=n;i++)cout<<d[i]<<":"<<k[i]<<' '<<b[i]<<'\n';
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    cout<<fixed<<setprecision(10);
    int T;
    if(input)cin>>T;else T=1;
    for(int tc=1;tc<=T;tc++)solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

4 6
1 2
1 3
1 4
2 3
2 4
1 2
1 3
1 4
2 3
2 4
3 4

output:

-1:0 0
-2:0 0
-3:0 0
-4:0 0

result:

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