Submission #54338181


Source Code Expand

Copy
#include<bits/stdc++.h>
using namespace std;
string s;
int ans,ls;
int main(){
cin>>s;
ls=s.length();
for(auto i:s)if(i>='a')ans++;
if(ans>ls/2){
for(auto i:s){
if(i<'a')cout<<char(32+i);
else cout<<i;
}
}
else{
for(auto i:s){
if(i>'Z')cout<<char(i-32);
else cout<<i;
}
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include<bits/stdc++.h>
using namespace std;
string s;
int ans,ls;
int main(){
	cin>>s;
	ls=s.length();
	for(auto i:s)if(i>='a')ans++;
	if(ans>ls/2){
		for(auto i:s){
			if(i<'a')cout<<char(32+i);
			else cout<<i;
		}
	}
	else{
		for(auto i:s){
			if(i>'Z')cout<<char(i-32);
			else cout<<i;
		}	
	}
}

Submission Info

Submission Time
Task B - Uppercase and Lowercase
User zhanghe
Language C++ 20 (gcc 12.2)
Score 200
Code Size 321 Byte
Status AC
Exec Time 2 ms
Memory 3572 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 13
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.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
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3368 KB
00_sample_01.txt AC 1 ms 3564 KB
00_sample_02.txt AC 1 ms 3500 KB
01_random_00.txt AC 1 ms 3492 KB
01_random_01.txt AC 1 ms 3456 KB
01_random_02.txt AC 1 ms 3468 KB
01_random_03.txt AC 1 ms 3496 KB
01_random_04.txt AC 1 ms 3460 KB
01_random_05.txt AC 2 ms 3368 KB
01_random_06.txt AC 1 ms 3500 KB
01_random_07.txt AC 1 ms 3444 KB
01_random_08.txt AC 1 ms 3572 KB
01_random_09.txt AC 1 ms 3496 KB


2025-04-03 (Thu)
20:48:14 +00:00