본문 바로가기

Solutions/Dlbo's Solution

PKU 2234. Matches Game. AC get -_-;;; #include int main() { int n, k, sum; while (~scanf("%d", &n)) { sum = 0; while (n--) { scanf("%d", &k); sum ^= k; } if (sum) { printf("Yes\n"); } else { printf("No\n"); } } return 0; } 쩝... 초 간결한 코드입니다. -_-;; 그냥 단순하게 정해진 최대치를 서로 계속 가져간다 했을때, 정해진 최대치에 맞아 떨어져서 최종 갯수가 0이 아니면 이긴거고, 0이면 진거지요 뭐 =ㅁ=;; 더보기
PKU 2243. Knight Moves. AC get -_- #include #include #include #include #include using namespace std; typedef struct point { int x, y; }Point; list temp[8]; int arr[8][8]; void clearMap() { int i; memset(arr, -1, sizeof(arr)); for (i = 0; i = 0 && py >= 0 && px < 8 && py < 8)) { re.. 더보기
PKU 2840. Big Clock. AC get! #include int main() { int a, b, n; scanf("%d", &n); while (n--) { scanf("%d:%d", &a, &b); if (b != 0) { printf("0\n"); continue; } if (a == 12) { printf("%d\n", 24); continue; } printf("%d\n", (a + 12) % 24); } return 0; } 뻘짓 좀 해서 WA 한번 떴습니다. 별거 없는 단순한 문제죠? 더보기
PKU 2656. Unhappy Jinjin. AC get import java.util.Scanner; public class test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int i, n, md, mv, a, b; while(true) { n = sc.nextInt(); md = -1; mv = -1; if (n == 0) break; for (i = 0; i mv) { mv = a + b; md = i + 1; } } if (mv 더보기
PKU 1163. The Triangle. ㅁㅊ ㅎㄷㅅ~! #include using namespace std; int data[101][101]; int main() { int n, i, j, big = 0; cin >> n; for (i = 0; i data[i][j]; data[i][j] = max(data[i - 1][j] + data[i][j], data[i - 1][j - 1] + data[i][j]); } } for (i = 1; i 더보기
PKU 2039. To and Fro. AC get -_-! #include #include #include char temp[256], buf[256]; int main() { int cnt, i, j, k, len; while(scanf("%d", &k)) { cnt = 0; if (k == 0) { break; } scanf("%s", buf); len = strlen(buf); for (i = 0; i < k; i++) { for (j = i; j < len; j += k) { if ((j / k) % 2 != 0) { temp[cnt++] = buf[((j / k) + 1) * k - 1 - (j % k)]; } else { temp[cnt++] = buf[j]; } } } temp[len] = '\0'; puts(temp); } } .... 그냥 단순한.. 더보기
UVa 324. Factorial Frequencies. AC get -_- import java.math.BigInteger; import java.util.*; public class Main { public static void main(String[] args) { int n, i; int[] data; BigInteger a; String temp; Scanner sc = new Scanner(System.in); data = new int[10]; while (sc.hasNextInt()) { n = sc.nextInt(); for (i = 0; i < 10; i++) { data[i] = 0; } if (n == 0) { break; } a = BigInteger.ONE; for (i = 1; i 더보기
UVa 324. Factorial Frequencies 채점큐에서 안나옴 -_- package uva324; import java.math.BigInteger; import java.util.*; public class Main { public static void main(String[] args) { int n, i; int[] data; BigInteger a; String temp; Scanner sc = new Scanner(System.in); data = new int[10]; while (sc.hasNextInt()) { n = sc.nextInt(); for (i = 0; i < 10; i++) { data[i] = 0; } if (n == 0) { break; } a = BigInteger.ONE; for (i = 1; i 더보기
PKU1455. Crazy tea party. AC get.. #include using namespace std; int main() { int cases, i, n, result, a, b; cin >> cases; for (i = 0; i > n; if(n % 2 == 0) { result = (n / 2 - 1) * n / 2; } else { a = n / 2; b = n - n / 2; result = ((a-1) * a + (b - 1) * b) / 2; } cout 더보기
PKU 2719. Faulty Odometer. AC get... a(n,k,nn,sum1,sum2){if(n 더보기
PKU 2719. 이상한 속도계. 솔루션코드. #include #include #include #include using namespace std; int main() { int data, i, sum, a; while (cin >> data) { if (data == 0) { break; } sum = data; i = 1; cout 더보기
포스트 연기 공지 -_-;; -------------------------------------------------------------------------------------------- 연기 사유 : ...... 자료 압박 연기 일자 : 2. 17 화 재연재 일정 : 2. 19 목 이전까지 -------------------------------------------------------------------------------------------- 변명의 변-_- 후배녀석이 컴을 중고로 17만원 주고 사왔습니다. .... 실제 가격대는 약 30만은 써야 되는 가격대. +로 서로 밸런스도 캐안습. -_-; 계속 고치다 고치다 오늘 끝장 봤습니다. CPU도 탄거 커버 불가, 보드도 막장, 하드도 캐막장. -_-.. 더보기
PKU 1904, 2551 AC 확인 했습니다. 둘다 AC입니다만, 1904 타임이 엽기군요 ㄱ- 더보기
UVa 200. Rare Order AC get =_= #include #include #include #define FUCKYOUSPARKING 100 int graph[FUCKYOUSPARKING][FUCKYOUSPARKING]; int out_degree[FUCKYOUSPARKING]; int degree[FUCKYOUSPARKING]; char prev[255]; char curr[255]; // 문자 비교 파트에요. -_- void fuckingJAVA(char *a, char *b, int graph[FUCKYOUSPARKING][FUCKYOUSPARKING], int degree[FUCKYOUSPARKING], int out_degree[FUCKYOUSPARKING]) { int firstChar = *a - 'A', secondChar = *b.. 더보기
UVa 112. Tree summing by Java. AC. -_-..... package test; import java.io.*; public class Main { static DataInputStream dis; static int target; static boolean what; static boolean plus; public static boolean getTarget() throws Exception { int temp1, start = 0; while (((temp1 = dis.read()) != -1)) { if (temp1 == '-') { plus = false; start++; continue; } if (temp1 == '(') { what = true; return true; } if (temp1 == -1) { return false; } if (t.. 더보기
PKU 1145, UVa 112 Tree summing by Java. RE. package test; import java.util.*; import java.io.*; import java.util.regex.MatchResult; public class Main { static Scanner sc; static MatchResult mc; static int target; static String temp; static DataInputStream dis; static int level = 0; public static String getTree() throws Exception { int temp1; String buffer = new String(); do { temp1 = dis.read(); if (temp1 == ' ' || temp1 == '\n' || temp1 .. 더보기
PKU 2551. Ones. Wait for Server-_- #include using namespace std; int main() { int n, i, sum; while(cin >> n) { for(i = 1, sum = 1; sum % n; i++) { sum = (sum % n * 10) + 1; } cout 더보기
PKU 1904. King's Quest. Wait for Server-_- #include #include const int SHIT = 3000; using namespace std; int iPrinceChoice[SHIT][SHIT], temp1[SHIT][SHIT] = {0}, temp2[SHIT][SHIT] = {0}; int iUserStack[SHIT], iTopOfStack, iChecker; int iPlayBoy[SHIT] = {0}, label[SHIT] = {0}; void DFS_1(int fuck); void DFS_2(int fuck); int main() { int i, j, k, n; int iPrincess[SHIT]; scanf("%d", &n); for (i = 1; i 더보기
PKU 1953. World Cup Noise. AC get -_- #include int main() { int arr[45], a, b, cnt, i; arr[0] = 1; arr[1] = 2; scanf("%d", &cnt); for (i = 1; i 더보기
PKU 2845. 01000001. AC get -_-! #include #include #include #include using namespace std; int main() { int carry, cnt, i, j, k; char temp1[256], temp2[256], result[256], temp3[256]; scanf("%d", &cnt); for (i = 0; i strlen(temp1)) { strcpy(temp3, temp2); strcpy(temp2, temp1); strcpy(temp1, temp3); strcpy(temp3, ""); } j = strlen(temp1) - 1; k = strlen(temp.. 더보기
PKU 1089. Intervals. AC get.... -_-; #include #include #include using namespace std; typedef struct { int start, end; }dis; int cmp(const void * a, const void * b) { dis * first = (dis *)a; dis * second = (dis *)b; if (first->start == second->start) { return first->end - second->end; } return first->start - second->start; } dis list[50000]; int main() { int n, i, min, max; cin >> n; i = 0; while(i < n) { scanf("%d%d", &(list[i].sta.. 더보기
PKU 1089. Intervals. WA. #include #include #include using namespace std; typedef struct { int start, end; }dis; int main() { list a; list::iterator InnerIt, OuterIt; bool isIn; dis temp; int n; cin >> n; while(n--) { isIn = false; cin >> temp.start >> temp.end; a.push_back(temp); } for (OuterIt = a.begin(); OuterIt != a.end(); OuterIt++) { for (InnerIt = a.begin(); InnerIt != a.end(); InnerIt++) { if (OuterIt == InnerIt.. 더보기
PKU 3685. Matrix. Solution. #include #include int main() { int n; __int64 N, M; __int64 min, max; __int64 x, j; __int64 sum; __int64 det, cal_1, cal_2; const __int64 w = 100000; scanf("%d", &n); while (n--) { scanf("%I64d%I64d", &N, &M); max = w * w * 10; min = -1 * max; while (min < max) { x = (min + max) / 2; if (x == max) { x--; } sum = 0; for (j = 1 ;(j = cal_1) { sum += (cal_2 - cal_1 + 1); } } if (sum < M) { min = x .. 더보기
PKU 1298. The hardest problem ever. AC get -_- #include #include int main() { char start[256], temp[256]; int i; while(gets(start)) { if (!strcmp(start, "ENDOFINPUT")) { break; } gets(temp); for (i = 0; i 'E' && temp[i] 더보기
PKU 3438. Look and Say. AC get~ -_-! #include #include using namespace std; int main() { string temp; int cases, i, cnt, lastindex; cin >> cases; while (cases--) { i = 1; cnt = 1; getline(cin, temp); if (temp == "") { cases++; continue; } while (temp[i] != '\0') { if (temp[i - 1] == temp[i]) { cnt++; } else { cout 더보기
PKU 3030. Nasty Hacks. AC Get -_-.. #include using namespace std; int main() { int N, RespectNot, Respect, AdvPay; cin >> N; while(N--) { cin >> RespectNot >> Respect >> AdvPay; if((Respect - RespectNot) > AdvPay) { cout 더보기
PKU 2521. How much did the businessman lose. AC get~ main(N,M,P){for(;scanf("%d%d%d%*d",&N,&M,&P),N;printf("%d\n",N-M+P));} 낄낄. 전에 지군 앞에서 숏코딩 보여줬던 문제였는데 이걸 번역하다니 -_-a 더보기
PKU 2636. 전기콘센트(?) AC get~-_- #include using namespace std; int main() { int N, K, sum, s; cin >> N; while(N--) { cin >> K; sum = 0; while (K--) { cin >> s; sum += s; sum--; } cout 더보기
PKU 1979. Red and Black. AC get~ #include #include #include using namespace std; char a[101][101]; int b[101][101]; int total, m, n; void __fastcall isMovable(int x, int y) { total++; b[x][y] = 1; if (x - 1 >= 0) { if (a[x - 1][y] == '.' && b[x - 1][y] == 0) { isMovable(x - 1,y); } } if (x + 1 = 0) { if (a[x][y - 1] == '.' && b[x][y - 1] ==.. 더보기
PKU 3077. Rounders. AC get~ #include using namespace std; int main() { int cases, cipher, data, i; cin >> cases; for (i = 0; i > data; cipher = 10; while (data / cipher != 0) { data += cipher / 2; data /= cipher; data *= cipher; cipher *= 10; } cout 더보기