# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
969899 | marinaluca | Laugh Analysis (IOI16_laugh) | C++14 | 2 ms | 856 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "laugh.h"
#include <bits/stdc++.h>
#pragma GCC optimize ("O4")
#pragma GCC optimize ("fast-math")
#pragma GCC optimize ("unroll-loops")
using namespace std;
//#define int long long
#define ll long long
#define xx first
#define yy second
#define all (x) begin (x), end (x)
/**
#define cin fin
#define cout fout
ifstream cin ("paresort.in");
ofstream cout ("paresort.out");
**/
int longest_laugh (string s){
int cnt = 0, maxi = 0;
for (int i = 0; i < s.size(); ++ i){
if (s[i] == 'a' || s[i] == 'h'){
cnt ++;
if (i && s[i] == s[i - 1])
cnt = 1;
maxi = max (maxi, cnt);
}
else
cnt = 0;
}
return maxi;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |