結果

問題 No.2655 Increasing Strides
コンテスト
ユーザー chro_96
提出日時 2024-03-01 23:05:32
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 468 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 172 ms
コンパイル使用メモリ 39,136 KB
最終ジャッジ日時 2026-02-22 11:35:10
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>

int main () {
  long long n = 0LL;
  
  int res = 0;
  
  int is_ng = 0;
  long long v = 0LL;
  long long h = 0LL;
  
  res = scanf("%lld", &n);
  
  v = n/2LL;
  h = (n+1LL)/2LL;
  
  if ((((v*(v+1LL))/2LL)%4LL != 0LL && ((v*(v+1LL))/2LL)%4LL != 2LL) || v == 1LL || v == 2LL) {
    is_ng = 1;
  }
  
  if (h%2LL == 1LL || h == 2LL) {
    is_ng = 1;
  }
  
  if (is_ng > 0) {
    printf("No\n");
  } else {
    printf("Yes\n");
  }
  
  return 0;
}
0