# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
776598 | 2023-07-08T05:34:31 Z | vjudge1 | Magnus (COCI18_magnus) | C++17 | 2 ms | 3748 KB |
#include <bits/stdc++.h> using namespace std; const int N = 1e5+37; vector<int> s(N), v(N); vector<array<int, 2>> adj[N]; void f(){ freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout); } void dfs(int t, int skip, int b){ v[t] = b; for(auto i: adj[t]){ if(v[i[0]]!=b&&i[1]!=skip){ dfs(i[0], skip, b); } } } signed main(){ ios_base::sync_with_stdio(false); cin.tie(0); //f(); string s; cin >> s; string b = "HONI"; int l=0, ans=0; for(int i=0; i<s.size(); i++){ if(s[i]==b[l]){ l++; } if(l==4){ ans++; l=0; } } cout<<ans<<"\n"; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 3412 KB | Output is correct |
2 | Correct | 1 ms | 3412 KB | Output is correct |
3 | Correct | 2 ms | 3412 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 3412 KB | Output is correct |
2 | Correct | 2 ms | 3476 KB | Output is correct |
3 | Correct | 1 ms | 3412 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 3412 KB | Output is correct |
2 | Correct | 2 ms | 3412 KB | Output is correct |
3 | Correct | 2 ms | 3412 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 3412 KB | Output is correct |
2 | Correct | 2 ms | 3412 KB | Output is correct |
3 | Correct | 2 ms | 3412 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 3412 KB | Output is correct |
2 | Correct | 1 ms | 3412 KB | Output is correct |
3 | Correct | 2 ms | 3412 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 3668 KB | Output is correct |
2 | Correct | 2 ms | 3668 KB | Output is correct |
3 | Correct | 2 ms | 3704 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 3668 KB | Output is correct |
2 | Correct | 2 ms | 3668 KB | Output is correct |
3 | Correct | 2 ms | 3740 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 3748 KB | Output is correct |
2 | Correct | 2 ms | 3708 KB | Output is correct |
3 | Correct | 2 ms | 3668 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 3748 KB | Output is correct |
2 | Correct | 2 ms | 3668 KB | Output is correct |
3 | Correct | 2 ms | 3744 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 3668 KB | Output is correct |
2 | Correct | 2 ms | 3736 KB | Output is correct |
3 | Correct | 2 ms | 3672 KB | Output is correct |