結果

問題 No.1656 Recuperation
ユーザー harurunharurun
提出日時 2021-08-02 19:17:59
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 332 bytes
コンパイル時間 1,090 ms
コンパイル使用メモリ 28,160 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-01 01:07:42
合計ジャッジ時間 1,096 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
6,812 KB
testcase_01 AC 101 ms
6,940 KB
testcase_02 AC 101 ms
6,944 KB
testcase_03 AC 101 ms
6,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'main':
main.c:20:3: warning: implicit declaration of function 'usleep'; did you mean 'sleep'? [-Wimplicit-function-declaration]
   20 |   usleep(100*1000);
      |   ^~~~~~
      |   sleep

ソースコード

diff #

#include <stdio.h>
#include <unistd.h>
int t;
long long a,b,ans,now;
int main(){
  scanf("%d",&t);
  for(int i=0;i<t;i++){
    scanf("%lld%lld",&a,&b);
    ans=0;
    now=0;
    for(long long j=0;j<b;j++){
      now+=a;
      ans++;
    }
    for(;now>0;now--){
      ans++;
    }
    printf("%lld\n",ans);
  }
  usleep(100*1000);
}
0