Submission #865481

#TimeUsernameProblemLanguageResultExecution timeMemory
865481mychecksedadHomework (CEOI22_homework)C++17
0 / 100
27 ms14068 KiB
/* Author : Mychecksdead */ #include<bits/stdc++.h> using namespace std; #define ll long long int #define MOD (1000000000+7) #define MOD1 (998244353) #define pb push_back #define all(x) x.begin(), x.end() #define en cout << '\n' const int N = 1e6+100, M = 1e5+10, K = 52, MX = 30; string s; void solve(){ cin >> s; int n = 0, mx = 0, mn = 0; for(int i = 0; i < s.length(); ++i){ if(s[i] == '(' || s[i] == ')' || s[i] == ',') continue; if(s[i] == '?') n++; else if(s[i] == 'm' && s[i + 1] == 'a') mx++; else if(s[i] == 'm' && s[i + 1] == 'i') mn++; } cout << n- max(mx, mn); } int main(){ cin.tie(0); ios::sync_with_stdio(0); int tt = 1, aa; // freopen("in.txt", "r", stdin); // freopen("out.txt", "w", stdout); // cin >> tt; while(tt--){ solve(); // en; } cerr<<"time taken : "<<(float)clock()/CLOCKS_PER_SEC<<" seconds\n"; return 0; }

Compilation message (stderr)

Main.cpp: In function 'void solve()':
Main.cpp:16:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |   for(int i = 0; i < s.length(); ++i){
      |                  ~~^~~~~~~~~~~~
Main.cpp: In function 'int main()':
Main.cpp:29:15: warning: unused variable 'aa' [-Wunused-variable]
   29 |   int tt = 1, aa;
      |               ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...