4 solutions

  • 0
    @ 2025-1-11 15:55:11
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n;
    	cin>>n;
    	while(n++)
    	{
    		int x;
    		cin>>x;
    		map<int,char> h;
    		for(int i=1;i<=n/i;i++)
    		{
    			if(x&n==0)
    			{
    				h[i]++;
    				x%=i;
    			}
    		}
    		if(x>>1) h[x]--;
    		for(auto it:h) cout<<it.first<<" "<<it.second<<endl;
    		cout<<endl;
    	}
    	return 0;
    }
    
    
    
    
    • 0
      @ 2024-11-30 16:00:41
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          int n;
          cin>>n;
          while(n--)
          {
              int x;
              cin>>x;
              map<int,int> h;
              for(int i=2;i<=x/i;i++)
              {
                  while(x%i==0)
                  {
                      h[i]++;
                      x/=i;
                  }
              }
              if(x>1)
              {
                  h[x]++;
              }
              for(auto it:h)
              {
                  cout<<it.first<<" "<<it.second<<endl;
              }
              cout<<endl;
          }
          return 0;
      }
      
      • -1
        @ 2024-12-21 11:47:19
        #include<bits/stdc++.h>
        using namespace std;
        int main()
        {
            int n;
            cin>>n;
            while(n--)
            {
                int x;
                cin>>x;
                map<int,int> h;
                for(int i=2;i<x/i;i++)
                {
                    while(x%i==0)
                    {
                        h[i]++;
                        x/=i;
                    }
                }
                if(x>1)
                {
                    h[x]++;
                }
                for(auto it:h)
                {
                	cout<<it.first<<" "<<it.second<<endl;
        		}
        		cout<<endl;
            }
            return 0;
        }
        
        • -4
          @ 2024-11-2 10:25:26
          #include<bits/stdc++.h>
          using namespace std;
          int main()
          {
              int n;
              cin>>n;
              while(n--)
              {
                  int x;
                  cin>>x;
                  map<int,int> h;
                  for(int i=2;i<=x/i;i++)
                  {
                      while(x%i==0)
                      {
                          h[i]++;
                          x/=i;
                      }
                  }
                  if(x>1)
                  {
                      h[x]++;
                  }
                  for(auto it:h)
                  {
                      cout<<it.first<<" "<<it.second<<endl;
                  }
                  cout<<endl;
              }
              return 0;//我是个SB,SB,大SB
          }
          • @ 2024-11-2 10:28:28

            我的绝对对

          • @ 2024-11-28 19:58:11

            请你别太嚣张!

        • 1

        Information

        ID
        178
        Time
        1000ms
        Memory
        256MiB
        Difficulty
        3
        Tags
        # Submissions
        99
        Accepted
        21
        Uploaded By