Submission #873808


Source Code Expand

Copy
#include <bits/stdc++.h>

using namespace std;


int main()
{
  int V, E;
  int A[10000], B[10000];

  cin >> V >> E;
  for(int i = 0; i < E; i++) {
    cin >> A[i] >> B[i];
    --A[i], --B[i];
  }

  for(int i = 0; i < 1 << (V * 2); i++) {
    bool ok = true;
    for(int j = 0; j < E; j++) {
      int color = (i >> (A[j] * 2)) & 3;
      int color2 = (i >> (B[j] * 2)) & 3;
      ok &= color != color2;
    }
    if(ok) {
      for(int j = 0; j < V; j++) {
        cout << (int)((i >> (j * 2)) & 3) + 1 << endl;
      }
      break;
    }
  }


}

Submission Info

Submission Time
Task B - 今年の B 問題
User ei13333
Language C++14 (GCC 5.4.1)
Score 240
Code Size 581 Byte
Status
Exec Time 2105 ms
Memory 256 KB

Test Cases

Set Name Score / Max Score Test Cases
All 200 / 200 00_sample_00, 00_sample_01, 10_manual_01, 10_manual_02, 10_manual_03, 10_manual_04, 10_manual_05, 10_manual_06, 10_manual_07, 10_manual_08, 10_manual_09, 10_manual_10, 10_manual_11, 10_manual_12, 10_manual_13, 10_manual_14, 10_manual_15, 10_manual_16
camypaper 10 / 10 30_camypaper
DEGwer 0 / 10 30_DEGwer
dnk 0 / 10 30_dnk
E869120 0 / 10 30_E869120
ei1333 0 / 10 30_ei1333
Huziwara 0 / 10 30_Huziwara
IH19980412 0 / 10 30_IH19980412
japlj 10 / 10 30_japlj
joisino 0 / 10 30_joisino
maroonrk 0 / 10 30_maroonrk
rickytheta 0 / 10 30_rickytheta
satashun 0 / 10 30_satashun
satos 0 / 10 30_satos
semiexp 0 / 10 30_semiexp
sigma425 10 / 10 30_sigma425
sugim48 0 / 10 30_sugim48
tozangezan 0 / 10 30_tozangezan
wo01 0 / 10 30_wo01
yosupo 10 / 10 30_yosupo
Case Name Status Exec Time Memory
00_sample_00 4 ms 256 KB
00_sample_01 4 ms 256 KB
10_manual_01 4 ms 256 KB
10_manual_02 4 ms 256 KB
10_manual_03 6 ms 256 KB
10_manual_04 6 ms 256 KB
10_manual_05 6 ms 256 KB
10_manual_06 5 ms 256 KB
10_manual_07 4 ms 256 KB
10_manual_08 4 ms 256 KB
10_manual_09 5 ms 256 KB
10_manual_10 6 ms 256 KB
10_manual_11 4 ms 256 KB
10_manual_12 4 ms 256 KB
10_manual_13 4 ms 256 KB
10_manual_14 10 ms 256 KB
10_manual_15 4 ms 256 KB
10_manual_16 4 ms 256 KB
30_DEGwer 16 ms 256 KB
30_E869120 320 ms 256 KB
30_Huziwara 6 ms 256 KB
30_IH19980412 168 ms 256 KB
30_camypaper 4 ms 256 KB
30_dnk 8 ms 256 KB
30_ei1333 704 ms 256 KB
30_japlj 4 ms 256 KB
30_joisino 15 ms 256 KB
30_maroonrk 702 ms 256 KB
30_rickytheta 702 ms 256 KB
30_satashun 10 ms 256 KB
30_satos 6 ms 256 KB
30_semiexp 2105 ms 256 KB
30_sigma425 10 ms 256 KB
30_sugim48 472 ms 256 KB
30_tozangezan 704 ms 256 KB
30_wo01 358 ms 256 KB
30_yosupo 4 ms 256 KB