結果
| 問題 |
No.228 ゆきこちゃんの 15 パズル
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-06-20 02:03:30 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 270 bytes |
| コンパイル時間 | 113 ms |
| コンパイル使用メモリ | 24,448 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-07 04:35:13 |
| 合計ジャッジ時間 | 674 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 WA * 1 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d",&k);
| ~~~~~^~~~~~~~~
ソースコード
#include <stdio.h>
#include <stdlib.h>
int A[15];
int main(){
int y=0,x=0,z,k,p=0;
for(;x<16;x++){
scanf("%d",&k);
if(k){
for(z=0;z<y;z++)p^=A[z]>k;
A[y++]=k--;
p|=(abs(x/4-k/4)+abs(x%4-k%4)>1)*2;
}else{
p^=abs(x/4-3)%2;
}
}
puts(p?"No":"Yes");
}