AtCoder Regular Contest 105 Note

Preface

I tried Atcoder, so it's a memo for myself. I plan to add and correct it later.

problem

https://atcoder.jp/contests/arc105

A

Q_A.go


package main

import (
    "fmt"
)

func main() {
    var a,b,c,d int
    fmt.Scanf("%d %d %d %d", &a, &b, &c, &d)

    flag := false 

    flag = (a == b+c+d || a+b == c+d || a+c == b+d || a+d == b+c || a+b+c == d || a+b+d == c || a+c+d == b )

    var s string
    if flag == true{
        s = "Yes"
    }else{
        s = "No"
    }
    fmt.Printf("%s\n", s)
}

B

Q_B.go


package main
 
import (
  "fmt"
)
 
func main() {
  var N, a int
  fmt.Scan(&N)
  
  ans := 0
  for i := 0; i < N; i++ {
    fmt.Scan(&a)
    ans = gcd(ans ,a)
  }
  fmt.Printf("%d\n", ans)
}
 
func gcd(a, b int) int {
  if b == 0 {
    return a
  }
  return gcd(b, a % b)
}

C If you remember, I will write it later.

D If you remember, I will write it later.

E If you remember, I will write it later.

F If you remember, I will write it later.

Recommended Posts

AtCoder Regular Contest 106 Note
AtCoder Regular Contest 105 Note
AtCoder Beginner Contest 181 Note
AtCoder Regular Contest 105 Review
AtCoder Beginner Contest 187 Note
AtCoder Beginner Contest 180 Note
AtCoder Beginner Contest 182 Note
AtCoder Beginner Contest 183 Note
AtCoder Regular Contest 106 Review
AtCoder Beginner Contest 184 Note
AtCoder Regular Contest 104 Review
AtCoder Beginner Contest 188 Note
AtCoder Beginner Contest # 003 Participation Note
AtCoder Regular Contest # 002 C Problem
AtCoder Regular Contest 105 Participation Report
AtCoder Regular Contest 104 Participation Report
AtCoder Beginner Contest 177
AtCoder Beginner Contest 179
AtCoder Beginner Contest 172
AtCoder Beginner Contest 180
AtCoder Beginner Contest 173
Atcoder Beginner Contest 153
AtCoder Beginner Contest 152 Review
AtCoder Grand Contest 041 Review
AtCoder Beginner Contest 160 Review
AtCoder Beginner Contest 178 Review
ACL Beginner Contest Note
AtCoder Beginner Contest 166 Review
AtCoder Beginner Contest 167 Review
AtCoder Beginner Contest 169 Review
AtCoder Grand Contest 048 Review
AtCoder Beginner Contest 181 Review
AtCoder Beginner Contest 171 Review
AtCoder Beginner Contest 182 Review
AtCoder Beginner Contest 180 Review
AtCoder Beginner Contest 156 WriteUp
AtCoder Beginner Contest 177 Review
AtCoder Beginner Contest 168 Review
AtCoder Grand Contest 045 Review
AtCoder Grand Contest 044 Review
AtCoder Beginner Contest 179 Review
Solve AtCoder Beginner Contest 100-102
AtCoder Beginner Contest 167 Memorandum
AtCoder Beginner Contest 172 Review
AtCoder Beginner Contest 176 Review
AtCoder Grand Contest 046 Review
AtCoder Beginner Contest 175 Review
AtCoder Beginner Contest 174 Review
AtCoder Beginner Contest 153 Review
AtCoder Beginner Contest 156 Review
AtCoder Beginner Contest 161 Review
AtCoder Beginner Contest 170 Review
AtCoder Beginner Contest 165 Review
AtCoder Beginner Contest 173 Review
AtCoder Beginner Contest 155 Review
AtCoder Beginner Contest 162 Review
AtCoder Beginner Contest 181 Participation Report
AtCoder Beginner Contest 175 Virtual entry
AtCoder Beginner Contest 161 Participation Report
AtCoder Beginner Contest 151 Participation Report
AtCoder Beginner Contest 176 Participation Report