提出 #74094160


ソースコード 拡げる

#include<stdio.h>
int main(){
    int H;
    int W;
    int Q;
    int n1;
    int n2;
    scanf("%d" , &H);
    scanf("%d" , &W);
    scanf("%d" , &Q);
    for (int i=0 ; i<Q ; i++){
        scanf("%d" , &n1);
        scanf("%d" , &n2);
        if (n1==1){
            printf("%d\n" , n2*W);
            H = H - n2;
        }else {
            printf("%d\n" , n2*H);
            W = W - n2;
        }
    }
}

提出情報

提出日時
問題 B - Deconstruct Chocolate
ユーザ Priyadarshi100
言語 C23 (GCC 14.2.0)
得点 200
コード長 430 Byte
結果 AC
実行時間 1 ms
メモリ 1716 KiB

コンパイルエラー

Main.c: In function ‘main’:
Main.c:8:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |     scanf("%d" , &H);
      |     ^~~~~~~~~~~~~~~~
Main.c:9:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |     scanf("%d" , &W);
      |     ^~~~~~~~~~~~~~~~
Main.c:10:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |     scanf("%d" , &Q);
      |     ^~~~~~~~~~~~~~~~
Main.c:12:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |         scanf("%d" , &n1);
      |         ^~~~~~~~~~~~~~~~~
Main.c:13:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   13 |         scanf("%d" , &n2);
      |         ^~~~~~~~~~~~~~~~~

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 1
AC × 21
セット名 テストケース
Sample sample00.txt
All sample00.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt, testcase13.txt, testcase14.txt, testcase15.txt, testcase16.txt, testcase17.txt, testcase18.txt, testcase19.txt
ケース名 結果 実行時間 メモリ
sample00.txt AC 1 ms 1600 KiB
testcase00.txt AC 0 ms 1544 KiB
testcase01.txt AC 0 ms 1624 KiB
testcase02.txt AC 0 ms 1676 KiB
testcase03.txt AC 0 ms 1592 KiB
testcase04.txt AC 0 ms 1520 KiB
testcase05.txt AC 0 ms 1676 KiB
testcase06.txt AC 0 ms 1716 KiB
testcase07.txt AC 0 ms 1520 KiB
testcase08.txt AC 0 ms 1668 KiB
testcase09.txt AC 0 ms 1520 KiB
testcase10.txt AC 0 ms 1620 KiB
testcase11.txt AC 0 ms 1680 KiB
testcase12.txt AC 0 ms 1600 KiB
testcase13.txt AC 0 ms 1600 KiB
testcase14.txt AC 0 ms 1624 KiB
testcase15.txt AC 0 ms 1716 KiB
testcase16.txt AC 0 ms 1668 KiB
testcase17.txt AC 0 ms 1624 KiB
testcase18.txt AC 0 ms 1668 KiB
testcase19.txt AC 0 ms 1624 KiB