/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 348.0 KiB
#2 Wrong Answer 19ms 788.0 KiB
#3 Wrong Answer 20ms 716.0 KiB

Code

// Author : Kamonasish Roy (Bullet)
// Time : 2025-03-02 14:02:10

#include<bits/stdc++.h>
using namespace std;
const long long M=1e6+10,MOD=1e9+7;
typedef long long ll;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t=1;
    cin>>t;
   
    while(t--){
       ll n;
       cin>>n;
       ll sum= n * (n+1LL)/2;
       if(n==1){
       	cout<<n<<"\n";
       	continue;
       }
       ll answer=2;
       ll two=0,three=0;
        ll c=2,d=3;
        while(c<=sum){
        	two++;
        	if(c * d<=sum){
        		three++;
        		d*=3LL;
        		answer=max(answer,(two+1)*(three+1));
        	}
        	c*=2LL;
        	answer=max(answer,two+1);
        }
        cout<<answer<<"\n";
        
        
    	}
    	
    	   
    return 0;
 
}

Information

Submit By
Type
Submission
Problem
P1180 Maximum Divisor
Language
C++17 (G++ 13.2.0)
Submit At
2025-03-15 11:53:24
Judged At
2025-03-15 11:53:24
Judged By
Score
0
Total Time
20ms
Peak Memory
788.0 KiB