結果
問題 | No.586 ダブルブッキング |
ユーザー | ECHO_1221 |
提出日時 | 2017-12-05 03:05:06 |
言語 | C++11 (gcc 11.4.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 369 bytes |
コンパイル時間 | 192 ms |
コンパイル使用メモリ | 23,936 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-05-06 04:27:14 |
合計ジャッジ時間 | 1,939 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | RE | - |
testcase_01 | RE | - |
testcase_02 | RE | - |
testcase_03 | RE | - |
testcase_04 | RE | - |
testcase_05 | RE | - |
testcase_06 | RE | - |
testcase_07 | RE | - |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:11:17: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘int’ [-Wformat=] 11 | scanf("%d\n", x); | ~^ ~ | | | | int* int main.cpp:12:17: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘int’ [-Wformat=] 12 | scanf("%d\n", y); | ~^ ~ | | | | int* int main.cpp:13:17: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘int’ [-Wformat=] 13 | scanf("%d\n", z); | ~^ ~ | | | | int* int main.cpp:18:25: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘int’ [-Wformat=] 18 | scanf("%d\n", p[i]); | ~^ ~~~~ | | | | int* int main.cpp:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | scanf("%d\n", x); | ~~~~~^~~~~~~~~~~ main.cpp:12:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 12 | scanf("%d\n", y); | ~~~~~^~~~~~~~~~~ main.cpp:13:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 13 | scanf("%d\n", z); | ~~~~~^~~~~~~~~~~ main.cpp:18:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 18 | scanf("%d\n", p[i]); | ~~~~~^~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <stdlib.h> int main() { int x,y,z; int *p; int i = 0; int sum = 0; scanf("%d\n", x); scanf("%d\n", y); scanf("%d\n", z); p = (int*)malloc(sizeof(int) * z); while(i < z){ scanf("%d\n", p[i]); i++; } i = 0; while(i < z){ if(p[i] == p[i + 1]){ sum += 1; } i++; } printf("%d\n", sum * (x + y)); return (0); }