4 solutions
-
0
#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
#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
#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
#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 }
- 1
Information
- ID
- 178
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 3
- Tags
- # Submissions
- 99
- Accepted
- 21
- Uploaded By