Submission #63781064


Source Code Expand

Copy
#include<bits/stdc++.h>
#define int long long
using namespace std;
string s;
int k;
signed main(){
cin>>s;
for(int i=0;i<s.size()-1;i++){
if(s[i]==s[i+1]) k++;
}
if(s[0]!='i') k++;
if((k+s.size())&1) k++;
cout<<k;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include<bits/stdc++.h>
#define int long long
using namespace std;
string s;
int k;
signed main(){
	cin>>s;
	for(int i=0;i<s.size()-1;i++){
		if(s[i]==s[i+1]) k++;
	}
	if(s[0]!='i') k++;
	if((k+s.size())&1) k++;
	cout<<k;
}

Submission Info

Submission Time
Task B - Ticket Gate Log
User Fengjunning
Language C++ 17 (gcc 12.2)
Score 250
Code Size 236 Byte
Status AC
Exec Time 1 ms
Memory 3608 KB

Compile Error

Main.cpp: In function ‘int main()’:
Main.cpp:8:22: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
    8 |         for(int i=0;i<s.size()-1;i++){
      |                     ~^~~~~~~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 250 / 250
Status
AC × 3
AC × 17
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 1 ms 3528 KB
00_sample_02.txt AC 1 ms 3464 KB
00_sample_03.txt AC 1 ms 3528 KB
01_random_01.txt AC 1 ms 3508 KB
01_random_02.txt AC 1 ms 3472 KB
01_random_03.txt AC 1 ms 3544 KB
01_random_04.txt AC 1 ms 3484 KB
01_random_05.txt AC 1 ms 3540 KB
01_random_06.txt AC 1 ms 3412 KB
01_random_07.txt AC 1 ms 3444 KB
01_random_08.txt AC 1 ms 3476 KB
01_random_09.txt AC 1 ms 3432 KB
01_random_10.txt AC 1 ms 3448 KB
02_handmade_01.txt AC 1 ms 3608 KB
02_handmade_02.txt AC 1 ms 3468 KB
02_handmade_03.txt AC 1 ms 3448 KB
02_handmade_04.txt AC 1 ms 3464 KB


2025-04-05 (Sat)
17:23:40 +00:00