• <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;
            }
            91久久精品国产免费直播| 一本色道久久综合亚洲精品| 天天久久狠狠色综合| 九九久久精品国产| 伊人久久大香线蕉成人| 久久久久久亚洲AV无码专区| 国产精品成人精品久久久| 99精品国产免费久久久久久下载| 亚洲AV无码久久| 久久久久这里只有精品 | 国产激情久久久久影院小草| 久久亚洲国产精品五月天婷| 久久影院综合精品| 欧美日韩精品久久久免费观看| 久久久无码一区二区三区| 久久99国产精品久久99果冻传媒| 久久免费大片| 国产激情久久久久影院小草 | 久久久亚洲裙底偷窥综合| 国产69精品久久久久777| 99久久99久久精品国产片果冻| 狠狠人妻久久久久久综合蜜桃| 丁香五月网久久综合| 久久精品国产99久久久| 婷婷久久香蕉五月综合加勒比| 久久伊人影视| 亚洲人成无码网站久久99热国产| 99热都是精品久久久久久| 亚洲成色999久久网站| 97久久精品无码一区二区| 久久精品人人做人人爽电影蜜月| 国产成人久久精品一区二区三区| 国产2021久久精品| 国内精品久久久久久麻豆 | 国产成人久久AV免费| 色欲av伊人久久大香线蕉影院| 久久精品国产亚洲AV不卡| 久久久国产视频| 伊人久久综合无码成人网| 欧美熟妇另类久久久久久不卡| 无码精品久久久天天影视 |