Submission #56002552


Source Code Expand

Copy
// !JOY
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#define ll long long
#define ld long double
#define pb(a) push_back(a)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define coutyes cout<<"YES\n"
#define coutno cout<<"NO\n"
#define endl "\n"
#define hell 1000000007
using namespace std;
int M = 1000000;
int sieve[1000001];
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// !JOY
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
        
#define ll long long
#define ld long double
#define pb(a) push_back(a)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define coutyes cout<<"YES\n"
#define coutno cout<<"NO\n"
#define endl "\n"
#define hell 1000000007

using namespace std;

int M = 1000000;
int sieve[1000001];
 
 
void createSieve() {
    for (int i = 2; i <= M; i++) {
        sieve[i] = 1;
    }
    for (int i = 2; i * i <= M; i++) {
        if (sieve[i] == 1) {
            if (i == 2) {
                for (int j = i * i; j <= M; j += i) {
                    sieve[j] = 2;
                }
            }
            else {
                for (int j = i * i; j <= M; j += 2 * i) {
                    if (sieve[j] == 1) {
                        sieve[j] = i;
                    }
                }
            }
        }
    }
}

bool isPrime(ll n)
{
    if (n <= 1)
        return false;
    for (ll i = 2; i * i <= n; i++) 
    {
        if (n % i == 0)
            return false;
    }
    return true;
}

ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}

vector<ll> factors(ll n) {
    vector<ll> f;
    for (ll x = 2; x*x <= n; x++) {
        while (n%x == 0) {
            f.push_back(x);
            n /= x;
        }
    }
    if (n > 1) f.push_back(n);
    return f;
}

ll powe(ll a, ll n) {

    ll r = 1;
    while (n) {
        if (n % 2) {
            r = ((r % hell) * (a % hell)) % hell;
            n--;
        }
        else {
            a = ((a % hell) * (a % hell)) % hell;
            n = n / 2;
        }
    }
    return r;
}

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

ll dfs(ll i, ll j, vector<vector<ll>> &vi, ll n, ll m, vector<vector<ll>> & v) {
    ll ans = 0;
    if (!vi[i][j]) {
        vi[i][j] = 1;
        ans = v[i][j];
        for (int k = 0; k < 4; k++) {
            if (i + dx[k] >= 0 && i + dx[k] < n && j + dy[k] >= 0 && j + dy[k] < m && v[i + dx[k]][j + dy[k]] != 0 && vi[i + dx[k]][j + dy[k]] == 0) {
                ans += dfs(i + dx[k], j + dy[k], vi, n, m, v);
            }
        }
    }
    return ans;
}

const int N = 1e5+10;
vector<int>g[N];
bool vis[N];

void _dfs(int vertex){
    if(!vis[vertex]){
        vis[vertex]=true;
        for (int child: g[vertex])
        {
            if(!vis[child]) _dfs(child);
        }
    }
}

void solve()
{
    ll n;
    cin>>n;
    vector<string>v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    for(int i=1;i<n;i++){
        if(v[i]==v[i-1] && v[i]=="sweet"&& i!=n-1){
            cout<<"No\n";
            return;
        }
    }
    cout<<"Yes\n";
    return;
}

int main()
{
    fast_io;
    ll t;
    t=1;
    // cin>>t;
    while(t--)
        solve();
    return 0;
}

Submission Info

Submission Time
Task A - Glutton Takahashi
User Parzival01
Language C++ 20 (gcc 12.2)
Score 100
Code Size 3043 Byte
Status AC
Exec Time 2 ms
Memory 3524 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 19
Set Name Test Cases
Sample sample00.txt, sample01.txt, sample02.txt
All sample00.txt, sample01.txt, sample02.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt, testcase13.txt, testcase14.txt, testcase15.txt
Case Name Status Exec Time Memory
sample00.txt AC 1 ms 3396 KB
sample01.txt AC 1 ms 3460 KB
sample02.txt AC 1 ms 3404 KB
testcase00.txt AC 1 ms 3436 KB
testcase01.txt AC 1 ms 3520 KB
testcase02.txt AC 1 ms 3396 KB
testcase03.txt AC 1 ms 3524 KB
testcase04.txt AC 1 ms 3452 KB
testcase05.txt AC 1 ms 3464 KB
testcase06.txt AC 1 ms 3492 KB
testcase07.txt AC 1 ms 3468 KB
testcase08.txt AC 1 ms 3388 KB
testcase09.txt AC 1 ms 3428 KB
testcase10.txt AC 1 ms 3448 KB
testcase11.txt AC 1 ms 3480 KB
testcase12.txt AC 2 ms 3392 KB
testcase13.txt AC 1 ms 3496 KB
testcase14.txt AC 1 ms 3364 KB
testcase15.txt AC 1 ms 3448 KB


2025-03-30 (Sun)
18:07:35 +00:00