Challenge
Careers
Class
Connect
로그인 후 문제풀이가 가능합니다.
JS
const fs = require('fs'); const input = fs.readFileSync(0, 'utf8').trim().split('\n').slice(1) /* * 1 0 2 * 1 2 * 3 3 3 * 4 5 * 4 6 5 */ const LED = { 0: 0b1110111, 1: 0b100100, 2: 0b1011101, 3: 0b1101101, 4: 0b101110, 5: 0b1101011, 6: 0b1111011, 7: 0b100111, 8: 0b1111111, 9: 0b1101111, x: 0b0000000 }; const output = [] input.forEach(numbers => { const [numb...
c언어 풀이 공유합니다~
#include <stdio.h> #include <stdlib.h> int num[10][7] = { {1, 1, 1, 1, 1, 1, 0}, // 0 {0, 1, 1, 0, 0, 0, 0}, // 1 {1, 1, 0, 1, 1, 0, 1}, // 2 {1, 1, 1, 1, 0, 0, 1}, // 3 {0, 1, 1, 0, 0, 1, 1}, // 4 {1, 0, 1, 1, 0, 1, 1}, // 5 {1, 0, 1, 1, 1, 1, 1}, // 6 {1, 1, 1, 0, 0, 1, 0}, // 7 {1, 1, 1, 1, 1, 1, 1}, // 8 {1, 1, 1, 1, 0, 1, 1} // 9 }; int cal(int a, int b) { int mod_a, mod_b, sum = 0; while(a != 0 || b != 0) { ...
1,2번만 맞아요. 자바스크립트 풀이 왜 틀릴까요?
const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); let t; let arr = []; let lineCount = 0 rl.on("line", (input) => { if (lineCount == 0) t = +input; else arr.push(input.split(" ")); lineCount++; }); rl.on("close", () => { const originArr = [6, 2, 5, 5, 4, 5, 6, 4, 7, 6]; // 숫자 없애기 또는 생기게 하기 const changeArr = [ // 숫자 바꾸기 [0,4,3,3,4,3,2,2,1,2], [4,0,5,3,2,5,6,2,5,4], [3,5...
C++ 풀이
#include <bits/stdc++.h> #define endl '\n' using namespace std; int f(int); int main() { ios::sync_with_stdio(false); cin.tie(NULL); int T, A, B, d1, d2, a, b, res; vector<string> v = { "1011111", "0000101", "1110110", "1110101", "0101101", "1111001", "1111011", "1001101", "1111111", "1111101" }; cin >> T; while (T--) { cin >> A >> B; if (A > B) swap(A, B); d1 = f(A); d2 = f(B); res = 0; for (int i = d2; i >= 1; i /= 10) { a = A / i % 10; ...
java - 정답 코드
import java.io.*; import java.util.*; public class Main { // 전광판 기록 배열 생성 private static int CNT_OF_NUM = 5; private static int SWITH_OF_ONE_NUM = 7; private static int[][] board = new int[CNT_OF_NUM][SWITH_OF_ONE_NUM]; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = Integer.parseInt(sc.nextLine()); // 1. 각 숫자 스위치 플래그를 배열에 저장 int[][] numPosArr = { {1,1,1,0,1,1,1}...
자바 문자열로
import java.io.*; import java.util.*; public class Main { static int[][] numState = { {1,1,0,1,1,1,1}, {0,1,0,1,0,0,0}, {1,1,1,0,1,1,0}, {1,1,1,1,1,0,0}, {0,1,1,1,0,0,1}, {1,0,1,1,1,0,1}, {1,0,1,1,1,1,1}, {1,1,0,1,0,0,1}, {1,1,1,1,1,1,1}, {1,1,1,1,1,0,1} }; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStrea...
이게 틀렸다할 반례가 가려져 있어서 전 잘 모르겠네요.
#include<stdio.h> #include<math.h> const int bulbsToSwitch[11][11] = { {0,4,3,3,4,3,2,2,1,2,6}, {4,0,5,3,2,5,6,2,5,4,2}, {3,5,0,2,5,4,3,5,2,3,5}, {3,3,2,0,3,2,3,3,2,1,5}, {4,2,5,3,0,3,4,2,3,2,4}, {3,5,4,2,3,0,1,3,2,1,5}, {2,6,3,3,4,1,0,4,1,2,6}, {2,2,5,3,2,3,4,0,3,2,4}, {1,5,2,2,3,2,1,3,0,1,7}, {2,4,3,1,2,1,1,2,1,0,6}, {6,2,5,5,4,5,6,4,7,6,0} }; int main() { int t1, nT; freopen("input.txt","r",stdin); // Reopen stdin from input text file scanf("%d", ...
반례좀 부탁드려요 정답과비교했을때 답이 다 같아서요 ㅠ
import java.util.Scanner; public class Mainb { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[][] temp = new int[N][2]; int[][] a = new int[11][11]; a[0][0] = 0; a[0][1] = 4;a[1][0] = 4; a[0][2] = 3;a[2][0] = 3; a[0][3] = 2;a[3][0] = 2; a[0][4] = 4;a[4][0] = 4; a[0][5] = 3;a[5][0] = 3; a[0][6] = 2;a[6][0] = 2; a[0][7] = 2;a[7][0] = 2; a[0][8] = 1;a[8][0] = 1; a[0][9] = 2;a[9][0] = 2; a[1][2] = 5;a[2][1] = 5; a[1][3] = 3;a[3][1] = 3; a[1...
c++ 풀이입니다.
#include<iostream> #include<unordered_map> #include<vector> #include <string> using namespace std; int main(int argc, char** argv) { std::unordered_map<int,int> numGapMap; numGapMap.emplace(0, 6); numGapMap.emplace(1, 2); numGapMap.emplace(2, 5); numGapMap.emplace(3, 5); numGapMap.emplace(4, 4); numGapMap.emplace(5, 5); numGapMap.emplace(6, 6); numGapMap.emplace(7, 4); numGapMap.emplace(8, 7); numGapMap.emplace(9, 6); ...
코드 공유합니다. 더 좋은 방법 있으면 의견 주시면 감사하겠습니다.
# 15:46 ~ 16:07 test_num = int(input()) test_case = [list(input().split()) for _ in range(test_num)] def make_matrix(num): matrix = [[0 for _ in range(7)] for _ in range(5)] for i in range(1, len(num)+1): if num[-i] == '0': matrix[-i] = [1, 1, 1, 0, 1, 1, 1] elif num[-i] == '1': matrix[-i] = [0, 0, 1, 0, 0, 1, 0] elif num[-i] == '2': matrix[-i] = [1, 0, 1, 1, 1, 0, 1] elif num[-i] == '3': matrix[-i] = [1, 0, 1, 1, 0, 1, 1] elif num[-i] == '4': matrix[-i] = [0, 1, 1, 1, 0, 1, 0] elif num[-i] =...