Announcement

Collapse
No announcement yet.

Cách thi ACM cá nhân thử

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cách thi ACM cá nhân thử

    Chào các bạn!
    Tôi giới thiệu các bạn cách thi ACM thử như sau:

    Cách thi ACM cá nhân thử (hôm nay hệ thống sẽ mở đến 23:00 để các bạn test, nếu thấy nghi ngờ hệ thống bị sai các bạn cứ post ở đây)
    B1. http://acm.uit.edu.vn/judge/team/ để đăng nhập hoặc đăng ký
    B2. Sau khi đăng nhập cách bạn sử dụng như hình

    Attached Files
    Last edited by toannv; 17-09-2016, 12:24.

  • #2
    Bài giải bài D -chạy được dịch bằng C

    PHP Code:
    #include <stdio.h>
    #include <stdlib.h>

    inttwoSum(intnumsint numsSizeint target) {
        
    int i,j;
        
    int *results = (int*)calloc(sizeof(int),2);
        for (
    0numsSize-1i++)
            for (
    j=i+1numsSizej++)
                if (
    nums[i]+nums[j]==target)
                {
                      
    results[0]=i;
                      
    results[1]=j;
                      return 
    results;
                }
        return 
    results;
    }
    int main()
    {
        
    int i,numsSize,target;
        
    int nums[100];
        
    intresults;
        
    scanf("%d",&numsSize);
        for (
    i=0;i<numsSize;i++)
            
    scanf("%d",&nums[i]);
        
    scanf("%d",&target);
        
    results twoSum(nums,numsSize,target);
        
    printf("%d %d",results[0],results[1]);

        return 
    0;

    Comment


    • #3
      Cho em hỏi bài C em bị runtime-error ở test nào ạ?

      Comment


      • #4
        em cứ bị RUN-ERROR chả hiểu sao??? chạy 2 IDE đều có kết quả cả

        Comment


        • #5
          Originally posted by toannv View Post
          Bài giải bài D -chạy được dịch bằng C

          PHP Code:
          #include <stdio.h>
          #include <stdlib.h>

          inttwoSum(intnumsint numsSizeint target) {
              
          int i,j;
              
          int *results = (int*)calloc(sizeof(int),2);
              for (
          0numsSize-1i++)
                  for (
          j=i+1numsSizej++)
                      if (
          nums[i]+nums[j]==target)
                      {
                            
          results[0]=i;
                            
          results[1]=j;
                            return 
          results;
                      }
              return 
          results;
          }
          int main()
          {
              
          int i,numsSize,target;
              
          int nums[100];
              
          intresults;
              
          scanf("%d",&numsSize);
              for (
          i=0;i<numsSize;i++)
                  
          scanf("%d",&nums[i]);
              
          scanf("%d",&target);
              
          results twoSum(nums,numsSize,target);
              
          printf("%d %d",results[0],results[1]);

              return 
          0;

          Thầy ơi cho em hỏi là các bài code khác mình cũng viết với cấu trúc tương tự hả thầy? Có cần phải đọc dữ liệu từ file input và xuất ra file input không ạ? :unhappy:
          Nguyễn Tiến Dũng
          Falculty of Software Engineering (K11)
          Facebook: https://www.facebook.com/mrnsapro
          Email: 16520259@gm.uit.edu.vn - mrnsapro@gmail.com

          Comment


          • #6
            Originally posted by 16521071 View Post
            Cho em hỏi bài C em bị runtime-error ở test nào ạ?
            Bạn up code lên mình xem thử

            Comment


            • #7
              Originally posted by 15520604 View Post
              em cứ bị RUN-ERROR chả hiểu sao??? chạy 2 IDE đều có kết quả cả
              Bạn up code lên mình xem thử.

              Comment


              • #8
                Originally posted by 16520259 View Post
                Thầy ơi cho em hỏi là các bài code khác mình cũng viết với cấu trúc tương tự hả thầy? Có cần phải đọc dữ liệu từ file input và xuất ra file input không ạ? :unhappy:
                Đúng rồi bạn, không cần phải đọc xuất file.

                Comment

                LHQC

                Collapse
                Working...
                X