結果

問題 No.2343 (l+r)/2
ユーザー chro_96
提出日時 2023-06-09 23:17:47
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 580 bytes
コンパイル時間 392 ms
コンパイル使用メモリ 25,984 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2025-01-02 05:24:32
合計ジャッジ時間 1,086 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 7 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main () {
  int t = 0;
  int n = 0;
  int a[200000] = {};
  
  int res = 0;
  
  res = scanf("%d", &t);
  while (t > 0) {
    res = scanf("%d", &n);
    for (int i = 0; i < n; i++) {
      res = scanf("%d", a+i);
    }
    if (a[0] != a[n-1]) {
      printf("Yes\n");
    } else {
      int is_ok = 0;
      for (int i = 1; i < n-2; i++) {
        if (a[i] == a[i+1] && a[i] != a[0]) {
          is_ok = 1;
        }
      }
      if (is_ok > 0) {
        printf("Yes\n");
      } else {
        printf("No\n");
      }
    }
    t--;
  }
  
  return 0;
}
0