제출 #1364245

#제출 시각아이디문제언어결과실행 시간메모리
1364245jojeonghoonSecond Run (KAISTRUN26SPRING_A)C++20
100 / 100
22 ms2000 KiB
#include <bits/stdc++.h>
#define ll long long
#define int ll
#define vi vecotr<int>
#define rep(i,s,e) for(int i=(s); i<=(e); i++)
using namespace std;

const int LM=100100;
int N,M;
int ch[LM], ans[LM];

signed main() {
    ios_base::sync_with_stdio(0);cin.tie(0);
    cin>>N>>M;
    rep(i,1,M){
        int x,y,z,w,k;cin>>x>>y>>z>>w>>k;
        if(ch[x]&ch[y]&ch[z]&ch[w]) continue;
        for(int i:{x,y,z,w}){
            if(!ch[i]){
                ch[i]=1; ans[i]= (64 + k - (ans[x]+ans[y]+ans[z]+ans[w]) )%4;
            }
        }
    }
    rep(i,1,N) cout<<ans[i]<<" ";
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…