• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            Uriel's Corner

            Research Associate @ Harvard University / Research Interests: Computer Vision, Biomedical Image Analysis, Machine Learning
            posts - 0, comments - 50, trackbacks - 0, articles - 594
            //2007年上海交通大學計算機研究生機試題 Old Bill基本比較水。。

            1. Old Bill
                暴力枚舉
            //2007年上海交通大學計算機研究生機試題 Old Bill
            #include<stdio.h>
            #include
            <stdlib.h>
            #include
            <string.h>

            int n;

            int main() {
                
            int i, j, a, b, c, tp;
                
            while(~scanf("%d"&n)) {
                    scanf(
            "%d %d %d"&a, &b, &c);
                    
            for(i = 9; i >= 0--i) {
                        
            for(j = 9; j >= 0--j) {
                            tp 
            = i * 10000 + a * 1000 + b * 100 + c * 10 + j;
                            
            if(tp % n == 0goto M;
                        }
                    }
                    puts(
            "0");
                    
            continue;
            M:      printf(
            "%d %d %d\n", i, j, tp / n);
                }
                
            return 0;
            }


            2. Powerful Calculator
                C++好糾結。。最終還是敗在高精度減法上了。。JAVA水過。。最近一定要再C++敲下。。畢竟上機考試各種JAVA不讓用的。。
            import java.util.*;
            import java.math.*;
             
            public class Main {
                
            public static void main(String args[]) {
                    Scanner cin 
            = new Scanner(System.in);
                    BigInteger a, b;
                    
            while(cin.hasNext()) {
                        a 
            = cin.nextBigInteger();
                        b 
            = cin.nextBigInteger();
                        System.out.println(a.add(b));
                        System.out.println(a.subtract(b));
                        System.out.println(a.multiply(b));
                    }
                }
            }


            3. Sum of Factorials
                有點像01背包的思路。。不過只是標記是否能取到,不用取最值
                PS: 0!=1,別忘了。。WA*1。。
            //2007年上海交通大學計算機研究生機試題 Sum of Factorials
            #include<stdio.h>
            #include
            <stdlib.h>
            #include
            <string.h>

            int f[10= {112624120720504040320362880};
            int n, dp[1000010];

            int main() {
                
            int i, j;
                memset(dp, 
            0sizeof(dp));
                dp[
            0= 1;
                
            for(i = 0; i < 10++i) {
                    
            for(j = 1000000; j >= f[i]; --j) {
                        
            if(dp[j - f[i]]) dp[j] = 1;
                    }
                }
                
            while(~scanf("%d"&n)) {
                    
            if(dp[n]) puts("YES");
                    
            else
                        puts(
            "NO");
                }
                
            return 0;
            }


            4. Zero-complexity Transposition
                以為有什么trick呢。。結果long long水過
            //2007年上海交通大學計算機研究生機試題 Zero-complexity Transposition
            #include<stdio.h>
            #include<stdlib.h>
            #include<string.h>

            int n;
            long long a[10010];

            int main() {
                
            int i;
                
            while(~scanf("%d"&n)) {
                    
            for(i = 0; i < n; ++i) scanf("%lld"&a[i]);
                    
            for(i = n - 1; i > 0--i) printf("%lld ", a[i]);
                    printf("%lld\n", a[0]);
                }
                
            return 0;
            }
            精品国产婷婷久久久| 久久久久免费看成人影片| 久久国产精品二国产精品| 久久人妻少妇嫩草AV无码蜜桃| 日韩欧美亚洲国产精品字幕久久久| 亚洲精品无码久久不卡| 亚洲AV无码久久| 99久久www免费人成精品| 中文国产成人精品久久亚洲精品AⅤ无码精品 | 亚洲一区中文字幕久久| 久久这里只有精品视频99| 久久亚洲中文字幕精品有坂深雪| 亚洲国产精品一区二区久久| 亚洲国产精品成人久久蜜臀| 亚洲综合婷婷久久| 亚洲av成人无码久久精品| 久久久久亚洲AV成人网人人网站| 久久香综合精品久久伊人| 无码精品久久一区二区三区 | 久久精品国产一区二区三区不卡| 久久久久久久波多野结衣高潮| 97久久精品人人澡人人爽| 久久偷看各类wc女厕嘘嘘| 一本久久免费视频| 久久最新免费视频| 久久综合九色综合欧美就去吻| 久久久精品免费国产四虎| 国产综合久久久久| 久久久一本精品99久久精品88| 久久亚洲日韩看片无码| 久久中文字幕精品| 亚洲人成网站999久久久综合 | 久久久久久久综合日本| 久久免费视频观看| 中文字幕亚洲综合久久| 久久综合狠狠综合久久激情 | 亚洲国产精品一区二区久久| 久久久久久久尹人综合网亚洲| 97久久香蕉国产线看观看| 久久久久久国产精品无码超碰| 欧美午夜精品久久久久免费视|