結果

問題 No.46 はじめのn歩
ユーザー YoshiRyuYoshiRyu
提出日時 2017-05-17 09:50:30
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 370 ms / 5,000 ms
コード長 602 bytes
コンパイル時間 1,354 ms
コンパイル使用メモリ 158,848 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 14:40:08
合計ジャッジ時間 2,385 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 370 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘void Slove()’:
main.cpp:7:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 | #define SF(f,v) scanf(f,v)
      |                 ~~~~~^~~~~
main.cpp:8:17: note: in expansion of macro ‘SF’
    8 | #define SF_N(v) SF("%d",&v)
      |                 ^~
main.cpp:25:9: note: in expansion of macro ‘SF_N’
   25 |         SF_N(a);
      |         ^~~~
main.cpp:7:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 | #define SF(f,v) scanf(f,v)
      |                 ~~~~~^~~~~
main.cpp:8:17: note: in expansion of macro ‘SF’
    8 | #define SF_N(v) SF("%d",&v)
      |                 ^~
main.cpp:26:9: note: in expansion of macro ‘SF_N’
   26 |         SF_N(b);
      |         ^~~~

ソースコード

diff #

#include "bits/stdc++.h"

// マクロ群
#define REP(i,n) for(int i=0;i<n;++i)
#define REP2(i,a,b) for (int i=(a);i<(b);++i)
#define rep(n) REP(i,n)
#define SF(f,v) scanf(f,v)
#define SF_N(v) SF("%d",&v)
#define SF_S(v) SF("%s",v)
#define PF(f,v) printf(f,v)
#define PFS_N(v) PF("%d ",v)
#define PFS_S(v) PF("%s ",v)
#define PFL_N(v) PF("%d\n",v)
#define PFL_S(v) PF("%s\n",v)

typedef long long ll;

using namespace std;

const ll MOD = 573;

void Slove()
{
    int a, b, ans = 0;
	SF_N(a);
	SF_N(b);
	
	while(b>0) 
	{
	    b -= a;
	    ++ans;
	}
	
	PFL_N( ans );
}

int main() { Slove(); return 0; }
0