9 条题解

  • 1
    @ 2025-2-19 11:15:29

    for(int i=1;i<=m;i++) p=(p*n)%7;>

    • 1
      @ 2025-2-19 11:15:02

      (ab)%n=(a%n)(b%n)

      • 0
        @ 2025-2-19 10:59:13
        
        #include<bits/stdc++.h>
        using namespace std;
        int main() {
            long long a,b,x=1,n=0;
            cin>>a>>b;
            for(int i=1;i<=b;i++){
            	x=x*a;
            	x=x%7;
        	}
            if(x%7!=0){
            	n=x%7;
        	}
        	else if(x%7==0){
        		cout<<"Sunday";
        	}
        	if(n==1){
        		cout<<"Monday";
        	}
        	else if(n==2){
        		cout<<"Tuesday";
        	}
        	else if(n==3){
        		cout<<"Wednesday";
        	}
        	else if(n==4){
        		cout<<"Thursday";
        	}
        	else if(n==5){
        		cout<<"Friday";
        	}
        	else if(n==6){
        		cout<<"Saturday";
        	}
            return 0;
        }
        
        
        • -2
          @ 2024-7-28 20:00:16

          无敌了你们

          • -12
            @ 2024-4-9 15:30:24

            使用模乘运算可以避免数据爆炸

            • -13
              @ 2024-4-19 16:55:19

              想怎么写就怎么写反正不对

              • -14
                @ 2024-6-7 14:10:53

                6666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666

                • -16
                  @ 2024-3-20 17:01:06

                  ybb

                  • -16
                    @ 2024-3-20 16:59:55

                    sbcnm

                    • 1

                    信息

                    ID
                    1248
                    时间
                    1000ms
                    内存
                    128MiB
                    难度
                    8
                    标签
                    (无)
                    递交数
                    194
                    已通过
                    35
                    上传者