Submission #63790806
Source Code Expand
Copy
#include<bits/stdc++.h>using namespace std;#define int long long#define debug() cout<<"come on"<<'\n'#define mkp make_pair#define pb push_back#define ft first#define sd secondtypedef pair<int,int> pii;typedef pair<int,pii> piii;string s;int gg,ans;signed main(){cin>>s;s='%'+s;for(int i=1;i<s.length();i++){if(i%2==1&&s[i]=='o')s=s.substr(0,i)+'i'+s.substr(i,s.length()-i),ans++;if(i%2==0&&s[i]=='i')s=s.substr(0,i)+'o'+s.substr(i,s.length()-i),ans++;// cout<<i<<" "<<s<<'\n';}if(s.length()%2==0)s+='o',ans++;
#include<bits/stdc++.h> using namespace std; #define int long long #define debug() cout<<"come on"<<'\n' #define mkp make_pair #define pb push_back #define ft first #define sd second typedef pair<int,int> pii; typedef pair<int,pii> piii; string s; int gg,ans; signed main(){ cin>>s; s='%'+s; for(int i=1;i<s.length();i++){ if(i%2==1&&s[i]=='o')s=s.substr(0,i)+'i'+s.substr(i,s.length()-i),ans++; if(i%2==0&&s[i]=='i')s=s.substr(0,i)+'o'+s.substr(i,s.length()-i),ans++; // cout<<i<<" "<<s<<'\n'; } if(s.length()%2==0)s+='o',ans++; cout<<ans; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Ticket Gate Log |
User | dulf2024 |
Language | C++ 20 (gcc 12.2) |
Score | 250 |
Code Size | 589 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3676 KB |
Compile Error
Main.cpp: In function ‘int main()’: Main.cpp:16: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] 16 | for(int i=1;i<s.length();i++){ | ~^~~~~~~~~~~
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 250 / 250 | ||||
Status |
|
|
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 | 3536 KB |
00_sample_02.txt | AC | 1 ms | 3544 KB |
00_sample_03.txt | AC | 1 ms | 3608 KB |
01_random_01.txt | AC | 1 ms | 3480 KB |
01_random_02.txt | AC | 1 ms | 3480 KB |
01_random_03.txt | AC | 1 ms | 3568 KB |
01_random_04.txt | AC | 1 ms | 3676 KB |
01_random_05.txt | AC | 1 ms | 3496 KB |
01_random_06.txt | AC | 1 ms | 3540 KB |
01_random_07.txt | AC | 1 ms | 3480 KB |
01_random_08.txt | AC | 1 ms | 3488 KB |
01_random_09.txt | AC | 1 ms | 3496 KB |
01_random_10.txt | AC | 1 ms | 3452 KB |
02_handmade_01.txt | AC | 1 ms | 3552 KB |
02_handmade_02.txt | AC | 1 ms | 3552 KB |
02_handmade_03.txt | AC | 1 ms | 3492 KB |
02_handmade_04.txt | AC | 1 ms | 3540 KB |