Submission #40828913


Source Code Expand

Copy
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
using ll=long long;
signed main() {
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
int n;cin>>n;
string s;cin>>s;
int f=1;
for(int i=0;i<n;++i){
if(s[i]=='|')break;
if(s[i]=='*')f=0;
}
for(int i=n-1;i>=0;--i){
if(s[i]=='|')break;
if(s[i]=='*')f=0;
}
if(f)cout<<"in";
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
using ll=long long;

signed main() {
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    int n;cin>>n;
    string s;cin>>s;
    int f=1;
    for(int i=0;i<n;++i){
        if(s[i]=='|')break;
        if(s[i]=='*')f=0;
    }
    
    for(int i=n-1;i>=0;--i){
        if(s[i]=='|')break;
        if(s[i]=='*')f=0;
    }
    if(f)cout<<"in";
    else cout<<"out";
	return 0;
}
// init?
// var->0?
// infinite dfs?
// out of bound?
// max_element / min_element?

Submission Info

Submission Time
Task A - Treasure Chest
User wa_wa_vegetable
Language C++ (GCC 9.2.1)
Score 100
Code Size 572 Byte
Status AC
Exec Time 7 ms
Memory 3568 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 9
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_small03.txt, 01_small04.txt, 02_random_05.txt, 02_random_06.txt, 03_max_07.txt, 03_max_08.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 7 ms 3564 KB
00_sample_01.txt AC 2 ms 3560 KB
00_sample_02.txt AC 2 ms 3468 KB
01_small03.txt AC 2 ms 3400 KB
01_small04.txt AC 2 ms 3464 KB
02_random_05.txt AC 2 ms 3528 KB
02_random_06.txt AC 2 ms 3528 KB
03_max_07.txt AC 2 ms 3568 KB
03_max_08.txt AC 1 ms 3512 KB


2025-02-28 (Fri)
11:28:09 +00:00