teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

5

2020/04/29 13:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -1,6 +1,7 @@
1
1
  https://[``` atcoder.jp/contests/abc139/tasks/abc139_b ```
2
2
  コード
3
+ ```
3
- ```a,b=map(int,input().split())
4
+ a,b=map(int,input().split())
4
5
  c=(b-1)/(a-1)
5
6
  if c-int(c)==0:
6
7
  print(c)

4

2020/04/29 13:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -1,4 +1,4 @@
1
- https://[``` ```atcoder.jp/contests/abc139/tasks/abc139_b
1
+ https://[``` atcoder.jp/contests/abc139/tasks/abc139_b ```
2
2
  コード
3
3
  ```a,b=map(int,input().split())
4
4
  c=(b-1)/(a-1)

3

2020/04/29 13:47

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -1,4 +1,4 @@
1
- https://[``` ```____ atcoder.jp/contests/abc139/tasks/abc139_b
1
+ https://[``` ```atcoder.jp/contests/abc139/tasks/abc139_b
2
2
  コード
3
3
  ```a,b=map(int,input().split())
4
4
  c=(b-1)/(a-1)
@@ -6,16 +6,8 @@
6
6
  print(c)
7
7
 
8
8
  else:
9
- print(int(c+1))
9
+ print(int(c)+1)
10
10
  ```]
11
11
  Atcoder の上の問題で以下のコードを提出したところwaになってしまいます。
12
12
  自分で見直す限りではwaの原因がわからないので、なぜそうなるのかお教え頂きたいです。足りない穴の数はb-1個、1個のaにつき増えるのはa-1口
13
- したがって必要なのはb-1/a-1 or b-1/a-1 +1という思考をしました
13
+ したがって必要なのはb-1/a-1 or b-1/a-1 +1という思考をしました
14
-
15
- a,b=map(int,input().split())
16
- c=(b-1)/(a-1)
17
- if c-int(c)==0:
18
- print(c)
19
-
20
- else:
21
- print(int(c)+1)

2

2020/04/29 13:46

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -1,4 +1,4 @@
1
- https://[``` ```python
1
+ https://[``` ```____ atcoder.jp/contests/abc139/tasks/abc139_b
2
2
  コード
3
3
  ```a,b=map(int,input().split())
4
4
  c=(b-1)/(a-1)
@@ -6,9 +6,8 @@
6
6
  print(c)
7
7
 
8
8
  else:
9
- print(int(c)+
9
+ print(int(c+1))
10
- atcoder.jp/contests/abc139/tasks/abc139_b
11
- ```](http://atcoder.jp/contests/abc139/tasks/abc139_b)
10
+ ```]
12
11
  Atcoder の上の問題で以下のコードを提出したところwaになってしまいます。
13
12
  自分で見直す限りではwaの原因がわからないので、なぜそうなるのかお教え頂きたいです。足りない穴の数はb-1個、1個のaにつき増えるのはa-1口
14
13
  したがって必要なのはb-1/a-1 or b-1/a-1 +1という思考をしました

1

2020/04/29 13:45

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -1,4 +1,14 @@
1
+ https://[``` ```python
2
+ コード
3
+ ```a,b=map(int,input().split())
4
+ c=(b-1)/(a-1)
5
+ if c-int(c)==0:
6
+ print(c)
7
+
8
+ else:
9
+ print(int(c)+
10
+ atcoder.jp/contests/abc139/tasks/abc139_b
1
- https://atcoder.jp/contests/abc139/tasks/abc139_b
11
+ ```](http://atcoder.jp/contests/abc139/tasks/abc139_b)
2
12
  Atcoder の上の問題で以下のコードを提出したところwaになってしまいます。
3
13
  自分で見直す限りではwaの原因がわからないので、なぜそうなるのかお教え頂きたいです。足りない穴の数はb-1個、1個のaにつき増えるのはa-1口
4
14
  したがって必要なのはb-1/a-1 or b-1/a-1 +1という思考をしました