2 条题解

  • 0
    @ 2025-4-3 20:19:55

    嗯欧哎劈c++题解

    思路

    根据题意,一等奖线为第一个数,二等奖线为第三个数减一,三等奖线为40.

    解题方法

    连续分支结构

    复杂度

    时间复杂度:

    O(n)O(n)

    空间复杂度:

    O(n)O(n)

    Code

    #include<bits/stdc++.h>
    using namespace std;
    int n,a[35];
    int main(){
        //freopen("import file name.in","r",stdin);
        //freopen("export file name.out","w",stdout);
        ios::sync_with_stdio(false);
        cin.tie(NULL);
        cout.tie(NULL);
        cin>>n;
        for(int i=1;i<=32;i++){
        	cin>>a[i];
        }
        if(n>=a[1]){
        	printf("sidekick");
        }
        else if(n>=(a[3]-1)){
        	printf("sgnd");
        }
        else if(n>=40){
        	printf("cxq");
    	}
    	else{
    		printf("kiku");
    	}
    return 0;
    }
    
    • 0
      @ 2025-4-2 19:58:51

      嗯欧哎劈python题解

      思路

      根据题意,一等奖线为第一个数,二等奖线为第三个数减一,三等奖线为40.

      解题方法

      分支结构,连续判断

      复杂度

      时间复杂度:

      O(n)O(n)

      空间复杂度:

      O(n)O(n)

      Code

      s = int(input())
      scores = list(map(int, input().split()))
      first = scores[0]
      second = scores[2] - 1
      if s >= first:
      print("sidekick")
      elif s >= second:
      print("sgnd")
      elif s >= 40:
      print("cxq")
      else:
      print("kiku")
      
      • 1

      信息

      ID
      125
      时间
      3000ms
      内存
      512MiB
      难度
      1
      标签
      递交数
      134
      已通过
      102
      上传者