結果

問題 No.46 はじめのn歩
ユーザー YoshiRyu
提出日時 2017-05-17 09:50:30
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 340 ms / 5,000 ms
コード長 602 bytes
コンパイル時間 1,267 ms
コンパイル使用メモリ 158,368 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-17 12:26:50
合計ジャッジ時間 1,896 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
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