結果

問題 No.2721 "Don't say N" Game
ユーザー 👑 chro_96chro_96
提出日時 2024-04-12 22:12:28
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 365 bytes
コンパイル時間 1,514 ms
コンパイル使用メモリ 29,056 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-12 22:12:30
合計ジャッジ時間 977 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main () {
  int t = 0;
  int n = 0;
  
  int res = 0;
  
  res = scanf("%d", &t);
  while (t > 0) {
    int cnt = 0;
    res = scanf("%d", &n);
    for (int p = 1; p*p <= n; p++) {
      if (p*p == n) {
        cnt++;
      }
    }
    if (cnt > 0) {
      printf("K\n");
    } else {
      printf("P\n");
    }
    t--;
  }
  
  return 0;
}
0