0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

AtCoder424の感想と自分が解いたところまでの解説を書いていきます
(今回はAをpythonで書きます)
AtCoder Beginner Contest 424

1.感想

A問題:
とても簡単なはずだったが2回ミスをしてしまった

B問題:
簡単だった、ミスせずに解けた

C問題:
簡単そうに見えて難しかった
解けなかった

D問題:
ARC205に似ていたが解けなかった
(ARC205も解けていなかった)

2.結果

image.png

3.解説

A問題 Isosceles

C++での解法

#include <iostream>
using namespace std;

int main(){
    int A, B, C;
    cin >> A >> B >> C;
    if (A == B || B == C || C == A) cout << "Yes\n";
    else cout << "No\n";
    return 0;
}

pythonでの解法

a, b, c = map(int, input().split())
print("Yes" if a == b or b == c or c == a else "No")

B問題 Perfect

C++での解法

#include <bits/stdc++.h>
using namespace std;

bool not_in(vector<int> A, int N){
    for (int i : A) if (i == N) return false;
    return true;
}

int main(){
    int N, M, K, A, B;
    vector<int> ans;
    bool sub;
    cin >> N >> M >> K;
    vector<vector<bool>> P(N, vector<bool>(M, false));
    
    for (int _ = 0; _ < K; _++){
        cin >> A >> B;
        P[A-1][B-1] = true;
        
        for (int i = 0; i < N; i++){
            sub = true;
            for (int j = 0; j < M; j++) sub &= P[i][j];
            if (sub && not_in(ans, i+1)) ans.push_back(i+1);
        }
    }
    
    for (int i : ans) cout << i << " ";
    cout << endl;
    return 0;
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?