結果
| 問題 |
No.987 N×Mマス計算(基本)
|
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-19 14:36:46 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 558 bytes |
| コンパイル時間 | 378 ms |
| コンパイル使用メモリ | 25,984 KB |
| 実行使用メモリ | 7,328 KB |
| 最終ジャッジ日時 | 2025-03-19 14:36:48 |
| 合計ジャッジ時間 | 1,816 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 WA * 5 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:20:34: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
20 | printf("%d",horizontal[j] + vertical[i]);
| ~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| int long long int
| %lld
main.c:22:42: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
22 | printf("%d",horizontal[j] * vertical[i]);
| ~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| int long long int
| %lld
main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%d %d\n",&n,&m);
| ^~~~~~~~~~~~~~~~~~~~~~
main.c:9:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%c",&symbol);
| ^~~~~~~~~~~~~~~~~~~
main.c:11:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%lld",&horizontal[i]);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:14:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
14 | scanf("%lld",&vertical[i]);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
void main(void) {
int n,m;
scanf("%d %d\n",&n,&m);
long long int horizontal[m];
long long int vertical[n];
char symbol = 'a';
scanf("%c",&symbol);
for(int i = 0; i < m ; i++){
scanf("%lld",&horizontal[i]);
}
for(int i = 0; i < n ; i++){
scanf("%lld",&vertical[i]);
}
for(int i = 0 ; i < n ; i ++){
for(int j = 0 ; j < m ; j++){
if(symbol == '+'){
printf("%d",horizontal[j] + vertical[i]);
}else{
printf("%d",horizontal[j] * vertical[i]);
}
if(j != m-1){
printf(" ");
}
}
printf("\n");
}
}
Maeda