Submission #63767828


Source Code Expand

//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int,int>
#define f first
#define s second
#define all(x) x.begin(),x.end()
#define _ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};

void setIO(string s) {
    freopen((s + ".in").c_str(), "r", stdin);
    freopen((s + ".out").c_str(), "w", stdout);
}

int main() {_
    string S;
    cin>>S;
    int ans=0;
    for(int i=1;i<(int)S.length();i++){
        if(S[i]==S[i-1]) ans++;
    }
    if(S[0]=='o') ans++;
    if(S.back()=='i') ans++;
    cout<<ans<<'\n';
    return 0;
}
//maybe its multiset not set
//yeeorz
//diaoborz

Submission Info

Submission Time
Task B - Ticket Gate Log
User guagua0407
Language C++ 20 (gcc 12.2)
Score 250
Code Size 720 Byte
Status AC
Exec Time 1 ms
Memory 3600 KiB

Compile Error

Main.cpp: In function ‘void setIO(std::string)’:
Main.cpp:15:12: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   15 |     freopen((s + ".in").c_str(), "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:16:12: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   16 |     freopen((s + ".out").c_str(), "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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 3396 KiB
00_sample_02.txt AC 1 ms 3376 KiB
00_sample_03.txt AC 1 ms 3476 KiB
01_random_01.txt AC 1 ms 3476 KiB
01_random_02.txt AC 1 ms 3460 KiB
01_random_03.txt AC 1 ms 3388 KiB
01_random_04.txt AC 1 ms 3480 KiB
01_random_05.txt AC 1 ms 3416 KiB
01_random_06.txt AC 1 ms 3404 KiB
01_random_07.txt AC 1 ms 3412 KiB
01_random_08.txt AC 1 ms 3600 KiB
01_random_09.txt AC 1 ms 3452 KiB
01_random_10.txt AC 1 ms 3380 KiB
02_handmade_01.txt AC 1 ms 3408 KiB
02_handmade_02.txt AC 1 ms 3524 KiB
02_handmade_03.txt AC 1 ms 3412 KiB
02_handmade_04.txt AC 1 ms 3460 KiB