結果
問題 |
No.586 ダブルブッキング
|
ユーザー |
![]() |
提出日時 | 2018-08-10 20:59:16 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 280 bytes |
コンパイル時間 | 123 ms |
コンパイル使用メモリ | 22,912 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-23 05:54:51 |
合計ジャッジ時間 | 1,961 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 3 |
other | RE * 5 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:9:17: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘int’ [-Wformat=] 9 | scanf("%d",R); | ~^ ~ | | | | | int | int* main.cpp:6:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d%d",&P1,&P2); | ~~~~~^~~~~~~~~~~~~~~~ main.cpp:7:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d",&N); | ~~~~~^~~~~~~~~ main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%d",R); | ~~~~~^~~~~~~~ main.cpp:9:14: warning: ‘R’ may be used uninitialized [-Wmaybe-uninitialized] 9 | scanf("%d",R); | ~~~~~^~~~~~~~
ソースコード
#include <stdio.h> int main(){ int P1,P2,N,R,M=0,c=0,i; scanf("%d%d",&P1,&P2); scanf("%d",&N); for(i = 0; i < N; i++){ scanf("%d",R); if(R == M){ c++; }else{ M = R; } } printf("%d",c*(P1+P2)); }