跳到正文

闲话

CF2053_A

pika_约 1 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2025年12月12日
篇幅
约 1 分钟

版本

  1. v1当前

昨晚的CF_A: 赛时:

C++
#include<bits/stdc++.h>
using namespace std;

const int MAXN = 2e2+10;

int T;
int n;
int a[MAXN];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    cin>>T;
    while(T--)
    {
        cin>>n;
        for(int i=1;i<=n;i++) cin>>a[i];
        bool f = false;
        for(int i=1;i<=n;i++) if(min(a[i],a[i+1])*2 > max(a[i],a[i+1])){f = true; break;}
        puts(f ? "YES" : "NO");
    }
    return 0;
}

第20行的for条件应改为i<n而不是i<=n…… 最后: AC →\to WA /dk

原文