2020-04-12から1日間の記事一覧

AtCoder ABC-162 C - Sum of gcd of Tuples (Easy) /

atcoder.jp 方針 3つの整数に対してユークリッドの互除法を使いました。 3重ループは時間がかかるので非推奨ですが... #include <stdio.h> #include <stdlib.h> #include <iostream> using namespace std; #define lli long ling int; int gcd(int a, int b) { int r; r = a % b; while(r!</iostream></stdlib.h></stdio.h>…

AtCoder ABC-162 B - FizzBuzz Sum

atcoder.jp 方針 FizzBuzz!! FizzとBuzz以外を足していきました。オーバーフロー対処にはlong long int使いました笑 #include <stdio.h> #include <stdlib.h> #include <iostream> using namespace std; #define lli long ling int; int main() { long long int N, sum = 0; scanf("%lld</iostream></stdlib.h></stdio.h>…

AtCoder ABC-162 A - Lucky 7

atcoder.jp 方針 商と余りに着目。余りが7だったらYes。 入力の仕様が3桁だったので同じ処理を2回書きました... #include <stdio.h> #include <stdlib.h> #include <iostream> using namespace std; #define lli long ling int; int main() { int N; scanf("%d", &N); int a, b; a = N / 1</iostream></stdlib.h></stdio.h>…