Submission #821357

# Submission time Handle Problem Language Result Execution time Memory
821357 2023-08-11T09:30:33 Z kebine Ekoeko (COCI21_ekoeko) C++17
10 / 110
4 ms 848 KB
#include <bits/stdc++.h>
#define ll long long
#define longlonginf LONG_LONG_MAX
using namespace std;

ll n,m,x;
ll l,r;
string s;

bool subtask1(){
  for(int i = 0 ; i < n ; i++) if( s[i] != 'a' ) return 0;
  for(int i = n ; i < 2*n ; i++) if( s[i] != 'b' ) return 0;
  return 1;
}

void solve(){
  cin>>n;
  cin>>s;
  if( subtask1() ){
    n /= 2;
    cout<<n*n<<"\n";
    return;
  }
}

int main(){
  int T = 1;
  //cin>>T;
  for(int i = 1 ; i <= T ; i++){
    solve();
  }
  return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 2 ms 468 KB Output is correct
3 Correct 4 ms 724 KB Output is correct
4 Correct 3 ms 848 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 2 ms 468 KB Output is correct
3 Correct 4 ms 724 KB Output is correct
4 Correct 3 ms 848 KB Output is correct
5 Incorrect 1 ms 212 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 2 ms 468 KB Output is correct
3 Correct 4 ms 724 KB Output is correct
4 Correct 3 ms 848 KB Output is correct
5 Incorrect 1 ms 212 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 2 ms 468 KB Output is correct
3 Correct 4 ms 724 KB Output is correct
4 Correct 3 ms 848 KB Output is correct
5 Incorrect 1 ms 212 KB Output isn't correct
6 Halted 0 ms 0 KB -