結果
| 問題 |
No.904 サメトロ
|
| コンテスト | |
| ユーザー |
function6161
|
| 提出日時 | 2019-10-16 17:44:14 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 239 bytes |
| コンパイル時間 | 712 ms |
| コンパイル使用メモリ | 54,820 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-22 12:08:06 |
| 合計ジャッジ時間 | 2,031 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 1 WA * 32 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:4:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
4 | scanf("%d",&a);
| ~~~~~^~~~~~~~~
main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d %d",&b[i],&*(c+i));
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <iostream>
int main(){
int a,x=0,y=0;
scanf("%d",&a);
int b[a-1],c[a-1];
for(int i=0;i<a-1;i++){
scanf("%d %d",&b[i],&*(c+i));
x+= *(b+i);
y+= *(c+i);
}
std::cout << std::min(x,y);
}
function6161