submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s309296398 | p03830 | C++ | #include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define pi 3.14159265358979323846264338327950L
using namespace std;
int main() {
int64_t N, L=1000000007;
cin >> N;
vector<int64_t> A(1001);
A[0]=0;
A[1]=1;
A[2]=2;
A[3]=4;
A[4]=8;
A[5]=16;
A[6]=30;
A[7]=60;
A[8]=96;
A[9]=160;
A[10]=270;
A[11]=540;
A[12]=792;
A[13]=1584;
A[14]=2592;
A[15]=4032;
A[16]=5376;
A[17]=10752;
A[18]=14688;
A[19]=29376;
A[20]=41040;
A[21]=60800;
A[22]=96000;
A[23]=192000;
A[24]=242880;
A[25]=340032;
A[26]=532224;
A[27]=677376;
A[28]=917280;
A[29]=1834560;
A[30]=2332800;
A[31]=4665600;
A[32]=5529600;
A[33]=7864320;
A[34]=12165120;
A[35]=16422912;
A[36]=19595520;
A[37]=39191040;
A[38]=60466176;
A[39]=85100544;
A[40]=102435840;
A[41]=204871680;
A[42]=258048000;
A[43]=516096000;
A[44]=677376000;
A[45]=819624960;
A[46]=258709753;
A[47]=517419506;
A[48]=876670706;
A[49]=698576619;
A[50]=464046052;
A[51]=210846678;
A[52]=87039944;
A[53]=174079888;
A[54]=559756674;
A[55]=984916319;
A[56]=217548604;
A[57]=16857327;
A[58]=609087587;
A[59]=218175167;
A[60]=106431041;
A[61]=212862082;
A[62]=535421074;
A[63]=139926156;
A[64]=50952999;
A[65]=105219839;
A[66]=195900610;
A[67]=391801220;
A[68]=889436190;
A[69]=472974756;
A[70]=845412639;
A[71]=690825271;
A[72]=891132264;
A[73]=782264521;
A[74]=316684054;
A[75]=31280490;
A[76]=665186745;
A[77]=252135966;
A[78]=764748573;
A[79]=529497139;
A[80]=790600338;
A[81]=524719291;
A[82]=999573608;
A[83]=999147209;
A[84]=522112609;
A[85]=37861883;
A[86]=417241520;
A[87]=775916997;
A[88]=997830958;
A[89]=995661909;
A[90]=729407917;
A[91]=321723976;
A[92]=871170030;
A[93]=520705814;
A[94]=149385219;
A[95]=41956001;
A[96]=988486370;
A[97]=976972733;
A[98]=516785610;
A[99]=158924226;
A[100]=583951250
A[1000]=972926972;
cout << A[N] << endl;
} | a.cc: In function 'int main()':
a.cc:124:19: error: expected ';' before 'A'
124 | A[100]=583951250
| ^
| ;
125 | A[1000]=972926972;
| ~
|
s766114265 | p03830 | C++ | #include<bits/stdc++.h>
#include<vector>
using namespace std;
typedef long long ll
#define mod 10000000007;
vector<pair<long long, long long>> pa(ll n){
vector<pair<ll>> res;
for(ll a=2;a*a<=n;a++){
if(n%a!=0) continue;
ll ex=0;
while(n%a==0){
ex++;
n/=a;
}
res.push_back({a,ex});
}
if(n!=1) res.push_back({n,1});
return res;
}
int main(){
ll n,a;
cin>>n;
auto &pf=pa(n);
ll ans=1;
for(auto f:pf) ans*=p.second+1;
cout<<ans%mod<<endl;
return 0;
}
| a.cc:6:1: error: expected initializer before 'vector'
6 | vector<pair<long long, long long>> pa(ll n){
| ^~~~~~
a.cc: In function 'int main()':
a.cc:21:3: error: 'll' was not declared in this scope
21 | ll n,a;
| ^~
a.cc:22:8: error: 'n' was not declared in this scope; did you mean 'yn'?
22 | cin>>n;
| ^
| yn
a.cc:23:12: error: 'pa' was not declared in this scope; did you mean 'pf'?
23 | auto &pf=pa(n);
| ^~
| pf
a.cc:24:5: error: expected ';' before 'ans'
24 | ll ans=1;
| ^~~~
| ;
a.cc:25:18: error: 'ans' was not declared in this scope; did you mean 'abs'?
25 | for(auto f:pf) ans*=p.second+1;
| ^~~
| abs
a.cc:25:23: error: 'p' was not declared in this scope
25 | for(auto f:pf) ans*=p.second+1;
| ^
a.cc:26:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
26 | cout<<ans%mod<<endl;
| ^~~
| abs
a.cc:26:16: error: expected primary-expression before '<<' token
26 | cout<<ans%mod<<endl;
| ^~
|
s103413574 | p03830 | C++ | #incldue<iostream>
using namespace std;
using ll=long long;
#define mod 10000000007;
vector<pair<ll,ll>> pa(ll n){
vector<pair<ll>> res;
for(ll a=2;a*a<=n;a++){
if(n%a!=0) continue;
ll ex=0;
while(n%a==0){
ex++;
n/=a;
}
res.push_back({a,ex});
}
if(n!=1) res.push_back({n,1});
return res;
}
int main(){
ll n,a;
cin>>n;
auto &pf=pa(n);
ll ans=1;
for(auto f:pf) ans*=p.second+1;
cout<<ans<<endl;
return 0;
}
| a.cc:1:2: error: invalid preprocessing directive #incldue; did you mean #include?
1 | #incldue<iostream>
| ^~~~~~~
| include
a.cc:5:1: error: 'vector' does not name a type
5 | vector<pair<ll,ll>> pa(ll n){
| ^~~~~~
a.cc: In function 'int main()':
a.cc:21:3: error: 'cin' was not declared in this scope
21 | cin>>n;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | #incldue<iostream>
a.cc:22:12: error: 'pa' was not declared in this scope; did you mean 'pf'?
22 | auto &pf=pa(n);
| ^~
| pf
a.cc:24:23: error: 'p' was not declared in this scope
24 | for(auto f:pf) ans*=p.second+1;
| ^
a.cc:25:3: error: 'cout' was not declared in this scope
25 | cout<<ans<<endl;
| ^~~~
a.cc:25:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:14: error: 'endl' was not declared in this scope
25 | cout<<ans<<endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | #incldue<iostream>
|
s543875096 | p03830 | C++ | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
void solve(long long N) {
vector<int> morty(n,0);
for(int i = 2;i<=N;i++){
int x = i;
for(int i1 = 2;i1<=i;i1++){
while(x%i1 == 0){morty[i1]++;x/=i1;}
}
}
long long rick = 1;
for(int i = 2;i<=N;i++){rick = rick*(morty[i]+1)%MOD;
cout<<rick;
}
// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools (tips: You
// use the default template now. You can remove this line by using your custom
// template)
int main() {
long long N;
scanf("%lld", &N);
solve(N);
return 0;
}
| a.cc: In function 'void solve(long long int)':
a.cc:7:27: error: 'n' was not declared in this scope
7 | vector<int> morty(n,0);
| ^
a.cc:22:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
22 | int main() {
| ^~
a.cc:22:9: note: remove parentheses to default-initialize a variable
22 | int main() {
| ^~
| --
a.cc:22:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:22:12: error: a function-definition is not allowed here before '{' token
22 | int main() {
| ^
a.cc:27:2: error: expected '}' at end of input
27 | }
| ^
a.cc:6:25: note: to match this '{'
6 | void solve(long long N) {
| ^
|
s201092357 | p03830 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <numeric>
#include <set>
#include <cstdlib>
#include <queue>
using namespace std;
typedef long long llint;
typedef long double ld;
#define inf 1e18
#define mod 1000000007
priority_queue<llint,vector<llint>,greater<llint>> que;
priority_queue<llint> q;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
string s;
void solve(){
llint n;
cin >> n;
llint dp[n+1];
memset(dp,0,sizeof(dp));
for(llint i=1;i<=n;i++){
llint t=i;
for(llint j=2;j<=n;j++){
while(t%j==0){
dp[j]++;
t/=j;
}
}
}
llint ans=1;
for(llint i=0;i<=n;i++)(ans*=dp[i]+1)%=mod;
cout << ans << endl;
}
int main() {
solve();
return 0;
}
| a.cc: In function 'void solve()':
a.cc:27:9: error: 'memset' was not declared in this scope
27 | memset(dp,0,sizeof(dp));
| ^~~~~~
a.cc:10:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
9 | #include <queue>
+++ |+#include <cstring>
10 |
|
s767989463 | p03830 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
bool PRIME(&x){
for(ll i=2;i*i<=x;i++)if(x%i==0)return 0;
return 1;
}
signed main(){
ll N,i,ans=1,mod=1000000007;cin>>N;
FOR(i,2,N+1)if(PRIME(i)){
ll R=i,COUNT=0;
while(R<=N){
COUNT+=N/R;
R*=i;
}
ans*=COUNT+1;ans%mod;
}
cout<<ans<<endl;
return 0;
} | a.cc:10:13: error: 'x' was not declared in this scope
10 | bool PRIME(&x){
| ^
a.cc: In function 'int main()':
a.cc:16:23: error: 'PRIME' cannot be used as a function
16 | FOR(i,2,N+1)if(PRIME(i)){
| ~~~~~^~~
|
s309189150 | p03830 | C++ | 1000 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1000
| ^~~~
|
s412233295 | p03830 | C++ | #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);
//pairの入力
//vector<pair<ll, ll>>work(n);
//rep(i, n) {
// ll a, b;
// cin >> a >> b;
// work[i] = make_pair(a, b);
//for(auto p:mp)(mapの探索)
//printf("%.10f\n",なんちゃら)
int g[15][15];
const int INF = 1001001001;
const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,-1,0,1 };
//最大公約数
ll gcd(ll x, ll y) {
return y ? gcd(y, x % y) : x;
}
ll lcm(ll x, ll y) {
if (x == 0 || y == 0)return 0;
return (x / gcd(x, y) * y);
}
//素因数分解
map<int, int>ins;
void facterize(ll n) {
ll a = 2;
while (n >= a * a) {
if (n % a == 0) {
ins[a]++;
n /= a;
}
else {
a++;
}
}
ins[n]++;
}
vector<ll>relation[20], money(20, 1);
int main() {
int n;
cin >> n;
ll ans = 1;
for (int i = 2;i <= n;++i) {
facterize(i);
}
for (auto p : ins) {
ll x = p.second % (1e9 + 7);
ans *= (x + 1);
ans = ans % (1e9 + 7);
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:64:33: error: invalid operands of types 'int' and 'double' to binary 'operator%'
64 | ll x = p.second % (1e9 + 7);
| ~~~~~~~~ ^ ~~~~~~~~~
| | |
| int double
a.cc:66:27: error: invalid operands of types 'll' {aka 'long long int'} and 'double' to binary 'operator%'
66 | ans = ans % (1e9 + 7);
| ~~~ ^ ~~~~~~~~~
| | |
| | double
| ll {aka long long int}
|
s973350173 | p03830 | C++ | from math import log
N=int(input())
lp=[1 for i in range(N+1)]#ind=suuzi
for i in range(2,N+1):
if lp[i]==1:
for j in range(2*i,N+1,i):
lp[j]=0
ans=1
MOD=10**9+7
for i in range(2,N+1):
if lp[i]==1:
count=0
for j in range(int(log(N,i))):
count=(count+N//(i**(j+1))%MOD)%MOD
ans=ans*(count+1)%MOD
print(ans)
| a.cc:3:27: error: stray '#' in program
3 | lp=[1 for i in range(N+1)]#ind=suuzi
| ^
a.cc:1:1: error: 'from' does not name a type
1 | from math import log
| ^~~~
|
s147829527 | p03830 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
#define rrep(i, n) for(int i = n-1; i >= 0; --i)
#define fi first
#define se second
using namespace std;
using lint = long long;
using uint = unsigned int;
using ulint = unsigned long long;
using ldouble = long double;
using pii = pair<int, int>;
using pli = pair<lint, lint>;
using pdd = pair<double, double>;
using pld = pair<ldouble, ldouble>;
using v1i = vector<int>;
using v1li = vector<lint>;
using v2i = vector<vector<int>>;
using v2li = vector<vector<lint>>;
using v3i = vector<vector<vector<int>>>;
using v3li = vector<vector<vector<lint>>>;
using v1b = vector<bool>;
using v2b = vector<vector<bool>>;
using v3b = vector<vector<vector<bool>>>;
using v1c = vector<char>;
using v2c = vector<vector<char>>;
using v3c = vector<vector<vector<char>>>;
constexpr lint mod1 = 1e9+7;
constexpr lint mod2 = 998244353;
int main() {
lint n, a = 1;
cin >> n;
map<int, int> m;
rep(i, n){
if(i == 0) continue;
else if(i == 1 || i == 2) m[i+1] = 1;
else{
int a = i+1;
for(int j = 2; j <= pow(i+1, 0.5); ++j){
int b = 0;
while(a % j == 0){
a /= j;
++b;
}
if(b != 0) m[j] += b;
if(a == 1) break;
}
if(a != 1 && !m.count(a)) m[a] = 1;
}
}
for(auto: m){
int c = m.fi, d = m.se;
rep(i, d){
a *= c;
a %= mod1;
}
}
cout << a << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:51:11: error: expected unqualified-id before ':' token
51 | for(auto: m){
| ^
a.cc:4:12: error: 'class std::map<int, int>' has no member named 'first'
4 | #define fi first
| ^~~~~
a.cc:52:15: note: in expansion of macro 'fi'
52 | int c = m.fi, d = m.se;
| ^~
a.cc:53:12: error: 'd' was not declared in this scope
53 | rep(i, d){
| ^
a.cc:2:38: note: in definition of macro 'rep'
2 | #define rep(i, n) for(int i = 0; i < n; ++i)
| ^
|
s473369281 | p03830 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
#define rrep(i, n) for(int i = n-1; i >= 0; --i)
#define fi first
#define se second
using namespace std;
using lint = long long;
using uint = unsigned int;
using ulint = unsigned long long;
using ldouble = long double;
using pii = pair<int, int>;
using pli = pair<lint, lint>;
using pdd = pair<double, double>;
using pld = pair<ldouble, ldouble>;
using v1i = vector<int>;
using v1li = vector<lint>;
using v2i = vector<vector<int>>;
using v2li = vector<vector<lint>>;
using v3i = vector<vector<vector<int>>>;
using v3li = vector<vector<vector<lint>>>;
using v1b = vector<bool>;
using v2b = vector<vector<bool>>;
using v3b = vector<vector<vector<bool>>>;
using v1c = vector<char>;
using v2c = vector<vector<char>>;
using v3c = vector<vector<vector<char>>>;
constexpr lint mod1 = 1e9+7;
constexpr lint mod2 = 998244353;
int main() {
int n, a = 1;
cin >> n;
map<int> m;
rep(i, n){
if(i == 0) continue;
else if(i == 1 || i == 2) m[i+1] = 1;
else{
int a = i+1;
for(int j = 2; j <= pow(i+1, 0.5); ++j){
int b = 0;
while(a % j == 0){
a /= j;
++b;
}
if(b != 0) m[j] += b;
if(a == 1) break;
}
if(a != 1 && !m.count(a)) m[a] = 1;
}
}
for(auto: m){
int c = m.fi, d = m.se;
rep(i, d){
a *= c;
a %= mod1;
}
}
cout << a << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:33:10: error: wrong number of template arguments (1, should be at least 2)
33 | map<int> m;
| ^
In file included from /usr/include/c++/14/map:63,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
102 | class map
| ^~~
a.cc:36:32: error: invalid types 'int[int]' for array subscript
36 | else if(i == 1 || i == 2) m[i+1] = 1;
| ^
a.cc:45:21: error: invalid types 'int[int]' for array subscript
45 | if(b != 0) m[j] += b;
| ^
a.cc:48:23: error: request for member 'count' in 'm', which is of non-class type 'int'
48 | if(a != 1 && !m.count(a)) m[a] = 1;
| ^~~~~
a.cc:48:34: error: invalid types 'int[int]' for array subscript
48 | if(a != 1 && !m.count(a)) m[a] = 1;
| ^
a.cc:51:11: error: expected unqualified-id before ':' token
51 | for(auto: m){
| ^
a.cc:4:12: error: request for member 'first' in 'm', which is of non-class type 'int'
4 | #define fi first
| ^~~~~
a.cc:52:15: note: in expansion of macro 'fi'
52 | int c = m.fi, d = m.se;
| ^~
a.cc:53:12: error: 'd' was not declared in this scope
53 | rep(i, d){
| ^
a.cc:2:38: note: in definition of macro 'rep'
2 | #define rep(i, n) for(int i = 0; i < n; ++i)
| ^
|
s612502752 | p03830 | C++ | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
/*#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") //Optimization flags
#pragma GCC option("arch=native","tune=native","no-zero-upper") //Enable AVX
#pragma GCC target("avx2") //Enable AVX*/
using namespace std;
using ll = long long;
#define mp make_pair
const int p = 1000000007;
int mul(int a, int b) {
return (1LL * a * b) % p;
}
int add(int a, int b) {
int s = (a+b);
if (s>=p) s-=p;
return s;
}
int sub(int a, int b) {
int s = (a+p-b);
if (s>=p) s-=p;
return s;
}
int po(int a, int deg)
{
if (deg==0) return 1;
if (deg%2==1) return mul(a, po(a, deg-1));
int t = po(a, deg/2);
return mul(t, t);
}
int inv(int n)
{
return po(n, p-2);
}
/*struct DSU {
vector<int> sz;
vector<int> parent;
void make_set(int v) {
parent[v] = v;
sz[v] = 1;
}
int find_set(int v) {
if (v == parent[v])
return v;
return parent[v] = find_set(parent[v]);
}
void union_sets(int a, int b) {
a = find_set(a);
b = find_set(b);
if (a != b) {
if (sz[a] < sz[b])
swap(a, b);
parent[b] = a;
sz[a] += sz[b];
}
}
DSU(int n) {
sz.resize(n);
parent.resize(n);
for (int i = 0; i < n; i++) make_set(i);
}
};*/
/*const int N = 1000000;
vector<int> facs(N), invfacs(N);
void init()
{
facs[0] = 1;
for (int i = 1; i<N; i++) facs[i] = mul(facs[i-1], i);
invfacs[N-1] = inv(facs[N-1]);
for (int i = N-2; i>=0; i--) invfacs[i] = mul(invfacs[i+1], i+1);
}
int C(int n, int k)
{
return mul(facs[n], mul(invfacs[k], invfacs[n-k]));
}*/
int main() {
ios_base::sync_with_stdio(0);
cin.tie(nullptr);
int n;
cin>>n;
vector<int> a(n+1);
for (int i = 1; i<=n; i++)
{
int i1 = i;
for (int c = 2; c*c<=n; c++) if (i1%c==0)
{
while (i1%c==0)
{
i1/=c; a[c]++;
}
}
if (i1>1) a[i1]++;
}
int res = 1;
/*for (int i = 0; i<=n; i++) cout<<a[i]<<' ';
cout<<endl;*/
for (int i = 1; i<=n; i++) res = mul(res, a[i]+1);
cout<<res;
}#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
/*#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") //Optimization flags
#pragma GCC option("arch=native","tune=native","no-zero-upper") //Enable AVX
#pragma GCC target("avx2") //Enable AVX*/
using namespace std;
using ll = long long;
#define mp make_pair
const int p = 1000000007;
int mul(int a, int b) {
return (1LL * a * b) % p;
}
int add(int a, int b) {
int s = (a+b);
if (s>=p) s-=p;
return s;
}
int sub(int a, int b) {
int s = (a+p-b);
if (s>=p) s-=p;
return s;
}
int po(int a, int deg)
{
if (deg==0) return 1;
if (deg%2==1) return mul(a, po(a, deg-1));
int t = po(a, deg/2);
return mul(t, t);
}
int inv(int n)
{
return po(n, p-2);
}
/*struct DSU {
vector<int> sz;
vector<int> parent;
void make_set(int v) {
parent[v] = v;
sz[v] = 1;
}
int find_set(int v) {
if (v == parent[v])
return v;
return parent[v] = find_set(parent[v]);
}
void union_sets(int a, int b) {
a = find_set(a);
b = find_set(b);
if (a != b) {
if (sz[a] < sz[b])
swap(a, b);
parent[b] = a;
sz[a] += sz[b];
}
}
DSU(int n) {
sz.resize(n);
parent.resize(n);
for (int i = 0; i < n; i++) make_set(i);
}
};*/
/*const int N = 1000000;
vector<int> facs(N), invfacs(N);
void init()
{
facs[0] = 1;
for (int i = 1; i<N; i++) facs[i] = mul(facs[i-1], i);
invfacs[N-1] = inv(facs[N-1]);
for (int i = N-2; i>=0; i--) invfacs[i] = mul(invfacs[i+1], i+1);
}
int C(int n, int k)
{
return mul(facs[n], mul(invfacs[k], invfacs[n-k]));
}*/
int main() {
ios_base::sync_with_stdio(0);
cin.tie(nullptr);
int n;
cin>>n;
vector<int> a(n+1);
for (int i = 1; i<=n; i++)
{
int i1 = i;
for (int c = 2; c*c<=n; c++) if (i1%c==0)
{
while (i1%c==0)
{
i1/=c; a[c]++;
}
}
if (i1>1) a[i1]++;
}
int res = 1;
/*for (int i = 0; i<=n; i++) cout<<a[i]<<' ';
cout<<endl;*/
for (int i = 1; i<=n; i++) res = mul(res, a[i]+1);
cout<<res;
} | a.cc:127:2: error: stray '#' in program
127 | }#define _CRT_SECURE_NO_WARNINGS
| ^
a.cc:127:3: error: 'define' does not name a type
127 | }#define _CRT_SECURE_NO_WARNINGS
| ^~~~~~
a.cc:142:11: error: redefinition of 'const int p'
142 | const int p = 1000000007;
| ^
a.cc:16:11: note: 'const int p' previously defined here
16 | const int p = 1000000007;
| ^
a.cc:145:5: error: redefinition of 'int mul(int, int)'
145 | int mul(int a, int b) {
| ^~~
a.cc:19:5: note: 'int mul(int, int)' previously defined here
19 | int mul(int a, int b) {
| ^~~
a.cc:149:5: error: redefinition of 'int add(int, int)'
149 | int add(int a, int b) {
| ^~~
a.cc:23:5: note: 'int add(int, int)' previously defined here
23 | int add(int a, int b) {
| ^~~
a.cc:155:5: error: redefinition of 'int sub(int, int)'
155 | int sub(int a, int b) {
| ^~~
a.cc:29:5: note: 'int sub(int, int)' previously defined here
29 | int sub(int a, int b) {
| ^~~
a.cc:161:5: error: redefinition of 'int po(int, int)'
161 | int po(int a, int deg)
| ^~
a.cc:35:5: note: 'int po(int, int)' previously defined here
35 | int po(int a, int deg)
| ^~
a.cc:169:5: error: redefinition of 'int inv(int)'
169 | int inv(int n)
| ^~~
a.cc:43:5: note: 'int inv(int)' previously defined here
43 | int inv(int n)
| ^~~
a.cc:225:5: error: redefinition of 'int main()'
225 | int main() {
| ^~~~
a.cc:99:5: note: 'int main()' previously defined here
99 | int main() {
| ^~~~
|
s702778873 | p03830 | C++ | #include <iostream>
#include <iomanip>
#include <algorithm>
using namespace std;
#include <cstdio>
#include <tuple>
#include <string>
#include <vector>
#include <set>
#include <string.h>
#include <map>
#include <cmath>
#include <deque>
using ll = long long;
using Graph = vector<vector<int>>;
#include <queue>
#include <stack>
const int num = 1007;
bitset<num> is_prime;//
//素因数たちの集合
void create_prime_number(int n){
for(int i=0;i <= n;i++) is_prime.set(i);//全てON
for(int i=0;i <= n;i++){
for(int j = i * 2;j <= n;j += i){
if(is_prime[j]){//onなら0にする
is_prime.reset(j);
}
}
}
}
int main(){
const int MOD = 1000000007;
int n;
cin >> n;
vector<ll> numOfDivisor(n + 1,0);
for(int i = 1;i <= n;i++){
ll cur = (ll)i;
for(int j=2;j <= i;j++){
while(cur % j == 0){
cur /= j;
numOfDivisor[j]++;//i以下の約数を数える
}
}
}
ll ans =1;
//剰余演算の合成
for(int i=1;i <=n;i++){
if(numOfDivisor[i] > 0LL)ans = (ans * (numOfDivisor[i] + 1LL)) % MOD;
}
cout << ans << endl;
return 0;
} | a.cc:21:1: error: 'bitset' does not name a type
21 | bitset<num> is_prime;//
| ^~~~~~
a.cc: In function 'void create_prime_number(int)':
a.cc:25:29: error: 'is_prime' was not declared in this scope
25 | for(int i=0;i <= n;i++) is_prime.set(i);//全てON
| ^~~~~~~~
a.cc:28:16: error: 'is_prime' was not declared in this scope
28 | if(is_prime[j]){//onなら0にする
| ^~~~~~~~
|
s988385118 | p03830 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll ans;
ll A[1010];
ll N;
int main(){
cin>>N;
for (int i=2;i<=N;++i){
ll t = i;
for (int j=2;j<=i;++j){
ll c = 0;
while (t%j == 0){
++c;
t /= j;
}
A[j] += c;
}
}
ans = 1;
for (int i=1;i<=N;++i)ans = (ans * (A[i]+1) % MOD);
cout<<ans;
} | a.cc: In function 'int main()':
a.cc:22:55: error: 'MOD' was not declared in this scope
22 | for (int i=1;i<=N;++i)ans = (ans * (A[i]+1) % MOD);
| ^~~
|
s019575463 | p03830 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<long long> VLL;
typedef vector<pair<int,int>> VP;
#define INF (int)(1e9)
#define MAXX 1.1529215e+18
#define inf 999999
#define EPS (1e-7)
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define REP(i,n) for(int i=1;i<=(int)(n);i++)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.begin(),a.end(),greater<int>()
#define ROT(a) a.begin(),a.begin()+1,a.end()
#define RROT(a) a.begin(),a.end()-1,a.end()
#define PB push_back
#define MP make_pair
#define PI acos(-1.0)
#define sz(a) a.size()
const ll MOD = 1e9+7;
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }
//cout << 'H' << endl;
/*--------------------------------------------*/
int N;
vector< bool > prime_table(int n) {
vector< bool > prime(n + 1, true);
if(n >= 0) prime[0] = false;
if(n >= 1) prime[1] = false;
for(int i = 2; i * i <= n; i++) {
if(!prime[i]) continue;
for(int j = i + i; j <= n; j += i) {
prime[j] = false;
}
}
return prime;
}
int main(){
//cout.precision(10);
cin.tie(0);
ios::sync_with_stdio(false);
cin >> N;
if(N == 1){
cout << 1 << endl;
return 0;
}
auto vec = prime_table(N);
int ans = 1;
rep(i,sz(vec)){
int tmp = 0;
if(vec[i]){
while(j <= N){
tmp += (N/j);
j *= j;
}
ans *= (tmp + 1);
}
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:62:13: error: 'j' was not declared in this scope
62 | while(j <= N){
| ^
|
s613278777 | p03830 | C++ | using namespace std;
int main()
{
long long N,s=1;
long long j=0;
long long i;
cin>>N;
for( i=1;i<=N;i++)
{
s*=i;
}
for( i=1;i<=s;i++)
{
if(s%i==0)
j++;
}
cout<<j;
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope
8 | cin>>N;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:18:5: error: 'cout' was not declared in this scope
18 | cout<<j;
| ^~~~
a.cc:18:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
|
s383698281 | p03830 | C++ | #include <iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
int ant = 1;
cin >> n;
vector<int> abcd(n + 1,0);
int num = 1;
for(int i=1;i<=n;i++){
num *=n;
}
for (int i = 2; i <= n; i++) {
while (num%i == 0) {
abcd.at(i)++;
num /= i;
}
}
for (int i = 2; i <= n; i++)
{
ant *= abcd.at(i) + 1;
ant %= 1000000007;
}
cout << ant << endl;
return 0;
}
| a.cc:23:38: error: extended character is not valid in an identifier
23 | abcd.at(i)++;
| ^
a.cc: In function 'int main()':
a.cc:23:38: error: '\U00003000' was not declared in this scope
23 | abcd.at(i)++;
| ^~
|
s484848987 | p03830 | C++ | #include <iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
int ant = 1;
cin >> n;
vector<int> abcd(n + 1);
int num = 1;
for(int i=1;i<=n;i++){
num *=n;
}
for (int i = 2; i <= n; i++) {
while (num%i == 0) {
abcd.at(i)++;
num /= i;
}
}
for (int i = 2; i <= n; i++)
{
ant *= abcd.at(i) + 1;
}
cout << ant << endl;
return 0;
}
| a.cc:23:38: error: extended character is not valid in an identifier
23 | abcd.at(i)++;
| ^
a.cc:30:39: error: extended character is not valid in an identifier
30 | ant *= abcd.at(i) + 1;
| ^
a.cc: In function 'int main()':
a.cc:23:38: error: '\U00003000' was not declared in this scope
23 | abcd.at(i)++;
| ^~
a.cc:30:39: error: '\U00003000' was not declared in this scope
30 | ant *= abcd.at(i) + 1;
| ^~
|
s385039017 | p03830 | C++ | #include <iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
int ans = 1;
cin >> n;
vector<int> abcd(n + 1);
int num = 1;
for(int i=1;i<=n;i++){
num *=n;
}
for (int i = 2; i <= n; i++) {
while (num%i == 0) {
x.at(i)++;
num /= i;
}
}
for (int i = 2; i <= n; i++)
{
ant *= x.at(i) + 1;
}
cout << ant << endl;
return 0;
}
| a.cc:22:35: error: extended character is not valid in an identifier
22 | x.at(i)++;
| ^
a.cc:29:36: error: extended character is not valid in an identifier
29 | ant *= x.at(i) + 1;
| ^
a.cc: In function 'int main()':
a.cc:22:25: error: 'x' was not declared in this scope
22 | x.at(i)++;
| ^
a.cc:22:35: error: '\U00003000' was not declared in this scope
22 | x.at(i)++;
| ^~
a.cc:29:17: error: 'ant' was not declared in this scope; did you mean 'ans'?
29 | ant *= x.at(i) + 1;
| ^~~
| ans
a.cc:29:24: error: 'x' was not declared in this scope
29 | ant *= x.at(i) + 1;
| ^
a.cc:29:36: error: '\U00003000' was not declared in this scope
29 | ant *= x.at(i) + 1;
| ^~
a.cc:31:17: error: 'ant' was not declared in this scope; did you mean 'ans'?
31 | cout << ant << endl;
| ^~~
| ans
|
s797710938 | p03830 | C++ | #include <iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
int ans = 1;
cin >> n;
vector<int> x(n + 1);
int num = 1;
for(int i=1;i<=n;i++){
num *=n;
}
for (int i = 2; i <= n; i++) {
while (num%i == 0) {
x.at(i)++;
num /= i;
}
}
for (int i = 2; i <= n; i++)
{
ans *= x.at(i) + 1;
}
cout << ans << endl;
return 0;
}
| a.cc:22:35: error: extended character is not valid in an identifier
22 | x.at(i)++;
| ^
a.cc:29:36: error: extended character is not valid in an identifier
29 | ans *= x.at(i) + 1;
| ^
a.cc: In function 'int main()':
a.cc:22:35: error: '\U00003000' was not declared in this scope
22 | x.at(i)++;
| ^~
a.cc:29:36: error: '\U00003000' was not declared in this scope
29 | ans *= x.at(i) + 1;
| ^~
|
s682975115 | p03830 | C++ | #include<iostream>
#include <vector>
using namespace std;
int main()
{
int n;
int ans = 1;
cin >> n;
vector<int> x(n + 1);
int num = 1;
for(int i=1;i<=n;i++){
num *=n;
}
for (int i = 2; i <= n; i++) {
while (num%i == 0) {
x.at(i)++;
num /= i;
}
}
for (int i = 2; i <= n; i++)
{
ans *= x.at(i) + 1;
}
cout << ans << endl;
return 0;
} | a.cc:21:35: error: extended character is not valid in an identifier
21 | x.at(i)++;
| ^
a.cc:28:36: error: extended character is not valid in an identifier
28 | ans *= x.at(i) + 1;
| ^
a.cc: In function 'int main()':
a.cc:21:35: error: '\U00003000' was not declared in this scope
21 | x.at(i)++;
| ^~
a.cc:28:36: error: '\U00003000' was not declared in this scope
28 | ans *= x.at(i) + 1;
| ^~
|
s718165191 | p03830 | C++ | #include<iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
long long int a,ant=1;
long long int fab(int n){
int n,x[n];
int ans = 1;
cin >> n;
for(int i=0;i<n;i++){
x[i] = 1;
}
int num = n;
for (int i = 2; i <= n; i++) {
while (num%i == 0) {
x[i]++;
num /= i;
}
}
for (int i = 2; i <= n; i++)
{
ans *= x[i];
}
return ;
}
int main(){
cin >> a;
for(int i=1;i<=a;i++){
ant *= fab(i);
ant %=1e7;
}
cout << ant << endl;
}
| a.cc:22:32: error: extended character is not valid in an identifier
22 | x[i]++;
| ^
a.cc:29:29: error: extended character is not valid in an identifier
29 | ans *= x[i];
| ^
a.cc: In function 'long long int fab(int)':
a.cc:11:13: error: declaration of 'int n' shadows a parameter
11 | int n,x[n];
| ^
a.cc:10:23: note: 'int n' previously declared here
10 | long long int fab(int n){
| ~~~~^
a.cc:22:32: error: '\U00003000' was not declared in this scope
22 | x[i]++;
| ^~
a.cc:29:29: error: '\U00003000' was not declared in this scope
29 | ans *= x[i];
| ^~
a.cc:31:9: error: return-statement with no value, in function returning 'long long int' [-fpermissive]
31 | return ;
| ^~~~~~
a.cc: In function 'int main()':
a.cc:40:9: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
40 | ant %=1e7;
| ~~~~^~~~~
a.cc:40:9: note: in evaluation of 'operator%=(long long int, double)'
|
s649240068 | p03830 | C++ | #include<iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
long long int a,ant=1;
long long int fab(int n){
int n;
int ans = 1;
cin >> n;
vector<int> x(n + 1);
int num = n;
for (int i = 2; i <= n; i++) {
while (num%i == 0) {
x.at(i)++;
num /= i;
}
}
for (int i = 2; i <= n; i++)
{
ans *= x.at(i) + 1;
}
return ;
}
int main(){
cin >> a;
for(int i=1;i<=a;i++){
ant *= fab(i);
ant %=1e7;
}
cout << ant << endl;
}
| a.cc:19:35: error: extended character is not valid in an identifier
19 | x.at(i)++;
| ^
a.cc:26:36: error: extended character is not valid in an identifier
26 | ans *= x.at(i) + 1;
| ^
a.cc: In function 'long long int fab(int)':
a.cc:11:13: error: declaration of 'int n' shadows a parameter
11 | int n;
| ^
a.cc:10:23: note: 'int n' previously declared here
10 | long long int fab(int n){
| ~~~~^
a.cc:19:35: error: '\U00003000' was not declared in this scope
19 | x.at(i)++;
| ^~
a.cc:26:36: error: '\U00003000' was not declared in this scope
26 | ans *= x.at(i) + 1;
| ^~
a.cc:28:9: error: return-statement with no value, in function returning 'long long int' [-fpermissive]
28 | return ;
| ^~~~~~
a.cc: In function 'int main()':
a.cc:37:9: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
37 | ant %=1e7;
| ~~~~^~~~~
a.cc:37:9: note: in evaluation of 'operator%=(long long int, double)'
|
s347806086 | p03830 | C++ | #include<iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
long long int a,ant=1;
long long int dfs(n)
{
int n;
int ans = 1;
cin >> n;
vector<int> x(n + 1);
int num = n;
for (int i = 2; i <= n; i++) {
while (num%i == 0) {
x.at(i)++;
num /= i;
}
}
for (int i = 2; i <= n; i++)
{
ans *= x.at(i) + 1;
}
return ;
}
int main(){
cin >> a;
for(int i=1;i<=a;i++){
ant *= dfs(i);
ant %=1e7;
}
cout << ant << endl;
}
| a.cc:20:35: error: extended character is not valid in an identifier
20 | x.at(i)++;
| ^
a.cc:27:36: error: extended character is not valid in an identifier
27 | ans *= x.at(i) + 1;
| ^
a.cc:10:19: error: 'n' was not declared in this scope; did you mean 'yn'?
10 | long long int dfs(n)
| ^
| yn
a.cc: In function 'int main()':
a.cc:37:14: error: 'dfs' cannot be used as a function
37 | ant *= dfs(i);
| ~~~^~~
a.cc:38:9: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
38 | ant %=1e7;
| ~~~~^~~~~
a.cc:38:9: note: in evaluation of 'operator%=(long long int, double)'
|
s627689630 | p03830 | C++ | #include<iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
long long int n,ant=1;
long long int dfs(n)
{
int n;
int ans = 1;
cin >> n;
vector<int> x(n + 1);
int num = n;
for (int i = 2; i <= n; i++) {
while (num%i == 0) {
x.at(i)++;
num /= i;
}
}
for (int i = 2; i <= n; i++)
{
ans *= x.at(i) + 1;
}
return ;
}
int main(){
cin >> n;
for(int i=1;i<=n;i++){
ant *= dfs(i);
ant %=1e7;
}
cout << ant << endl;
}
| a.cc:20:35: error: extended character is not valid in an identifier
20 | x.at(i)++;
| ^
a.cc:27:36: error: extended character is not valid in an identifier
27 | ans *= x.at(i) + 1;
| ^
a.cc:11:1: error: expected ',' or ';' before '{' token
11 | {
| ^
a.cc: In function 'int main()':
a.cc:37:14: error: 'dfs' cannot be used as a function
37 | ant *= dfs(i);
| ~~~^~~
a.cc:38:9: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
38 | ant %=1e7;
| ~~~~^~~~~
a.cc:38:9: note: in evaluation of 'operator%=(long long int, double)'
|
s103340613 | p03830 | C++ | #include<iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
long long int n;
long long int dfs(n)
{
int n;
int ans = 1;
cin >> n;
vector<int> x(n + 1);
int num = n;
for (int i = 2; i <= n; i++) {
while (num%i == 0) {
x.at(i)++;
num /= i;
}
}
for (int i = 2; i <= n; i++)
{
ans *= x.at(i) + 1;
}
return ans;
}
int main(){
cin >> n;
for(int i=1;i<=n;i++){
ans *= dfs(i);
ans %=1e7;
}
cout << ans << endl;
}
| a.cc:20:35: error: extended character is not valid in an identifier
20 | x.at(i)++;
| ^
a.cc:27:36: error: extended character is not valid in an identifier
27 | ans *= x.at(i) + 1;
| ^
a.cc:11:1: error: expected ',' or ';' before '{' token
11 | {
| ^
a.cc: In function 'int main()':
a.cc:37:4: error: 'ans' was not declared in this scope; did you mean 'abs'?
37 | ans *= dfs(i);
| ^~~
| abs
a.cc:37:14: error: 'dfs' cannot be used as a function
37 | ans *= dfs(i);
| ~~~^~~
a.cc:41:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
41 | cout << ans << endl;
| ^~~
| abs
|
s708058824 | p03830 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pp() pop_back()
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
#define yuko(a) setprecision(a)
#define uni(a) a.erase(unique(a.begin(),a.end()),a.end())
#define pri priority_queue
#define syo <int,V<int>
//#define min min<int>
//#define max max<int>
template<class T>
void cou(vector<vector<T>> a){
int b=a.size();
int c=a[0].size();
fo(i,b){
fo(j,c){
cout<<a[i][j];
if(j==c-1)
cout<<endl;
else
cout<<' ';
}
}
}
/*template<>
void cou(vector<vector<char>> a){
int b=a.size();
int c=a[0].size();
fo(i,b){
fo(j,c){
cout<<a[i][j];
if(j==c-1)
cout<<endl;
else
cout<<' ';
}
}
}*/
int wari(int a,int b) {
if(a%b==0)
return a/b;
else
return a/b+1;
}
int keta(int a){
double b=a;
b=log10(b);
int c=b;
return c+1;
}
int souwa(int a){
return a*(a+1)/2;
}
/*int lcm(int a,int b){
int d=a,e=b,f;
if(a<b)
swap(a,b);
int c,m=1;
while(m){
c=a%b;
if(c==0){
f=b;
m--;
}
else{
a=b;
b=c;
}
}
return d*e/f;
}
*/ int gcm(int a,int b){
int d=a,e=b,f;
if(a<b)
swap(a,b);
int c,m=1;
while(m){
c=a%b;
if(c==0){
f=b;
m--;
}
else{
a=b;
b=c;
}
}
return f;
}
bool prime(int a){
if(a<2)
return false;
else if(a==2)
return true;
else if(a%2==0)
return false;
double b=sqrt(a);
for(int i=3;i<=b;i+=2){
if(a%i==0){
return false;
}
}
return true;
}
struct Union{
vector<int> par;
Union(int a){
par= vector<int>(a,-1);
}
int find(int a){
if(par[a]<0)
return a;
else
return par[a]=find(par[a]);
}
bool same(int a,int b){
return find(a)==find(b);
}
int Size(int a){
return -par[find(a)];
}
void unite(int a,int b){
a=find(a);
b=find(b);
if(a==b)
return;
if(Size(b)>Size(a))
swap<int>(a,b);
par[a]+=par[b];
par[b]=a;
}
};
int ketas(int a){
string b=to_string(a);
int c=0;
fo(i,keta(a)){
c+=b[i]-'0';
}
return c;
}
/*int gcm(int a,int b){
if(b==0)
return a;
return gcm(b,a%b);
}*/
int lcm(int a,int b){
return a/gcm(a,b)*b;
}
/*struct aa{
vector<int> gt;
aa(int n){
gt= vector<int>(n, 1);
}
void c(V<int> d,int b){
if(d[b]==0){
gt[d[b]-1]++;
gt[gt.sz-1]++;
}
else{
gt[d[b]-1]++;
c(d,d[d[b]]-1);
}
}
void cok(int a){
cout<<gt[a-1]<<endl;
fo(i,a-1)
cout<<gt[i]<<endl;
}
};
*/
/*struct dfs(){
}*/
bool fe(int a,int b){
a%=10;
b%=10;
if(a==0)
a=10;
if(b==0)
b=10;
if(a>b)
return true;
else
return false;
}
int INF=1000000007;
struct edge{int s,t,d; };
signed main(){
int a;
cin>>a;
int b=1,c;
V<int> d,e;
fo(i,a){
if(prime(i+1)){
d.pb(i+1);
e.pb(0);
}
}
for(int i=2;i<=a;i++){
c=i;
while(c!=1){
fo(i,d.sz){
if(c%d[i]==0){
e[i]++;
c/=d[i];
break;
}
}
}
}
fo(i,d.sz){
b*=e[i]+1;
b%=INF;
}
cout<<e<<endl;
} | a.cc: In function 'int main()':
a.cc:231:7: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<long long int>')
231 | cout<<e<<endl;
| ~~~~^~~
| | |
| | std::vector<long long int>
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]'
306 | operator<<(nullptr_t)
| ^~~~~~~~
/usr/include/c++/14/ostr |
s009041028 | p03830 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pp() pop_back()
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
#define yuko(a) setprecision(a)
#define uni(a) a.erase(unique(a.begin(),a.end()),a.end())
#define pri priority_queue
#define syo <int,V<int>
//#define min min<int>
//#define max max<int>
template<class T>
void cou(vector<vector<T>> a){
int b=a.size();
int c=a[0].size();
fo(i,b){
fo(j,c){
cout<<a[i][j];
if(j==c-1)
cout<<endl;
else
cout<<' ';
}
}
}
/*template<>
void cou(vector<vector<char>> a){
int b=a.size();
int c=a[0].size();
fo(i,b){
fo(j,c){
cout<<a[i][j];
if(j==c-1)
cout<<endl;
else
cout<<' ';
}
}
}*/
int wari(int a,int b) {
if(a%b==0)
return a/b;
else
return a/b+1;
}
int keta(int a){
double b=a;
b=log10(b);
int c=b;
return c+1;
}
int souwa(int a){
return a*(a+1)/2;
}
/*int lcm(int a,int b){
int d=a,e=b,f;
if(a<b)
swap(a,b);
int c,m=1;
while(m){
c=a%b;
if(c==0){
f=b;
m--;
}
else{
a=b;
b=c;
}
}
return d*e/f;
}
*/ int gcm(int a,int b){
int d=a,e=b,f;
if(a<b)
swap(a,b);
int c,m=1;
while(m){
c=a%b;
if(c==0){
f=b;
m--;
}
else{
a=b;
b=c;
}
}
return f;
}
bool prime(int a){
if(a<2)
return false;
else if(a==2)
return true;
else if(a%2==0)
return false;
double b=sqrt(a);
for(int i=3;i<=b;i+=2){
if(a%i==0){
return false;
}
}
return true;
}
struct Union{
vector<int> par;
Union(int a){
par= vector<int>(a,-1);
}
int find(int a){
if(par[a]<0)
return a;
else
return par[a]=find(par[a]);
}
bool same(int a,int b){
return find(a)==find(b);
}
int Size(int a){
return -par[find(a)];
}
void unite(int a,int b){
a=find(a);
b=find(b);
if(a==b)
return;
if(Size(b)>Size(a))
swap<int>(a,b);
par[a]+=par[b];
par[b]=a;
}
};
int ketas(int a){
string b=to_string(a);
int c=0;
fo(i,keta(a)){
c+=b[i]-'0';
}
return c;
}
/*int gcm(int a,int b){
if(b==0)
return a;
return gcm(b,a%b);
}*/
int lcm(int a,int b){
return a/gcm(a,b)*b;
}
/*struct aa{
vector<int> gt;
aa(int n){
gt= vector<int>(n, 1);
}
void c(V<int> d,int b){
if(d[b]==0){
gt[d[b]-1]++;
gt[gt.sz-1]++;
}
else{
gt[d[b]-1]++;
c(d,d[d[b]]-1);
}
}
void cok(int a){
cout<<gt[a-1]<<endl;
fo(i,a-1)
cout<<gt[i]<<endl;
}
};
*/
/*struct dfs(){
}*/
bool fe(int a,int b){
a%=10;
b%=10;
if(a==0)
a=10;
if(b==0)
b=10;
if(a>b)
return true;
else
return false;
}
int INF=1000000007;
struct edge{int s,t,d; };
signed main(){
int a;
cin>>a;
int b=1,c;
V<int> d,e;
fo(i,a){
if(plime(i+1)){
d.pb(i+1);
e.pb(0);
}
}
for(int i=2;i<=a;i++){
c=i;
while(c!=1){
fo(i,d.sz){
if(c%d[i]==0){
e[i]++;
c/=d[i];
break;
}
}
}
}
fo(i,d.sz){
b*=e[i]+1;
b%=INF;
}
cout<<e<<endl;
} | a.cc: In function 'int main()':
a.cc:210:8: error: 'plime' was not declared in this scope; did you mean 'prime'?
210 | if(plime(i+1)){
| ^~~~~
| prime
a.cc:231:7: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<long long int>')
231 | cout<<e<<endl;
| ~~~~^~~
| | |
| | std::vector<long long int>
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<long long int>' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream |
s585319136 | p03830 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
using vec=vector<ll>;
using mat=vector<vec>;
#define For(i,a,b) for(i=a;i<b;i++)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define all(v) (v).begin(),(v).end()
#define vsort(v) sort(all(v))
#define mod 1000000007
using data=pair<ll,ll>;
long mmid(long a,long b,long c){return a<b?(b<c?b:max(a,c)):(b>c?b:min(a,c));}
ll modinv(ll a){ ll b=mod,u=1,v=0,t; while(b){ t=a/b; a-=t*b; swap(a,b); u-=t*v; swap(u,v); } return (u+mod)%mod; }
ll moddevide(ll a,ll b){return (a*modinv(b))%mod;}
ll modncr(ll n,ll r){ ll i,plus=1; rep(i,r){ plus=(plus*(n-i))%mod; plus=moddevide(plus,i+1); } return plus; }
ll euclidean_gcd(ll a, ll b) { if(a<b) return euclidean_gcd(b, a); ll r; while ((r=a%b)){a=b;b=r;} return b; }
ll countdigits(ll n){ ll ans=0; while(n){n/=10;ans++;} return ans; }
ll sumdigits(ll n){ ll ans=0; while(n){ans+=n%10;n/=10;} return ans; }
void printmap(vector<ll>& a,ll H,ll W){ ll i,j; For(i,0,H+2){ For(j,0,W+2){cout<<a[i*(W+2)+j];} cout<<endl; } } void inputmap(vector<ll>& a,ll H,ll W){ ll i,j; string ss; For(i,1,H+1){ cin>>ss; For(j,1,W+1){ if(ss[j-1]=='#'){ a[i*(W+2)+j]=1; }else{ a[i*(W+2)+j]=0; } } } }
int main(){
ll i,j,N,K,ans=1,cnt;
string ss;
cin>>N;
vec a(1000,1),plis,v(1001,0);
For(i,2,1000){
if(a[i]){
plis.push_back(a[i]);
for(j=2;i*j<1000;j++){
a[i*j]=0;
}
}
}
rep(i,(ll)plis.size()){
K=N;cnt=0;
while(K){
K/=plis[i];
cnt+=K
}
ans=(ans*(cnt+1))%mod;
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:38:13: error: expected ';' before '}' token
38 | cnt+=K
| ^
| ;
39 | }
| ~
|
s062075267 | p03830 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
using vec=vector<ll>;
using mat=vector<vec>;
#define For(i,a,b) for(i=a;i<b;i++)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define all(v) (v).begin(),(v).end()
#define vsort(v) sort(all(v))
#define mod 1000000007
using data=pair<ll,ll>;
long mmid(long a,long b,long c){return a<b?(b<c?b:max(a,c)):(b>c?b:min(a,c));}
ll modinv(ll a){ ll b=mod,u=1,v=0,t; while(b){ t=a/b; a-=t*b; swap(a,b); u-=t*v; swap(u,v); } return (u+mod)%mod; }
ll moddevide(ll a,ll b){return (a*modinv(b))%mod;}
ll modncr(ll n,ll r){ ll i,plus=1; rep(i,r){ plus=(plus*(n-i))%mod; plus=moddevide(plus,i+1); } return plus; }
ll euclidean_gcd(ll a, ll b) { if(a<b) return euclidean_gcd(b, a); ll r; while ((r=a%b)){a=b;b=r;} return b; }
ll countdigits(ll n){ ll ans=0; while(n){n/=10;ans++;} return ans; }
ll sumdigits(ll n){ ll ans=0; while(n){ans+=n%10;n/=10;} return ans; }
void printmap(vector<ll>& a,ll H,ll W){ ll i,j; For(i,0,H+2){ For(j,0,W+2){cout<<a[i*(W+2)+j];} cout<<endl; } } void inputmap(vector<ll>& a,ll H,ll W){ ll i,j; string ss; For(i,1,H+1){ cin>>ss; For(j,1,W+1){ if(ss[j-1]=='#'){ a[i*(W+2)+j]=1; }else{ a[i*(W+2)+j]=0; } } } }
int main(){
ll i,j,N,K,ans=1;
string ss;
cin>>N;
vec a(1000,1),plis,v(1001,0);
For(i,2,1000){
if(a[i]){
plist.push_back(a[i]);
for(j=2;i*j<=1000;j++){
a[i*j]=0;
}
}
}
rep1(i,N+1){
K=i;j=0;
while(K>1){
if(K%plis[j]==0){
K/=plis[j];
v[plis[j]]++;
}else{
j++;
}
}
}
rep(i,N+1){
ans=(ans*(v[i]+1))%mod;
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:28:7: error: 'plist' was not declared in this scope; did you mean 'plis'?
28 | plist.push_back(a[i]);
| ^~~~~
| plis
|
s172557925 | p03830 | C++ | #include <bits/stdc++.h>
using namespace::std;
int main(){
long n;
cin>>n;
long ans=1;
for(int i=2;i<n+1;i++){
bool f=0;
for(int j=2;j<i;j++)if(i%j==0)f=1;
if(!f)continue;
long tmp=0,tmp2=i;
while(tmp2<=n){
tmp+=n/tmp2;
tmp2*=i;
}
ans*=tmp;
ans%=pow(10,9)+7;
}
cout<<ans;
}
| a.cc: In function 'int main()':
a.cc:17:8: error: invalid operands of types 'long int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
17 | ans%=pow(10,9)+7;
| ~~~^~~~~~~~~~~~~
a.cc:17:8: note: in evaluation of 'operator%=(long int, __gnu_cxx::__promote<double>::__type {aka double})'
|
s656310311 | p03830 | C++ | #include<bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
typedef long long ll;
ll arr[1010];
//√1000は31ちょい
void factors(int x){
//xを素因数分解した結果をarrに保存
int c = (int) sqrt( (double) x);
for(int j = 2; j <= c; j++){
while( x % j == 0){ x /= j; arr[j]++;}}
if( x != 1){ arr[x]++;}
}
int main(){
int N; cin >> N;
for(int i = 2; i <= N; i++){
//iを素因数分解した結果をarrに保存
factors(i);}
ll res = 1;
for(int j = 0; j < arr.size(); j++){
res = res * (arr[j] + 1);
res %= MOD;}
cout << res << endl; return 0;}
| a.cc: In function 'int main()':
a.cc:29:26: error: request for member 'size' in 'arr', which is of non-class type 'll [1010]' {aka 'long long int [1010]'}
29 | for(int j = 0; j < arr.size(); j++){
| ^~~~
|
s665289372 | p03830 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int ans = 1;
cin >> n;
vector<int> vec(n + 1)={};
int num = n;
for (int i = 2; i <= n; i++) {
while (num%i == 0){
vec[i]++;
num /= i;
}
}
for (int i = 2; i <= n; i++){
ans *= vec[i] + 1;
ans=ans%1000000007;
}
cout << ans << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:25: error: expected ',' or ';' before '=' token
8 | vector<int> vec(n + 1)={};
| ^
|
s098870068 | p03830 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int ans = 1;
cin >> n;
vector<int> x(n + 1)={};
int num = n; // 素因数分解する変数num
for (int i = 2; i <= n; i++) {
while (num%i == 0) { // 素数で割り切れなくなるまで割っていく
x[i]++; //割った個数を配列に足す
num /= i;
}
for (int i = 2; i <= n; i++){
ans *= x[i] + 1; //それぞれを+1して掛けていく
ans=ans%1000000007;
}
cout << ans << endl;
return 0;
}
| a.cc:12:12: error: extended character is not valid in an identifier
12 | x[i]++; //割った個数を配列に足す
| ^
a.cc:16:21: error: extended character is not valid in an identifier
16 | ans *= x[i] + 1; //それぞれを+1して掛けていく
| ^
a.cc: In function 'int main()':
a.cc:8:23: error: expected ',' or ';' before '=' token
8 | vector<int> x(n + 1)={};
| ^
a.cc:12:12: error: '\U00003000' was not declared in this scope
12 | x[i]++; //割った個数を配列に足す
| ^~
a.cc:16:21: error: '\U00003000' was not declared in this scope
16 | ans *= x[i] + 1; //それぞれを+1して掛けていく
| ^~
a.cc:21:2: error: expected '}' at end of input
21 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s174742688 | p03830 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int ans = 1;
cin >> n;
vector<int> x(n + 1)={};
int num = n; // 素因数分解する変数num
for (int i = 2; i <= n; i++) {
while (num%i == 0) { // 素数で割り切れなくなるまで割っていく
x[i]++; //割った個数を配列に足す
num /= i;
}
}
for (int i = 2; i <= n; i++)
{
ans *= x[i] + 1; //それぞれを+1して掛けていく
ans=ans%1000000007
}
cout << ans << endl;
return 0;
}
| a.cc:14:32: error: extended character is not valid in an identifier
14 | x[i]++; //割った個数を配列に足す
| ^
a.cc:21:33: error: extended character is not valid in an identifier
21 | ans *= x[i] + 1; //それぞれを+1して掛けていく
| ^
a.cc: In function 'int main()':
a.cc:9:29: error: expected ',' or ';' before '=' token
9 | vector<int> x(n + 1)={};
| ^
a.cc:14:32: error: '\U00003000' was not declared in this scope
14 | x[i]++; //割った個数を配列に足す
| ^~
a.cc:21:33: error: '\U00003000' was not declared in this scope
21 | ans *= x[i] + 1; //それぞれを+1して掛けていく
| ^~
|
s429446235 | p03830 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int ans = 1;
cin >> n;
vector<int> x(n + 1);
int num = n; // 素因数分解する変数num
for (int i = 2; i <= n; i++) {
while (num%i == 0) { // 素数で割り切れなくなるまで割っていく
x[i]++; //割った個数を配列に足す
num /= i;
}
}
for (int i = 2; i <= n; i++)
{
ans *= x[i] + 1; //それぞれを+1して掛けていく
ans=ans%1000000007
}
cout << ans << endl;
return 0;
}
| a.cc:14:32: error: extended character is not valid in an identifier
14 | x[i]++; //割った個数を配列に足す
| ^
a.cc:21:33: error: extended character is not valid in an identifier
21 | ans *= x[i] + 1; //それぞれを+1して掛けていく
| ^
a.cc: In function 'int main()':
a.cc:14:32: error: '\U00003000' was not declared in this scope
14 | x[i]++; //割った個数を配列に足す
| ^~
a.cc:21:33: error: '\U00003000' was not declared in this scope
21 | ans *= x[i] + 1; //それぞれを+1して掛けていく
| ^~
|
s819710847 | p03830 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int ans = 1;
cin >> n;
vector<int> x(n + 1);
int num = n; // 素因数分解する変数num
for (int i = 2; i <= n; i++) {
while (num%i == 0) { // 素数で割り切れなくなるまで割っていく
x.at(i)++; //割った個数を配列に足す
num /= i;
}
}
for (int i = 2; i <= n; i++)
{
ans *= x.at(i) + 1; //それぞれを+1して掛けていく
ans=ans%1000000007
}
cout << ans << endl;
return 0;
} | a.cc:14:35: error: extended character is not valid in an identifier
14 | x.at(i)++; //割った個数を配列に足す
| ^
a.cc:21:36: error: extended character is not valid in an identifier
21 | ans *= x.at(i) + 1; //それぞれを+1して掛けていく
| ^
a.cc: In function 'int main()':
a.cc:14:35: error: '\U00003000' was not declared in this scope
14 | x.at(i)++; //割った個数を配列に足す
| ^~
a.cc:21:36: error: '\U00003000' was not declared in this scope
21 | ans *= x.at(i) + 1; //それぞれを+1して掛けていく
| ^~
|
s438657406 | p03830 | C++ | #include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
const int MOD=1e9+7;
int main() {
long long ans=1,n,i,j,k,cnt[1000];
cin >> n;
for(i=2; i<=n; i++) {
for(j=i,k=2; j>1) {
if(j%k==0) {
cnt[k]++;
j/=k;
}
else {
k++;
}
}
}
for(i=2; i<=n; i++) {
ans=ans*(cnt[i]+1)%MOD;
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:10:21: error: expected ';' before ')' token
10 | for(j=i,k=2; j>1) {
| ^
| ;
|
s247805800 | p03830 | C++ | #include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#define ll long long
using namespace std;
const int N=2e5+100;
const int mod=1e9+7;
bool judge(int x)
{
if(x<=1)
return 0;
else if(x==2)
return 1;
int up=sqrt(x);
for(int i=2; i<=up; i++)
if(x%i==0)
return 0;
return 1;
}
int prime[N];
int tot=0;
int cal(int n,int x)
{
//cout<<n<<" "<<x<<endl;
if(n<x)
return 0;
return (n/x+cal(n/x,x))%mod;
}
int main()
{
int n;
cin>>n
tot=0;
for(int i=1; i<=n; i++)
if(judge(i))
prime[++tot]=i;
ll ans=1;
for(int i=1; i<=tot; i++)
{
int x=prime[i];
ans=(ans*(ll)(cal(n,x)+1))%mod;
}
cout<<ans<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:34:11: error: expected ';' before 'tot'
34 | cin>>n
| ^
| ;
35 |
36 | tot=0;
| ~~~
|
s329785305 | p03830 | C++ | #include<bits/stdc++.h>
#define long long ll
using namespace std;
int main(){
ll n;
ll ans=1;
cin >>n;
for(ll i=2;i<=n;i++){
bool ok=true;
for(ll j=2;j<=pow(i,0.5);j++){
if(i%j==0)ok=false;
}
if(ok){
ll count=0;
for(ll j=2;j<=n;j++){
ll s=j;
while(s%i==0){
s/=i;
count++;
}
}
ans=ans*(count+1)%((ll)1E9+7);
}
cerr<<ans<<endl;
}
cout <<ans <<endl;
} | a.cc: In function 'int main()':
a.cc:5:3: error: 'll' was not declared in this scope
5 | ll n;
| ^~
a.cc:6:5: error: expected ';' before 'ans'
6 | ll ans=1;
| ^~~~
| ;
a.cc:7:9: error: 'n' was not declared in this scope; did you mean 'yn'?
7 | cin >>n;
| ^
| yn
a.cc:8:7: error: expected ';' before 'i'
8 | for(ll i=2;i<=n;i++){
| ^~
| ;
a.cc:8:12: error: 'i' was not declared in this scope
8 | for(ll i=2;i<=n;i++){
| ^
a.cc:10:9: error: expected ';' before 'j'
10 | for(ll j=2;j<=pow(i,0.5);j++){
| ^~
| ;
a.cc:10:14: error: 'j' was not declared in this scope; did you mean 'jn'?
10 | for(ll j=2;j<=pow(i,0.5);j++){
| ^
| jn
a.cc:14:7: error: expected ';' before 'count'
14 | ll count=0;
| ^~~~~~
| ;
a.cc:15:11: error: expected ';' before 'j'
15 | for(ll j=2;j<=n;j++){
| ^~
| ;
a.cc:15:16: error: 'j' was not declared in this scope; did you mean 'jn'?
15 | for(ll j=2;j<=n;j++){
| ^
| jn
a.cc:16:8: error: expected ';' before 's'
16 | ll s=j;
| ^~
| ;
a.cc:17:13: error: 's' was not declared in this scope
17 | while(s%i==0){
| ^
a.cc:19:12: error: no post-increment operator for type
19 | count++;
| ^~
a.cc:22:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
22 | ans=ans*(count+1)%((ll)1E9+7);
| ^~~
| abs
a.cc:22:19: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
22 | ans=ans*(count+1)%((ll)1E9+7);
| ~~~~~^~
a.cc:22:28: error: expected ')' before numeric constant
22 | ans=ans*(count+1)%((ll)1E9+7);
| ~ ^~~
| )
a.cc:24:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
24 | cerr<<ans<<endl;
| ^~~
| abs
a.cc:26:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
26 | cout <<ans <<endl;
| ^~~
| abs
|
s075879886 | p03830 | C++ | void Eratosthenes(){
for(int i = 0; i < N; i++){
arr[i] = 1;
}
for(int i = 2; i < sqrt(N); i++){
if(arr[i]){
for(int j = 0; i * (j + 2) < N; j++){
arr[i *(j + 2)] = 0;
}
}
}
for(int i = 2; i < N; i++){
if(arr[i]){
//cout << i << endl;
}
}
} | a.cc: In function 'void Eratosthenes()':
a.cc:2:28: error: 'N' was not declared in this scope
2 | for(int i = 0; i < N; i++){
| ^
a.cc:3:17: error: 'arr' was not declared in this scope
3 | arr[i] = 1;
| ^~~
a.cc:5:33: error: 'N' was not declared in this scope
5 | for(int i = 2; i < sqrt(N); i++){
| ^
a.cc:5:28: error: 'sqrt' was not declared in this scope
5 | for(int i = 2; i < sqrt(N); i++){
| ^~~~
a.cc:6:20: error: 'arr' was not declared in this scope
6 | if(arr[i]){
| ^~~
a.cc:13:28: error: 'N' was not declared in this scope
13 | for(int i = 2; i < N; i++){
| ^
a.cc:14:20: error: 'arr' was not declared in this scope
14 | if(arr[i]){
| ^~~
|
s523317400 | p03830 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
const ll MOD=1e9+7;
ll fct[20010];
ll ifct[20010];
ll MULT(int x, int y){
return (x*y)%MOD;
}
ll POW(int x, int n){
ll v=1;
while(n>1){
if(n%2==1)v=MULT(v, x);
x=MULT(x,x);
n/=2;
}
return v;
}
ll INV(int x){
return POW(x, MOD-2);
}
void FCT(){
fct[0]=1;
for (int i=0;i<20010;++i) fct[i+1]=MULT(fct[i],i+1);
}
void INV_FCT(){
ifct[20010-1]=INV(fct[20010-1]);
for (int i=20010-1;i>=1;--i) ifct[i-1]=ifct[i]*i;
}
ll comb(int n, int k){
return MULT(fct[n], MULT(ifct[k], ifct[n-k]));
}
int main(){
int N, A, B, C, D;cin>>N>>A>>B>>C>>D;
ll dp[1010][1010];memset(dp, 0, sizeof(dp));
FCT;INV_FCT;
dp[A-1][0]=1;
for(ll i=A;i<=B;++i){
for (int j=0;j<N+1;++j){
(dp[i][j]+=dp[i-1][j])%=MOD;
ll f=1;
if(C!=1){
for (int k=0;k<C-1;++k) f=MULT(f,comb(j-k*i,i));
}
for(ll k=C;k<=D;++k){
if(j+i*k>N) break;
f=MULT(f,comb(j+k*i,i));
(dp[i][j]+=MULT(dp[i-1][j-i*k],MULT(f,ifct[k]))%=MOD;
}
}
}
cout<<dp[B][N]<<endl;
} | a.cc: In function 'int main()':
a.cc:60:30: error: lvalue required as left operand of assignment
60 | (dp[i][j]+=MULT(dp[i-1][j-i*k],MULT(f,ifct[k]))%=MOD;
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:60:67: error: expected ')' before ';' token
60 | (dp[i][j]+=MULT(dp[i-1][j-i*k],MULT(f,ifct[k]))%=MOD;
| ~ ^
| )
|
s018144978 | p03830 | C++ | #include <vector>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <cstdlib>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i,n) for(int i=0;i<n;i++)
#define SORT(c) sort((c).begin(),(c).end())
#define ALL(a) (a).begin(),(a).end()
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
int num = n;
ll ans = 1;
vector<int> v(n+1);
while(num > 1){
int tmp = num;
for(int i = 2; i <= n; i++){
while(tmp % i == 0){
v.at(i)++;
tmp /= i;
}
}
num--;
}
for(int i = 2; i <= n; i++){
ans *= (v.at(i) + 1);
ans %= mod;
}
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:39:14: error: 'mod' was not declared in this scope; did you mean 'modf'?
39 | ans %= mod;
| ^~~
| modf
|
s845496542 | p03830 | C++ | #include<iostream>
#include <vector>
using namespace std;
int main()
{
int n;
int ans = 1;
cin >> n;
vector<int> x(n + 1);
int num = n; // 素因数分解する変数num
for (int i = 2; i <= n; i++) {
while (num%i == 0) { // 素数で割り切れなくなるまで割っていく
x.at(i)++; //割った個数を配列に足す
num /= i;
}
}
for (int i = 2; i <= n; i++)
{
ans *= x.at(i) + 1; //それぞれを+1して掛けていく
}
cout << ans << endl;
return 0;
} | a.cc:17:35: error: extended character is not valid in an identifier
17 | x.at(i)++; //割った個数を配列に足す
| ^
a.cc:24:36: error: extended character is not valid in an identifier
24 | ans *= x.at(i) + 1; //それぞれを+1して掛けていく
| ^
a.cc: In function 'int main()':
a.cc:17:35: error: '\U00003000' was not declared in this scope
17 | x.at(i)++; //割った個数を配列に足す
| ^~
a.cc:24:36: error: '\U00003000' was not declared in this scope
24 | ans *= x.at(i) + 1; //それぞれを+1して掛けていく
| ^~
|
s839322009 | p03830 | C++ | #include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
//deque/functional/iterator/list/map/memory/numeric/queue/set/stack/utility/vector
//#include<bits/stdc++.h>
#define ll long long
using namespace std;
int N = 1e5+10;
LL mod = 1e9+7;
int a[N];
int main() {
int n;
scanf("%lld",&n);
for(int i=2; i<=n; i++) {
int x=i;
for(int j=2; j<=x; j++) {
while(x%j==0) {
a[j]++;
x/=j;
}
}
if(x!=1) a[x]++;
}
LL ans=1;
for(int i=1; i<=n; i++) {
if(a[i]!=0) ans=(ans*(a[i]+1))%mod;
}
printf("%lld\n",ans);
return 0;
} | a.cc:13:1: error: 'LL' does not name a type; did you mean 'll'?
13 | LL mod = 1e9+7;
| ^~
| ll
a.cc:14:7: error: size of array 'a' is not an integral constant-expression
14 | int a[N];
| ^
a.cc: In function 'int main()':
a.cc:29:9: error: 'LL' was not declared in this scope; did you mean 'll'?
29 | LL ans=1;
| ^~
| ll
a.cc:31:29: error: 'ans' was not declared in this scope; did you mean 'abs'?
31 | if(a[i]!=0) ans=(ans*(a[i]+1))%mod;
| ^~~
| abs
a.cc:31:48: error: 'mod' was not declared in this scope; did you mean 'modf'?
31 | if(a[i]!=0) ans=(ans*(a[i]+1))%mod;
| ^~~
| modf
a.cc:33:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
33 | printf("%lld\n",ans);
| ^~~
| abs
|
s951134344 | p03830 | C++ | from math import factorial
n = factorial(int(input()))
cnt = 2
k = 1
ans = 1
while n != 1:
if n % cnt == 0:
n //= cnt
k = k + 1
else:
ans = ans * k
k = 1
cnt += 1
anw = (ans * k) % (10**9 + 7)
print(anw) | a.cc:1:1: error: 'from' does not name a type
1 | from math import factorial
| ^~~~
|
s315990289 | p03830 | C++ | import java.io.*;
import static java.lang.Math.*;
import static java.lang.Math.min;
import java.math.BigDecimal;
import java.util.*;
import static java.util.Arrays.*;
import java.util.stream.*;
/**
* @author baito
*/
@SuppressWarnings("unchecked")
public class Main {
static boolean DEBUG = true;
static StringBuilder sb = new StringBuilder();
static int INF = 1234567890;
static int MINF = -1234567890;
static long LINF = 123456789123456789L;
static long MLINF = -123456789123456789L;
static int MOD = (int) 1e9 + 7;
static double EPS = 1e-10;
static int[] y4 = {-1, 1, 0, 0};
static int[] x4 = {0, 0, -1, 1};
static int[] y8 = {0, 1, 0, -1, -1, 1, 1, -1};
static int[] x8 = {1, 0, -1, 0, 1, -1, 1, -1};
static int[] Fa;
static boolean[] isPrime;
static ArrayList<Integer> primes;
static char[][] S;
static long maxRes = Long.MIN_VALUE;
static long minRes = Long.MAX_VALUE;
static int N, A, B, C, D;
static int[][] dp;
static int[] fac,finv,inv;
static void setMod(){
fac = new int[(int)1e6+1000];
finv = new int[(int)1e6+1000];
inv = new int[(int)1e6+1000];
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for(int i = 2;i < 1e6+1000;i++){
fac[i] = fac[i - 1] * i % MOD;
inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
finv[i] = finv[i - 1] * inv[i] % MOD;
}
}
public static void solve() throws Exception {
//longを忘れるなオーバーフローするぞ
int N = ni();
int A = ni();
int B = ni();
int C = ni();
int D = ni();
setMod();
int[][]dp = new int[N+1][N+1];
dp[0][0] = 1;
for(int k = 1; k <= N; k++){
for(int n = 1; n <= N ; n++){
//k人が0のとき
dp[k][n] = dp[k-1][n];
if(!(A<=k &&k <= B))continue;
for(int x = C ; x <= D && n - k * x >= 0;x++){
//n人からk人をxグループ作りその他はk-1人以下
long cal = mMuls(fac[n],finv[n-k*x],mPow(finv[k],x),finv[x]);
cal = mm(cal,dp[k-1][n-k*x]);
dp[k][n] = ms(dp[k][n],cal);
}
}
}
System.out.println(dp[N][N]);
}
public static boolean calc(long va) {
//貪欲にギリギリセーフを選んでいく。
int v = (int) va;
return true;
}
//条件を満たす最大値、あるいは最小値を求める
static int mgr(long ok, long ng) {
//int ok = 0; //解が存在する
//int ng = N; //解が存在しない
while (Math.abs(ok - ng) > 1) {
long mid;
if (ok < 0 && ng > 0 || ok > 0 && ng < 0) mid = (ok + ng) / 2;
else mid = ok + (ng - ok) / 2;
if (calc(mid)) {
ok = mid;
} else {
ng = mid;
}
}
if (calc(ok)) return (int) ok;
else return -1;
}
static <T> void initStreamArray(ArrayList<T>[] a, int n) {
a = Stream.generate(ArrayList::new).limit(n).toArray(ArrayList[]::new);
}
//消す候補
static ArrayList<Integer> divisors(int n) {
ArrayList<Integer> res = new ArrayList<>();
for (int i = 1; i <= Math.sqrt(n); i++) {
if (n % i == 0) {
res.add(i);
if (i != n / i) res.add(n / i);
}
}
return res;
}
static ArrayList<Long> divisors(long n) {
ArrayList<Long> res = new ArrayList<>();
for (long i = 1; i <= Math.sqrt(n); i++) {
if (n % i == 0) {
res.add(i);
if (i != n / i) res.add(n / i);
}
}
return res;
}
static ArrayList<Integer> factorization(int n) {
if (primes == null) setPrimes();
ArrayList<Integer> fact = new ArrayList<>();
for (int p : primes) {
if (n % p == 0) fact.add(p);
while (n % p == 0) n /= p;
if (n == 1) break;
}
if (n != 1) fact.add(n);
return fact;
}
boolean equal(double a, double b) {
return a == 0 ? abs(b) < EPS : abs((a - b) / a) < EPS;
}
public static void chMax(long v) {
maxRes = Math.max(maxRes, v);
}
public static void chMin(long v) {
minRes = Math.min(minRes, v);
}
//便利系
//左端、右端の情報をもたせる。半開区間
public static void setLR(int[] a, ArrayList<Integer> l, ArrayList<Integer> r) {
for (int i = 0; i < a.length; i++) {
if (a[i] > 0) {
int j = i;
while (a[j] > 0) j++;
l.add(i);
r.add(j);
i = j - 1;
}
}
}
public static long[] rui(int[] a) {
long[] res = new long[a.length + 1];
for (int i = 0; i < a.length; i++) {
res[i + 1] = a[i];
}
for (int i = 0; i < a.length; i++) {
res[i + 1] += res[i];
}
return res;
}
//p[i].nowx := i番目に小さいvの値 p[i].nowy := その個数
//0個の物は除く
public static P[] mato(int[] a) {
CouMap map = new CouMap(a);
P[] res = new P[map.size()];
int i = 0;
for (Map.Entry<Long, Long> m : map.map.entrySet()) {
res[i++] = new P((int) (long) m.getKey(), (int) (long) m.getValue());
}
sort(res);
return res;
}
public static int[] imosu(int[] f, int[] t, int n) {
int[] imosu = new int[n + 1];
for (int i = 0; i < f.length; i++) {
imosu[f[i]]++;
imosu[t[i] + 1]--;
}
for (int i = 0; i < n; i++) {
imosu[i + 1] += imosu[i];
}
return imosu;
}
static int[] inverse(int[] a) {
int[] res = new int[a.length];
for (int i = 0; i < a.length; i++)
res[a[i]] = i;
return res;
}
public static String notE(double v) {
return BigDecimal.valueOf(v).toPlainString();
}
public static void print(char[][] a) {
for (int i = 0; i < a.length; i++) {
for (int j = 0; j < a[0].length; j++) {
System.out.print(a[i][j]);
}
System.out.println("");
}
}
public static void print(int[][] a) {
for (int i = 0; i < a.length; i++) {
for (int j = 0; j < a[0].length; j++) {
System.out.print(a[i][j] + " ");
}
System.out.println("");
}
}
public static <T> void print(ArrayList<T> a) {
for (T t : a) {
System.out.println(t);
}
}
public static void print(int[] a) {
for (int i = 0; i < a.length; i++)
System.out.println(a[i]);
}
public static void print(long[] a) {
for (int i = 0; i < a.length; i++)
System.out.println(a[i]);
}
//bit関連
public static boolean bget(BitSet bit, int keta) {
return bit.nextSetBit(keta) == keta;
}
public static boolean bget(long bit, int keta) {
return ((bit >> keta) & 1) == 1;
}
public static int bget3(long bit, int keta) {
bit /= (long) pow(3, keta);
return (int) (bit % 3);
}
public static int getHashA(long key) {
return (int) (key >> 32);
}
public static int getHashB(long key) {
return (int) (key & -1);
}
//正の数のみ
public static long getHashKey(int a, int b) {
return (long) a << 32 | b;
}
//数学関係--------------------------------
//a/bを返す
public static long ceil(long a, long b) {
return (a % b == 0) ? a / b : a / b + 1;
}
public static double sqrt(double v) {
return Math.sqrt(v);
}
public static long sqrt(long v) {
long res = (long) Math.sqrt(v);
while (res * res > v) res--;
return res;
}
static double[][] PER_DP;
static double ncrPer(int n, int r) {
if (n < r) return 0;
if (PER_DP == null) {
PER_DP = new double[5001][5001];
PER_DP[0][0] = 1;
for (int ni = 0; ni < PER_DP.length - 1; ni++) {
for (int ri = 0; ri < ni + 1; ri++) {
PER_DP[ni + 1][ri] += PER_DP[ni][ri] / 2;
PER_DP[ni + 1][ri + 1] += PER_DP[ni][ri] / 2;
}
}
}
return PER_DP[n][r];
}
public static int mod(long a, int m) {
return (int) ((a % m + m) % m);
}
static long mNcr(int n, int r) {
if (n < 0 || r < 0 || n < r) return 0;
long result = mm(Fa[n], finv[n - r]);
result = mm(result, finv[r]);
return result;
}
public static int ms(long a, long b) {
return (int) (((a % MOD + b % MOD) % MOD + MOD) % MOD);
}
public static int mDiff(long a, long b) {
return ms(a, -b);
}
public static int mm(long a, long b) {
return (int) (((a % MOD * b % MOD) % MOD + MOD) % MOD);
}
public static int md(long a, long b) {
return mm(a, mInv(b));
}
public static long mSums(long... lar) {
long res = 0;
for (long l : lar)
res = (res + l % MOD) % MOD;
return (res + MOD) % MOD;
}
public static long mDiffs(long... lar) {
long res = lar[0] % MOD;
for (int i = 1; i < lar.length; i++) {
res = (res - lar[i] % MOD) % MOD;
}
return (res + MOD) % MOD;
}
public static long mMuls(long... lar) {
long res = 1;
for (long l : lar)
res = (res * (l % MOD)) % MOD;
return (res + MOD) % MOD;
}
public static long mDivs(long... lar) {
long res = lar[0] % MOD;
for (int i = 1; i < lar.length; i++) {
res = mm(res, mInv(lar[i]));
}
return (res + MOD) % MOD;
}
static long mInv(long n) {
return mPow(n, MOD - 2);
}
static int mPow(long x, long n) {
long res = 1L;
while (n > 0) {
if ((n & 1) == 1) {
res = res * x % MOD;
}
x = x * x % MOD;
n >>= 1;
}
return (int) ((res + MOD) % MOD);
}
static void factorial() {
Fa = new int[(int) 1e6 + 1];
Fa[0] = Fa[1] = 1;
for (int i = 2; i < Fa.length; i++) {
Fa[i] = (int) ((Fa[i - 1] * 1L * i) % MOD);
}
}
//↑nCrをmod計算するために必要
static long lcm(long n, long r) {
return n / gcd(n, r) * r;
}
static int gcd(int n, int r) {
return r == 0 ? n : gcd(r, n % r);
}
static long gcd(long n, long r) {
return r == 0 ? n : gcd(r, n % r);
}
public static int u0(int a) {
if (a < 0) return 0;
return a;
}
public static long u0(long a) {
if (a < 0) return 0;
return a;
}
public static double u0(double a) {
if (a < 0) return 0;
return a;
}
public static boolean[][] tbt(char[][] s, char c) {
boolean[][] res = new boolean[s.length][s[0].length];
for (int hi = 0; hi < s.length; hi++)
for (int wi = 0; wi < s[0].length; wi++)
if (s[hi][wi] == c) res[hi][wi] = true;
return res;
}
public static int[] tia(int a) {
int[] res = new int[keta(a)];
for (int i = res.length - 1; i >= 0; i--) {
res[i] = a % 10;
a /= 10;
}
return res;
}
public static int[][] tit(char[][] a) {
int[][] res = new int[a.length][a[0].length];
for (int hi = 0; hi < a.length; hi++) {
for (int wi = 0; wi < a[0].length; wi++) {
res[hi][wi] = a[hi][wi] - '0';
}
}
return res;
}
public static Integer[] toIntegerArray(int[] ar) {
Integer[] res = new Integer[ar.length];
for (int i = 0; i < ar.length; i++) {
res[i] = ar[i];
}
return res;
}
//k個の次の組み合わせをビットで返す 大きさに上限はない 110110 -> 111001
public static long bitNextComb(long comb) {
long x = comb & -comb; //最下位の1
long y = comb + x; //連続した下の1を繰り上がらせる
return ((comb & ~y) / x >> 1) | y;
}
public static int keta(long num) {
int res = 0;
while (num > 0) {
num /= 10;
res++;
}
return res;
}
public static int ketaSum(long num) {
int res = 0;
while (num > 0) {
res += num % 10;
num /= 10;
}
return res;
}
public static boolean isOutofIndex(int x, int y, int w, int h) {
if (x < 0 || y < 0) return true;
if (w <= x || h <= y) return true;
return false;
}
public static boolean isOutofIndex(int x, int y, char[][] ban) {
if (x < 0 || y < 0) return true;
if (ban[0].length <= x || ban.length <= y) return true;
return false;
}
public static void setPrimes() {
int n = 100001;
isPrime = new boolean[n];
Arrays.fill(isPrime, true);
isPrime[0] = isPrime[1] = false;
for (int i = 2; i * i <= n; i++) {
if (!isPrime[i]) continue;
for (int j = i * 2; j < n; j += i) {
isPrime[j] = false;
}
}
primes = new ArrayList<>();
for (int i = 2; i < n; i++) {
if (isPrime[i]) primes.add(i);
}
}
public static void revSort(int[] a) {
Arrays.sort(a);
reverse(a);
}
public static void revSort(long[] a) {
Arrays.sort(a);
reverse(a);
}
public static P[] clone(P[] ar) {
P[] res = new P[ar.length];
for (int i = 0; i < ar.length; i++) {
res[i] = new P(ar[i].x, ar[i].y);
}
return res;
}
public static int[][] clone(int[][] ar) {
int[][] nr = new int[ar.length][ar[0].length];
for (int i = 0; i < ar.length; i++)
nr[i] = ar[i].clone();
return nr;
}
public static long[][] clone(long[][] ar) {
long[][] nr = new long[ar.length][ar[0].length];
for (int i = 0; i < ar.length; i++)
nr[i] = ar[i].clone();
return nr;
}
public static double[][] clone(double[][] ar) {
double[][] nr = new double[ar.length][ar[0].length];
for (int i = 0; i < ar.length; i++)
nr[i] = ar[i].clone();
return nr;
}
public static boolean[][] clone(boolean[][] ar) {
boolean[][] nr = new boolean[ar.length][ar[0].length];
for (int i = 0; i < ar.length; i++)
nr[i] = ar[i].clone();
return nr;
}
public static char[][] clone(char[][] ar) {
char[][] nr = new char[ar.length][ar[0].length];
for (int i = 0; i < ar.length; i++)
nr[i] = ar[i].clone();
return nr;
}
public static int[][][] clone(int[][][] ar) {
int[][][] nr = new int[ar.length][ar[0].length][ar[0][0].length];
for (int i = 0; i < ar.length; i++)
nr[i] = clone(ar[i]);
return nr;
}
public static long[][][] clone(long[][][] ar) {
long[][][] nr = new long[ar.length][ar[0].length][ar[0][0].length];
for (int i = 0; i < ar.length; i++)
nr[i] = clone(ar[i]);
return nr;
}
public static double[][][] clone(double[][][] ar) {
double[][][] nr = new double[ar.length][ar[0].length][ar[0][0].length];
for (int i = 0; i < ar.length; i++)
nr[i] = clone(ar[i]);
return nr;
}
public static boolean[][][] clone(boolean[][][] ar) {
boolean[][][] nr = new boolean[ar.length][ar[0].length][ar[0][0].length];
for (int i = 0; i < ar.length; i++)
nr[i] = clone(ar[i]);
return nr;
}
public static char[][][] clone(char[][][] ar) {
char[][][] nr = new char[ar.length][ar[0].length][ar[0][0].length];
for (int i = 0; i < ar.length; i++)
nr[i] = clone(ar[i]);
return nr;
}
/**
* <h1>指定した値以上の先頭のインデクスを返す</h1>
* <p>配列要素が0のときは、0が返る。</p>
*
* @return<b>int</b> : 探索した値以上で、先頭になるインデクス
* 値が無ければ、挿入できる最小のインデックス
*/
public static <T extends Number> int lowerBound(final List<T> lis, final T value) {
int low = 0;
int high = lis.size();
int mid;
while (low < high) {
mid = ((high - low) >>> 1) + low; //(low + high) / 2 (オーバーフロー対策)
if (lis.get(mid).doubleValue() < value.doubleValue()) {
low = mid + 1;
} else {
high = mid;
}
}
return low;
}
//v未満で最大のiを返す。ただしv以上を満たすiがあるなら最小のiを返す
public static <T extends Number> int rlowerBound(final List<T> lis, final T value) {
int ind = lowerBound(lis, value);
if (ind == lis.size() || !lis.get(ind).equals(value)) ind--;
return ind;
}
/**
* <h1>指定した値より大きい先頭のインデクスを返す</h1>
* <p>配列要素が0のときは、0が返る。</p>
*
* @return<b>int</b> : 探索した値より上で、先頭になるインデクス
* 値が無ければ、挿入できる最小のインデックス
*/
public static <T extends Number> int upperBound(final List<T> lis, final T value) {
int low = 0;
int high = lis.size();
int mid;
while (low < high) {
mid = ((high - low) >>> 1) + low; //(low + high) / 2 (オーバーフロー対策)
if (lis.get(mid).doubleValue() < value.doubleValue()) {
low = mid + 1;
} else {
high = mid;
}
}
return low;
}
public static int lowerBound(final int[] arr, final int value) {
int low = 0;
int high = arr.length;
int mid;
while (low < high) {
mid = ((high - low) >>> 1) + low; //(low + high) / 2 (オーバーフロー対策)
if (arr[mid] < value) {
low = mid + 1;
} else {
high = mid;
}
}
return low;
}
public static int rlowerBound(final int[] arr, final int value) {
int ind = lowerBound(arr, value);
if (ind == arr.length || arr[ind] != value) ind--;
return ind;
}
public static int upperBound(final int[] arr, final int value) {
int low = 0;
int high = arr.length;
int mid;
while (low < high) {
mid = ((high - low) >>> 1) + low; //(low + high) / 2 (オーバーフロー対策)
if (arr[mid] <= value) {
low = mid + 1;
} else {
high = mid;
}
}
return low;
}
public static int lowerBound(final long[] arr, final long value) {
int low = 0;
int high = arr.length;
int mid;
while (low < high) {
mid = ((high - low) >>> 1) + low; //(low + high) / 2 (オーバーフロー対策)
if (arr[mid] < value) {
low = mid + 1;
} else {
high = mid;
}
}
return low;
}
public static int rlowerBound(final long[] arr, final long value) {
int ind = lowerBound(arr, value);
if (ind == arr.length || arr[ind] != value) ind--;
return ind;
}
public static int upperBound(final long[] arr, final long value) {
int low = 0;
int high = arr.length;
int mid;
while (low < high) {
mid = ((high - low) >>> 1) + low; //(low + high) / 2 (オーバーフロー対策)
if (arr[mid] <= value) {
low = mid + 1;
} else {
high = mid;
}
}
return low;
}
//次の順列に書き換える、最大値ならfalseを返す
public static boolean nextPermutation(int A[]) {
int len = A.length;
int pos = len - 2;
for (; pos >= 0; pos--) {
if (A[pos] < A[pos + 1]) break;
}
if (pos == -1) return false;
//posより大きい最小の数を二分探索
int ok = pos + 1;
int ng = len;
while (Math.abs(ng - ok) > 1) {
int mid = (ok + ng) / 2;
if (A[mid] > A[pos]) ok = mid;
else ng = mid;
}
swap(A, pos, ok);
reverse(A, pos + 1, len - 1);
return true;
}
//次の順列に書き換える、最小値ならfalseを返す
public static boolean prevPermutation(int A[]) {
int len = A.length;
int pos = len - 2;
for (; pos >= 0; pos--) {
if (A[pos] > A[pos + 1]) break;
}
if (pos == -1) return false;
//posより小さい最大の数を二分探索
int ok = pos + 1;
int ng = len;
while (Math.abs(ng - ok) > 1) {
int mid = (ok + ng) / 2;
if (A[mid] < A[pos]) ok = mid;
else ng = mid;
}
swap(A, pos, ok);
reverse(A, pos + 1, len - 1);
return true;
}
static <T> void swap(T[] x, int i, int j) {
T t = x[i];
x[i] = x[j];
x[j] = t;
}
static void swap(char[] x, int i, int j) {
char t = x[i];
x[i] = x[j];
x[j] = t;
}
static void swap(int[] x, int i, int j) {
int t = x[i];
x[i] = x[j];
x[j] = t;
}
public static String reverse(String a) {
sb.append(a);
String res = sb.reverse().toString();
sb.setLength(0);
return new String(res);
}
public static void reverse(int[] x) {
int l = 0;
int r = x.length - 1;
while (l < r) {
int temp = x[l];
x[l] = x[r];
x[r] = temp;
l++;
r--;
}
}
public static void reverse(long[] x) {
int l = 0;
int r = x.length - 1;
while (l < r) {
long temp = x[l];
x[l] = x[r];
x[r] = temp;
l++;
r--;
}
}
public static void reverse(char[] x) {
int l = 0;
int r = x.length - 1;
while (l < r) {
char temp = x[l];
x[l] = x[r];
x[r] = temp;
l++;
r--;
}
}
public static void reverse(int[] x, int s, int e) {
int l = s;
int r = e;
while (l < r) {
int temp = x[l];
x[l] = x[r];
x[r] = temp;
l++;
r--;
}
}
static int cou(boolean[] a) {
int res = 0;
for (boolean b : a) {
if (b) res++;
}
return res;
}
static int cou(boolean[][] a) {
int res = 0;
for (boolean[] b : a) {
res += cou(b);
}
return res;
}
static int cou(String s, char c) {
int res = 0;
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) == c) res++;
}
return res;
}
static int cou(char[][] a, char c) {
int co = 0;
for (int i = 0; i < a.length; i++)
for (int j = 0; j < a[0].length; j++)
if (a[i][j] == c) co++;
return co;
}
static int cou(int[] a, int key) {
int co = 0;
for (int i = 0; i < a.length; i++)
if (a[i] == key) co++;
return co;
}
static int cou(long[] a, long key) {
int co = 0;
for (int i = 0; i < a.length; i++)
if (a[i] == key) co++;
return co;
}
static int cou(int[][] a, int key) {
int co = 0;
for (int i = 0; i < a.length; i++)
co += (cou(a[i], key));
return co;
}
static int[] couArray(int[] a) {
int[] res = new int[maxs(a) + 1];
for (int i : a) {
res[i]++;
}
return res;
}
static void fill(int[] a, int v) {
Arrays.fill(a, v);
}
static void fill(long[] a, int v) {
Arrays.fill(a, v);
}
static void fill(boolean[] a, boolean v) {
Arrays.fill(a, v);
}
static void fill(int[][] a, int v) {
for (int i = 0; i < a.length; i++)
Arrays.fill(a[i], v);
}
static void fill(char[][] a, char c) {
for (int i = 0; i < a.length; i++)
Arrays.fill(a[i], c);
}
static void fill(long[][] a, long v) {
for (int i = 0; i < a.length; i++)
Arrays.fill(a[i], v);
}
static void fill(double[][] a, double v) {
for (int i = 0; i < a.length; i++)
Arrays.fill(a[i], v);
}
static void fill(boolean[][] a, boolean v) {
for (int i = 0; i < a.length; i++)
Arrays.fill(a[i], v);
}
static void fill(int[][][] a, int v) {
for (int i = 0; i < a.length; i++)
fill(a[i], v);
}
static void fill(long[][][] a, long v) {
for (int i = 0; i < a.length; i++)
fill(a[i], v);
}
static int maxs(int... a) {
int res = Integer.MIN_VALUE;
for (int i : a) {
res = Math.max(res, i);
}
return res;
}
static long maxs(long... a) {
long res = Long.MIN_VALUE;
for (long i : a) {
res = Math.max(res, i);
}
return res;
}
static double maxs(double... a) {
double res = Double.MIN_VALUE;
for (double i : a) {
res = Math.max(res, i);
}
return res;
}
static long mins(long... a) {
long res = Long.MAX_VALUE;
for (long i : a) {
res = Math.min(res, i);
}
return res;
}
static int maxs(int[][] ar) {
int res = Integer.MIN_VALUE;
for (int i[] : ar)
res = Math.max(res, maxs(i));
return res;
}
static long maxs(long[][] ar) {
long res = Integer.MIN_VALUE;
for (long i[] : ar)
res = Math.max(res, maxs(i));
return res;
}
static int mins(int... a) {
int res = Integer.MAX_VALUE;
for (int i : a) {
res = Math.min(res, i);
}
return res;
}
static int mins(int[][] ar) {
int res = Integer.MAX_VALUE;
for (int i[] : ar)
res = Math.min(res, mins(i));
return res;
}
public static <T extends Number> long sum(ArrayList<T> lis) {
long res = 0;
for (T li : lis) {
res += li.longValue();
}
return res;
}
static long sum(int[] a) {
long cou = 0;
for (int i : a)
cou += i;
return cou;
}
static long sum(long[] a) {
long cou = 0;
for (long i : a)
cou += i;
return cou;
}
//FastScanner
static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
static StringTokenizer tokenizer = null;
public static String next() {
if (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(reader.readLine());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
}
public static String nextLine() {
if (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
return reader.readLine();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken("\n");
}
public static long nl() {
return Long.parseLong(next());
}
public static String n() {
return next();
}
public static int ni() {
return Integer.parseInt(next());
}
public static double nd() {
return Double.parseDouble(next());
}
public static int[] nia(int n) {
int[] a = new int[n];
for (int i = 0; i < n; i++) {
a[i] = ni();
}
return a;
}
//1-index
public static int[] niao(int n) {
int[] a = new int[n + 1];
for (int i = 1; i < n + 1; i++) {
a[i] = ni();
}
return a;
}
//番兵法
public static int[] nias(int n, int end) {
int[] a = new int[n + 1];
for (int i = 0; i < n; i++) {
a[i] = ni();
}
a[n] = end;
return a;
}
public static int[] niad(int n) {
int[] a = new int[n];
for (int i = 0; i < n; i++) {
a[i] = ni() - 1;
}
return a;
}
public static P[] npa(int n) {
P[] p = new P[n];
for (int i = 0; i < n; i++) {
p[i] = new P(ni(), ni());
}
return p;
}
public static P[] npad(int n) {
P[] p = new P[n];
for (int i = 0; i < n; i++) {
p[i] = new P(ni() - 1, ni() - 1);
}
return p;
}
public static int[][] nit(int h, int w) {
int[][] a = new int[h][w];
for (int hi = 0; hi < h; hi++) {
for (int wi = 0; wi < w; wi++) {
a[hi][wi] = ni();
}
}
return a;
}
public static int[][] nitd(int h, int w) {
int[][] a = new int[h][w];
for (int hi = 0; hi < h; hi++) {
for (int wi = 0; wi < w; wi++) {
a[hi][wi] = ni() - 1;
}
}
return a;
}
static int[][] S_ARRAY;
static long[][] S_LARRAY;
static int S_INDEX;
static int S_LINDEX;
//複数の配列を受け取る
public static int[] niah(int n, int k) throws Exception {
if (S_ARRAY == null) {
S_ARRAY = new int[k][n];
for (int j = 0; j < n; j++) {
for (int i = 0; i < k; i++) {
S_ARRAY[i][j] = ni();
}
}
}
return S_ARRAY[S_INDEX++];
}
public static long[] nlah(int n, int k) throws Exception {
if (S_LARRAY == null) {
S_LARRAY = new long[k][n];
for (int j = 0; j < n; j++) {
for (int i = 0; i < k; i++) {
S_LARRAY[i][j] = nl();
}
}
}
return S_LARRAY[S_LINDEX++];
}
//複数の配列を受け取る
public static int[] niahd(int n, int k) throws Exception {
if (S_ARRAY == null) {
S_ARRAY = new int[k][n];
for (int j = 0; j < n; j++) {
for (int i = 0; i < k; i++) {
S_ARRAY[i][j] = ni() - 1;
}
}
}
return S_ARRAY[S_INDEX++];
}
public static long[] nlahd(int n, int k) throws Exception {
if (S_LARRAY == null) {
S_LARRAY = new long[k][n];
for (int j = 0; j < n; j++) {
for (int i = 0; i < k; i++) {
S_LARRAY[i][j] = nl() - 1;
}
}
}
return S_LARRAY[S_LINDEX++];
}
public static char[] nca() {
char[] a = next().toCharArray();
return a;
}
public static String[] nsa(int n) {
String[] res = new String[n];
for (int i = 0; i < n; i++) {
res[i] = n();
}
return res;
}
//スペースが入っている場合
public static char[][] ncts(int h, int w) {
char[][] a = new char[h][w];
for (int hi = 0; hi < h; hi++) {
String s = nextLine().replace(" ", "");
for (int wi = 0; wi < s.length(); wi++) {
a[hi][wi] = s.charAt(wi);
}
}
return a;
}
public static char[][] nct(int h, int w) {
char[][] a = new char[h][w];
for (int hi = 0; hi < h; hi++) {
String s = nextLine();
for (int wi = 0; wi < s.length(); wi++) {
a[hi][wi] = s.charAt(wi);
}
}
return a;
}
public static char[][] nctp(int h, int w, char c) {
char[][] a = new char[h + 2][w + 2];
for (int hi = 1; hi < h + 1; hi++) {
String s = nextLine();
for (int wi = 1; wi < s.length() + 1; wi++) {
a[hi][wi] = s.charAt(wi - 1);
}
}
for (int wi = 0; wi < w + 2; wi++)
a[0][wi] = a[h + 1][wi] = c;
for (int hi = 0; hi < h + 2; hi++)
a[hi][0] = a[hi][w + 1] = c;
return a;
}
//スペースが入ってる時用
public static char[][] nctsp(int h, int w, char c) {
char[][] a = new char[h + 2][w + 2];
//char c = '*';
int i;
for (i = 0; i < w + 2; i++)
a[0][i] = c;
for (i = 1; i < h + 1; i++) {
a[i] = (c + nextLine().replace(" ", "") + c).toCharArray();
}
for (i = 0; i < w + 2; i++)
a[h + 1][i] = c;
return a;
}
public static long[] nla(int n) {
long[] a = new long[n];
for (int i = 0; i < n; i++) {
a[i] = nl();
}
return a;
}
public static long[] nlas(int n, long e) {
long[] a = new long[n + 1];
for (int i = 0; i < n; i++) {
a[i] = nl();
}
a[n] = e;
return a;
}
public static long[] nlao(int n) {
long[] a = new long[n + 1];
for (int i = 0; i < n; i++) {
a[i + 1] = nl();
}
return a;
}
public static long[] nlad(int n) {
long[] a = new long[n];
for (int i = 0; i < n; i++) {
a[i] = nl() - 1;
}
return a;
}
public static long[][] nlt(int h, int w) {
long[][] a = new long[h][w];
for (int hi = 0; hi < h; hi++) {
for (int wi = 0; wi < w; wi++) {
a[hi][wi] = nl();
}
}
return a;
}
//便利クラス
static class CouMap {
public HashMap<Long, Long> map;
public HashMap<String, Long> smap;
CouMap() {
map = new HashMap();
smap = new HashMap();
}
CouMap(int[] a) {
map = new HashMap();
smap = new HashMap();
for (int i : a) {
put(i);
}
}
public int size() {
return map.size();
}
public void put(long key, long value) {
Long nowValue = map.get(key);
map.put(key, nowValue == null ? value : nowValue + value);
}
public void put(String key, long value) {
Long nowValue = smap.get(key);
smap.put(key, nowValue == null ? value : nowValue + value);
}
public void mput(long key, long value) {
Long nowValue = map.get(key);
map.put(key, nowValue == null ? value % MOD : ms(nowValue, value));
}
public void put(long key) {
put(key, 1);
}
public void put(String key) {
put(key, 1);
}
public void put(int... arg) {
for (int i : arg) {
put(i, 1);
}
}
public void put(long... arg) {
for (long i : arg) {
put(i, 1);
}
}
public void mput(int... arg) {
for (int i : arg) {
mput(i, 1);
}
}
public void mput(long... arg) {
for (long i : arg) {
mput(i, 1);
}
}
public long get(long key) {
Long v = map.get(key);
return v == null ? 0 : v;
}
public long get(String key) {
Long v = map.get(key);
return v == null ? 0 : v;
}
}
static class P implements Comparable<P> {
int x, y;
@Override
public int compareTo(P p) {
//xyで昇順
return x == p.x ? y - p.y : x - p.x;
//xyで降順
//return (nowx == p.nowx ? nowy - p.nowy : nowx - p.nowx) * -1;
//yxで昇順
//return nowy == p.nowy ? nowx - p.nowx : nowy - p.nowy;
//yxで昇順
//return (nowy == p.nowy ? nowx - p.nowx : nowy - p.nowy) * -1;
//x昇 y降
//return nowx == p.nowx ? p.nowy - nowy : nowx - p.nowx;
//x降 y昇
//return (nowx == p.nowx ? p.nowy - nowy : nowx - p.nowx) * -1;
//y昇 x降
//return nowy == p.nowy ? p.nowx - nowx : nowy - p.nowy;
//y降 x昇
//return (nowy == p.nowy ? p.nowx - nowx : nowy - p.nowy) * -1;
}
P(int a, int b) {
x = a;
y = b;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof P)) return false;
P p = (P) o;
return x == p.x && y == p.y;
}
@Override
public int hashCode() {
return Objects.hash(x, y);
}
}
static class PL implements Comparable<PL> {
long x, y;
public int compareTo(PL p) {
//xyで昇順
long res = x == p.x ? y - p.y : x - p.x;
//xyで降順
//long res = (nowx == p.nowx ? nowy - p.nowy : nowx - p.nowx) * -1;
//yxで昇順
//long res = nowy == p.nowy ? nowx - p.nowx : nowy - p.nowy;
//yxで昇順
//long res = (nowy == p.nowy ? nowx - p.nowx : nowy - p.nowy) * -1;
//x昇 y降
//long res = nowx == p.nowx ? p.nowy - nowy : nowx - p.nowx;
//x降 y昇
//long res = (nowx == p.nowx ? p.nowy - nowy : nowx - p.nowx) * -1;
//y昇 x降
//long res = nowy == p.nowy ? p.nowx - nowx : nowy - p.nowy;
//y降 x昇
//long res = (nowy == p.nowy ? p.nowx - nowx : nowy - p.nowy) * -1;
return (res == 0) ? 0 : res > 0 ? 1 : -1;
}
PL(long a, long b) {
x = a;
y = b;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof PL)) return false;
PL p = (PL) o;
return x == p.x && y == p.y;
}
@Override
public int hashCode() {
return Objects.hash(x, y);
}
}
//値を渡す際は半開区間
static class RectangleSum {
//半開区間 0は0
long[][] rui;
int H, W;
RectangleSum(long[][] ori) {
H = ori.length;
W = ori[0].length;
rui = new long[H + 1][W + 1];
for (int hi = 0; hi < H; hi++) {
for (int wi = 0; wi < W; wi++) {
rui[hi + 1][wi + 1] = ori[hi][wi];
}
}
for (int hi = 1; hi < H + 1; hi++) {
for (int wi = 1; wi < W + 1; wi++) {
rui[hi][wi] += rui[hi - 1][wi];
rui[hi][wi] += rui[hi][wi - 1];
rui[hi][wi] -= rui[hi - 1][wi - 1];
}
}
}
RectangleSum(int[][] ori) {
H = ori.length;
W = ori[0].length;
rui = new long[H + 1][W + 1];
for (int hi = 0; hi < H; hi++) {
for (int wi = 0; wi < W; wi++) {
rui[hi + 1][wi + 1] = ori[hi][wi];
}
}
for (int hi = 1; hi < H + 1; hi++) {
for (int wi = 1; wi < W + 1; wi++) {
rui[hi][wi] += rui[hi - 1][wi];
rui[hi][wi] += rui[hi][wi - 1];
rui[hi][wi] -= rui[hi - 1][wi - 1];
}
}
}
//半開区間
public long getSum(int left, int right, int top, int bottom) {
if (right > W || bottom > H) return 0;
if (left < 0 || top < 0) return 0;
if (top >= bottom || left >= right) return 0;
long res = rui[bottom][right];
res -= rui[top][right];
res -= rui[bottom][left];
res += rui[top][left];
return res;
}
}
public static void main(String[] args) throws Exception {
long startTime = System.currentTimeMillis();
solve();
System.out.flush();
long endTime = System.currentTimeMillis();
if (DEBUG) System.err.println(endTime - startTime);
}
}
| a.cc:16:1: error: stray '@' in program
16 | @SuppressWarnings("unchecked")
| ^
a.cc:1399:9: error: stray '@' in program
1399 | @Override
| ^
a.cc:1425:9: error: stray '@' in program
1425 | @Override
| ^
a.cc:1433:9: error: stray '@' in program
1433 | @Override
| ^
a.cc:1470:9: error: stray '@' in program
1470 | @Override
| ^
a.cc:1478:9: error: stray '@' in program
1478 | @Override
| ^
a.cc:1:1: error: 'import' does not name a type
1 | import java.io.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import static java.lang.Math.*;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
4 | import static java.lang.Math.min;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
6 | import java.math.BigDecimal;
| ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: 'import' does not name a type
7 | import java.util.*;
| ^~~~~~
a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:9:1: error: 'import' does not name a type
9 | import static java.util.Arrays.*;
| ^~~~~~
a.cc:9:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:11:1: error: 'import' does not name a type
11 | import java.util.stream.*;
| ^~~~~~
a.cc:11:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:16:18: error: expected constructor, destructor, or type conversion before '(' token
16 | @SuppressWarnings("unchecked")
| ^
|
s106423528 | p03830 | C++ | #include<bits/stdc++.h>
using namespace std;
#define ED return 0;
#define UP(a,b) ((a+(b-1))/b)
#define SORT(vec) sort(vec.begin(),vec.end());
#define DOUBLECHANGE(count) cout << setprecision(count);
#define REV(vec) reverse(vec.begin(),vec.end());
#define ipow(x,y) long(pow(x,y))
const long long int mod = 1000000007;
unsigned long long int gcd(unsigned long long int a, unsigned long long int b){
if(b == 0) return a;
return gcd(b, a % b);
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N;
cin >> N;
int max_sosu = 0;
ve
ctor<int> sosu (1001,2);
sosu.at(0) = 0;
sosu.at(1) = 0;
vector<int> bunkai (1001,1);
bunkai.at(0) = -1;
bunkai.at(1) = -1;
for(int i = 2;i < 1001;i++){
if(sosu.at(i) == 2){
sosu.at(i) = 1;
for(int j = sosu.at(i)+1;j < 1000;j++){
if(j % i == 0){
sosu.at(j) = 0;
bunkai.at(j) = -1;
cout << j << endl;
}
}
}
}
for(int i = 0;i < 1000;i++){
cout << sosu.at(i) << endl;
}
ED
sosu.at(0) = 0;
sosu.at(1) = 0;
vector<int> vec (1000,1);
for(int i = 1;i < N;i++){//2kara yakusuu dasu
if(sosu.at(i+1) == 1){//sosu nara
bunkai.at(i+1) = 2;
max_sosu = i+1;
}
else{
for(int j = 2;j <= (i+1)/2;j++){//subetede waru
if(i % j == 0){
for(int k = 1;true;k++){
if(i % ipow(j,k) != 0){
bunkai.at(j) += k;
break;
}
}
}
}
}
for(int j = 2;j < 1000;j++){
if(bunkai.at(j) != -1){
vec.at(i) *= bunkai.at(j);
}
}
}
cout << vec.at(N) << endl;
}
| a.cc: In function 'int main()':
a.cc:22:5: error: 've' was not declared in this scope
22 | ve
| ^~
a.cc:24:5: error: 'sosu' was not declared in this scope
24 | sosu.at(0) = 0;
| ^~~~
|
s448106770 | p03830 | C++ | #include <bits/stdc++.h>
using namespace std ;
map < long long , long long > mp1 ;
int a ;
long long x , cnt = 1 ;
int main ()
{
cin >> a ;
for ( int i = 1 ; i <= a ; ++ i ){
x = i ;
for ( int j = 2 ; j <= x ; ++ j ){
while ( x % j == 0 ){
mp1 [ j ] ++ ;
x /= j ;
}
}
}
for ( int i = 1 ; i <= a ; ++ i ){
cnt *= ( mp1 [ i ] + 1 ) % 1e9 ;
}
} | a.cc: In function 'int main()':
a.cc:24:34: error: invalid operands of types 'std::map<long long int, long long int>::mapped_type' {aka 'long long int'} and 'double' to binary 'operator%'
24 | cnt *= ( mp1 [ i ] + 1 ) % 1e9 ;
| ~~~~~~~~~~~~~~~~~ ^ ~~~
| | |
| | double
| std::map<long long int, long long int>::mapped_type {aka long long int}
|
s978646377 | p03830 | C++ | #include "bits/stdc++.h"
using namespace std;
using ll = long long;
int main () {
cin.tie(0);
cin.sync_with_stdio(0);
int n;
cin >> n;
map<int, int> cnt;
cnt[1] = 0;
for(int v = 2; v <= n; ++v) {
int x = i;
for(int i = 2; i*i <= x; ++i)
if(x % i == 0) {
int c = 0;
while(x % i == 0)
c++, x /= i;
cnt[i] += c;
}
}
int ans = 1;
int const M = 1'000'000'007;
for(auto const& p : cnt)
ans = 1ll * ans * (p.second + 1) % M;
cout << ans;
} | a.cc: In function 'int main()':
a.cc:14:25: error: 'i' was not declared in this scope
14 | int x = i;
| ^
|
s519181221 | p03830 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
const int N=1e5+7;
int a[N];
int main()
{
memset(a,0,sizeof(a));
cin>>n;
for (int i=2;i<=n;i++)
{
int x=i;
for (int j=2;j<=x;j++)
{
while(x%j==0)
{
a[j]++;
x/=j;
}
}
a[x]++;
}
ll ans=1;
for (int i=2;i<=n;i++)
ans=((ll)(ans*(a[i]+1)))%1000000007;
cout<<sum;
return 0;
} | a.cc: In function 'int main()':
a.cc:27:15: error: 'sum' was not declared in this scope
27 | cout<<sum;
| ^~~
|
s209172021 | p03830 | C++ | 1 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1
| ^
|
s037853313 | p03830 | C | #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <unordered_map>
using namespace std;
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
int res[1000] = { 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 227020758, 178290591, 674358851, 789741546, 425606191, 660911389, 557316307, 146326063, 72847302, 602640637, 860734560, 657629300, 440732388, 459042011, 394134213, 35757887, 36978716, 109361473, 390205642, 486580460, 57155068, 943272305, 14530444, 523095984, 354551275, 472948359, 444985875, 799434881, 776829897, 626855450, 954784168, 10503098, 472639410, 741412713, 846397273, 627068824, 726372166, 318608048, 249010336, 948537388, 272481214, 713985458, 269199917, 75195247, 286129051, 595484846, 133605669, 16340084, 996745124, 798197261, 286427093, 331333826, 536698543, 422103593, 280940535, 103956247, 172980994, 108669496, 715534167, 518459667, 847555432, 719101534, 932614679, 878715114, 661063309, 562937745, 472081547, 766523501, 88403147, 249058005, 671814275, 432398708, 753889928, 834533360, 604401816, 187359437, 674989781, 749079870, 166267694, 296627743, 586379910, 119711155, 372559648, 765725963, 275417893, 990953332, 104379182, 437918130, 229730822, 432543683, 551999041, 407899865, 829485531, 925465677, 24826746, 681288554, 260451868, 649705284, 117286020, 136034149, 371858732, 391895154, 67942395, 881317771, 114178486, 473061257, 294289191, 314702675, 79023409, 640855835, 825267159, 333127002, 640874963, 750244778, 281086141, 979025803, 294327705, 262601384, 400781066, 903100348, 112345444, 54289391, 329067736, 753211788, 190014235, 221964248, 853030262, 424235847, 817254014, 50069176, 159892119, 24464975, 547421354, 923517131, 757017312, 38561392, 745647373, 847105173, 912880234, 757794602, 942573301, 156287339, 224537377, 27830567, 369398991, 365040172, 41386942, 621910678, 127618458, 674190056, 892978365, 448450838, 994387759, 68366839, 417262036, 100021558, 903643190, 619341229, 907349424, 64099836, 89271551, 533249769, 318708924, 92770232, 420330952, 818908938, 584698880, 245797665, 489377057, 66623751, 192146349, 354927971, 661674180, 71396619, 351167662, 19519994, 689278845, 962979640, 929109959, 389110882, 98399701, 89541861, 460662776, 289903466, 110982403, 974515647, 928612402, 722479105, 218299090, 96415872, 572421883, 774063320, 682979494, 693774784, 611379287, 166890807, 880178425, 837467962, 705738750, 616613957, 338771924, 497191232, 896114138, 560652457, 661582322, 224945188, 262995829, 859081981, 857116478, 279856786, 408062844, 406076419, 367193638, 985761614, 767884817, 77737051, 801784560, 410447512, 813374614, 702909132, 777826615, 11426636, 685259446, 721228129, 931065383, 593559607, 860745086, 578819198, 495425745, 893029457, 6156532, 502193801, 37480384, 220174401, 383076669, 3013247, 750298503, 574624441, 230733683, 144887710, 656590378, 773954850, 358485371, 772254339, 469363737, 95843299, 823414273, 87709482, 892174648, 749756145, 185864756, 68295241, 98238739, 131504392, 111672419, 928208089, 687974198, 753032165, 71715287, 506557931, 290314197, 546089425, 174590825, 187067364, 817659471, 309331349, 303445769, 964814732, 112937795, 848457973, 113604679, 263728612, 162653895, 519013648, 956915940, 591788795, 26960558, 818561771, 201473695, 830318534, 283328761, 298655153, 103269519, 567777414, 629890782, 707451727, 528064896, 419467694, 259775012, 452053078, 972081682, 512829263, 412924123, 354780756, 917691336, 648929514, 519218426, 957710940, 848100261, 607279584, 78508462, 651656900, 271922065, 927371945, 976904514, 655633282, 147015495, 44958071, 431540693, 956102180, 821001984, 4640954, 508310043, 709072863, 866824584, 318461564, 773853828, 371761455, 53040744, 609526889, 972452623, 799173814, 723225821, 3874155, 305590228, 289496343, 139259591, 348260611, 756867525, 848691744, 101266155, 835557082, 267191274, 448180160, 518514435, 443022120, 614718802, 151579195, 204297074, 912569551, 137049249, 515433810, 979001276, 524451820, 229298431, 88837724, 892742699, 387369393, 840349900, 206661672, 18186411, 619853562, 246548548, 236767938, 893832644, 930410696, 321544423, 971435684, 402636244, 780681725, 194281388, 661238608, 964476271, 643075362, 439409780, 96895678, 723461710, 915447882, 785640606, 114709392, 933696835, 539582134, 739120141, 300372431, 244129985, 722433522, 26638091, 388855420, 42468156, 647517040, 474194942, 832805846, 958306874, 489519451, 339220689, 9833277, 923477502, 390998217, 790283925, 694135631, 736657340, 609563281, 873127083, 489593220, 264439147, 891171227, 489029295, 502009550, 325923608, 280525558, 857054649, 820622208, 558213940, 216997416, 487921842, 951328535, 606653379, 794417402, 449723904, 783486165, 414645478, 809681447, 114612567, 824953206, 255016498, 147060381, 88903008, 228293174, 394357308, 362355866, 900088886, 638573794, 779598451, 904922263, 451026166, 549459329, 212643744, 563246709, 391796933, 174243175, 189725986, 238337196, 60051478, 782959006, 982673239, 237607992, 685987666, 694447544, 195840153, 519748540, 446086975, 523485236, 185780714, 716004996, 214280883, 140643728, 555470704, 516522055, 116665689, 899547947, 490696549, 683197147, 686671136, 988747143, 744912554, 619072836, 345158054, 224284246, 637879131, 78947725, 342273666, 237716550, 915360466, 711578771, 423071394, 228124918, 271834959, 480779410, 254894593, 859192972, 990202578, 258044399, 151532640, 644862529, 48049425, 448119239, 130306338, 850105179, 401639970, 606863861, 183881380, 837401090, 513536652, 714177614, 946271680, 243293343, 403377310, 688653593, 15447678, 754734307, 631353768, 202296846, 159906516, 912696536, 737140518, 467380526, 896686075, 309895051, 356369955, 461415686, 706245266, 10064183, 183054210, 455971702, 737368289, 956771035, 564163693, 365118309, 226637659, 304857172, 440299843, 717116122, 485961418, 615704083, 476049473, 354119987, 329471814, 620060202, 251964959, 45357250, 175414082, 671119137, 48735782, 122378970, 717506435, 18459328, 949577729, 771970076, 635808197, 608040366, 165916428, 258536202, 902229110, 617090616, 548564593, 613394864, 753777984, 577888302, 416452176, 881599549, 524547188, 599140122, 522765386, 657552586, 256787840, 287613719, 776067801, 597965522, 458655497, 764387515, 350167935, 494713961, 513386012, 576480762, 864589772, 86987059, 495636228, 512647986, 721997962, 982831380, 162376799, 204281975, 462134806, 189646394, 425968575, 209834628, 494248765, 664281698, 947663843, 540352769, 25662122, 986679150, 207298711, 477043799, 24708053, 528335066, 189351697, 717500453, 42764755, 316734785, 823726196, 293357001, 547414377, 258966410, 602945692, 561521296, 351253952, 752369730, 174204566, 871148004, 302242737, 554611874, 540181425, 349941261, 414343943, 921115587, 959388563, 227019335, 708812719, 793380997, 342547759, 324322556, 458370547, 356254978, 809319893, 159690374, 848340820, 971304725, 180230004, 103061704, 207441144, 443272953, 45593686, 541647240, 612817107, 849140508, 109375794, 906749744, 159084460, 541378020, 692284266, 908221578, 720697998, 363923522, 819281897, 701846632, 479994712, 196613531, 29272489, 792937812, 859009553, 202148261, 385627435, 115321267, 612859231, 132778909, 173511339, 782369566, 322583903, 324703286, 31244274, 433755056, 109559692, 871157455, 350443931, 592104988, 197184362, 141678010, 649163959, 746537855, 954594407, 850681817, 703404350, 467293824, 684978431, 565588709, 378843675, 825260479, 749777538, 850502015, 387852091, 412307507, 307565279, 914127155, 864079609, 845970807, 414173935, 638273833, 664477235, 173471099, 480759791, 839694748, 190898355, 956270620, 957911348, 43002811, 628936576, 966234409, 667971950, 236586166, 954211897, 223051884, 21058295, 656573222, 631532535, 809706350, 984734695, 314281677, 311454037, 640732448, 434907794, 175084834, 434807109, 973816812, 488481268, 844735329, 917344075, 314288693, 459259162, 992521062, 667512257, 603748166, 679935673, 833938466, 933875943, 522922384, 981191471, 457854178, 112860028, 484939649, 611363777, 627371454, 844300972, 962501388, 738504183, 631041465, 29224765, 334078303, 211237785, 626057542, 900175080, 728504100, 450509755, 575177363, 905713570, 416609984, 874776027, 334255451, 683287462, 999293262, 474888472, 317020697, 180417613, 591538360, 879151833, 605566485, 569294094, 970567518, 896200922, 943088633, 145735679, 884701203, 949403596, 749113557, 78958680, 850679027, 665376978, 686499745, 426302291, 842343474, 708066168, 962548572, 349652428, 833757979, 492365420, 136639914, 76093131, 591710464, 208764552, 166233017, 498121245, 545840935, 26721664, 736011124, 880639351, 137410283, 42609708, 235572009, 981737748, 718913567, 909319027, 906112184, 298059463, 274736280, 217450848, 351267027, 149682364, 249066734, 11785215, 333890217, 774940233, 302540697, 519852435, 802535369, 620684620, 306323295, 752310997, 848793393, 883503040, 569433124, 254795373, 855478464, 660158704, 87911700, 944741410, 351053939, 2634663, 134077016, 736459220, 4882454, 969435081, 120150411, 922584286, 828772112, 106810765, 371205161, 17024731, 960279329, 389323593, 23991206, 744762405, 684217429, 479374977, 963728237, 3246420, 688035746, 381629444, 752436308, 274567573, 440219140, 702541058, 919238277, 563955926, 467150839, 5249506, 399086000, 833151662, 847391187, 655983283, 337920422, 866913758, 675206635, 549602585, 963783662, 324756002, 393087771, 731515248, 787956453, 550936813, 398161393, 631665856, 442637251, 454846959, 348994181, 88011024, 513458067, 60476466, 9760396, 403700900, 990173371, 519613195, 945797344, 114696834, 327457551, 905694736, 143025346, 289024806, 451579463, 325709522, 18701196, 326143996, 49850509, 619195074, 414881030, 850660769, 880149960, 651809429, 592293509, 810577782, 929598726, 835669318, 731671946, 529667681, 285562083, 293565850, 686472980, 274474950, 282703792, 889076915, 56602629, 546147347, 255724802, 873696194, 831784350, 110556728, 279941051, 667003092, 302778600, 803516696, 772054724, 165410893, 531446229, 958833885, 703493734, 68812272, 481542542, 722167619, 172528691, 173636402, 356397518, 390931659, 311533827, 53449710, 959934024, 259493848, 215350798, 907381983, 791418522, 896453666, 530274270, 443147787, 468552325, 410897594, 491169384, 314015783, 406644587, 772818684, 721371094, 596483817, 922913559, 78344520, 173781169, 485391881, 326797438, 209197264, 227032260, 183290649, 293208856, 909531571, 778733890, 346053132, 674154326, 75833611, 738595509, 449942130, 545136258, 334305223, 589959631, 51605154, 128106265, 85269691, 347284647, 656835568, 934798619, 602272125, 976691718, 647351010, 456965253, 143605060, 148066754, 588283108, 104912143, 240217288, 49898584, 251930392, 868617755, 690598708, 880742077, 200550782, 935358746, 104053488, 348096605, 394187502, 726999264, 278275958, 153885020, 653433530, 364854920, 922674021, 65882280, 762280792, 84294078, 29666249, 250921311, 659332228, 420236707, 614100318, 959310571, 676769211, 355052615, 567244231, 840761673, 557858783, 627343983, 461946676, 22779421, 756641425, 641419708 };
int main() {
int N;
scanf("%d", &N);
printf("%d\n", res[N - 1]);
}
| main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s996753116 | p03830 | C++ | #include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <locale>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <exception>
#include <functional>
#include <map>
#include <ios>
#include <iosfwd>
#include <istream>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <utility>
#include <vector>
#include <cwchar>
#include <cwctype>
#include <complex.h>
#include <fenv.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdint.h>
#include <tgmath.h>
#include <conio.h>
#include <numeric>
#include <list>
#include <windows.h>
#include <cfloat>
#include <climits>
#include <unordered_map>
#include <unordered_set>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef pair<int,int> pii;
#define uint(n) ((unsigned int)(n))
#define ll(n) ((long long)(n))
#define ull(n) ((unsigned long long)(n))
#define fl(n) ((float)(n))
#define dou(n) ((double)(n))
const int INF=1e9+7;
const ll LINF=1e18;
#define pb push_back
#define pob pop_back
#define m_p make_pair
#define ALL(a) (a).begin(),(a).end()
#define Mod 1000000007
#define SZ(a) ((int)(a).size())
#define FI first
#define SE second
int N;
bool isp[10010];
int cnt[10010];
vector<int> pri;
long long ans=1;
int main()
{
cin>>N;
memset(isp,1,sizeof(isp));
isp[0]=isp[1]=0;
for(int i=2;i<=10000;i++)
if(isp[i])
{
pri.push_back(i);
for(int j=i*2;j<=10000;j+=i) isp[j]=0;
}
for(int t=1;t<=N;t++)
{
int n=t;
int k=0;
while(n>1)
{
while(n%pri[k]==0&&k<pri.size()) n/=pri[k],cnt[pri[k]]++;
k++;
}
}
for(int i=0;i<pri.size();i++)
{
if(cnt[pri[i]]==0) continue;
ans=ans*(cnt[pri[i]]+1)%Mod;
// cout<<pri[i]<<": "<<cnt[pri[i]]<<endl;
}
cout<<ans;
return 0;
} | a.cc:53:10: fatal error: conio.h: No such file or directory
53 | #include <conio.h>
| ^~~~~~~~~
compilation terminated.
|
s266555703 | p03830 | C++ | int main(){
int A,B,C,D;
cin >> A >> B >> C >> D;
if(A+B+C+D==7){
cout <<A ;
cout <<"+" ;
cout <<B ;
cout <<"+" ;
cout <<C ;
cout <<"+" ;
cout <<D ;
cout <<"=" ;
cout <<"7" ;
} else if(A+B+C-D==7){
cout <<A ;
cout <<"+" ;
cout <<B ;
cout <<"+" ;
cout <<C ;
cout <<"-" ;
cout <<D ;
cout <<"=" ;
cout <<"7" ;
} else if(A+B-C+D==7){
cout <<A ;
cout <<"+" ;
cout <<B ;
cout <<"-" ;
cout <<C ;
cout <<"+" ;
cout <<D ;
cout <<"=" ;
cout <<"7" ;
} else if(A-B+C+D==7){
cout <<A ;
cout <<"-" ;
cout <<B ;
cout <<"+" ;
cout <<C ;
cout <<"+" ;
cout <<D ;
cout <<"=" ;
cout <<"7" ;
} else if(A+B-C-D==7){
cout <<A ;
cout <<"+" ;
cout <<B ;
cout <<"-" ;
cout <<C ;
cout <<"-" ;
cout <<D ;
cout <<"=" ;
cout <<"7" ;
} else if(A-B+C-D==7){
cout <<A ;
cout <<"-" ;
cout <<B ;
cout <<"+" ;
cout <<C ;
cout <<"-" ;
cout <<D ;
cout <<"=" ;
cout <<"7" ;
} else if(A-B-C+D==7){
cout <<A ;
cout <<"-" ;
cout <<B ;
cout <<"-" ;
cout <<C ;
cout <<"+" ;
cout <<D ;
cout <<"=" ;
cout <<"7" ;
} else if(A-B-C-D==7){
cout <<A ;
cout <<"-" ;
cout <<B ;
cout <<"-" ;
cout <<C ;
cout <<"-" ;
cout <<D ;
cout <<"=" ;
cout <<"7" ;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
3 | cin >> A >> B >> C >> D;
| ^~~
a.cc:5:9: error: 'cout' was not declared in this scope
5 | cout <<A ;
| ^~~~
a.cc:15:9: error: 'cout' was not declared in this scope
15 | cout <<A ;
| ^~~~
a.cc:25:9: error: 'cout' was not declared in this scope
25 | cout <<A ;
| ^~~~
a.cc:35:9: error: 'cout' was not declared in this scope
35 | cout <<A ;
| ^~~~
a.cc:45:9: error: 'cout' was not declared in this scope
45 | cout <<A ;
| ^~~~
a.cc:55:9: error: 'cout' was not declared in this scope
55 | cout <<A ;
| ^~~~
a.cc:65:9: error: 'cout' was not declared in this scope
65 | cout <<A ;
| ^~~~
a.cc:75:9: error: 'cout' was not declared in this scope
75 | cout <<A ;
| ^~~~
|
s625590559 | p03830 | C++ | #include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <iostream>
using namespace std;
#define rp(i,t) for(int i=0;i<(t);i++)
#define rep(i,s,t) for(int i=(s);i<=(t);i++)
#define rsp(i,s,t) for(int i=(s);i<(t);i++)
#define rrp(i,t,s) for(int i=(t);i>=(s);i--)
#define rcp(i,s,b,d) for(int i=(s);b;d)
#define mst(a,x) memset(a,x,sizeof(a))
#define INF 0x3f3f3f3f
#define N 1002
#define MOD 1000000007
#define Dp puts("")
#define Dw printf
#define Ds printf("#")
typedef long long ll;
bool itp[N];
char ch;
int n,P[N],num,next[N];
ll c[N],ans;
inline void read(int &x){x=0;do{ch=getchar();}while(ch<'0'||'9'<ch);do{x=x*10+ch-'0';ch=getchar();}while('0'<=ch&&ch<='9');}
inline void PrimeBuild(void)
{
itp[1]=true;
rep(i,2,1001)
{
if(!itp[i])P[++num]=i;
rcp(j,1,j<=num&&i*P[j]<=1001,j++)
{
itp[i*P[j]]=true;
if(i%P[j]==0)break;
}
}
rep(i,1,1001)if(itp[i-1])next[i]=next[i-1];else next[i]=i-1;
}
inline void slv(int x)
{
for(int i=next[x+1];i;i=next[i])
while(x%i==0)x/=i,c[i]++;
}
int main(void)
{
PrimeBuild();
read(n);
ans=1;
rep(i,1,n)slv(i);
rep(i,1,n)ans=ans*(c[i]+1)%MOD;
printf("%lld",ans);
return 0;
}
| a.cc: In function 'void PrimeBuild()':
a.cc:42:34: error: reference to 'next' is ambiguous
42 | rep(i,1,1001)if(itp[i-1])next[i]=next[i-1];else next[i]=i-1;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
from /usr/include/c++/14/bits/specfun.h:43,
from /usr/include/c++/14/cmath:3906,
from a.cc:3:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
232 | next(_InputIterator __x, typename
| ^~~~
a.cc:25:16: note: 'int next [1002]'
25 | int n,P[N],num,next[N];
| ^~~~
a.cc:42:42: error: reference to 'next' is ambiguous
42 | rep(i,1,1001)if(itp[i-1])next[i]=next[i-1];else next[i]=i-1;
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
232 | next(_InputIterator __x, typename
| ^~~~
a.cc:25:16: note: 'int next [1002]'
25 | int n,P[N],num,next[N];
| ^~~~
a.cc:42:57: error: reference to 'next' is ambiguous
42 | rep(i,1,1001)if(itp[i-1])next[i]=next[i-1];else next[i]=i-1;
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
232 | next(_InputIterator __x, typename
| ^~~~
a.cc:25:16: note: 'int next [1002]'
25 | int n,P[N],num,next[N];
| ^~~~
a.cc: In function 'void slv(int)':
a.cc:47:19: error: reference to 'next' is ambiguous
47 | for(int i=next[x+1];i;i=next[i])
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
232 | next(_InputIterator __x, typename
| ^~~~
a.cc:25:16: note: 'int next [1002]'
25 | int n,P[N],num,next[N];
| ^~~~
a.cc:47:33: error: reference to 'next' is ambiguous
47 | for(int i=next[x+1];i;i=next[i])
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
232 | next(_InputIterator __x, typename
| ^~~~
a.cc:25:16: note: 'int next [1002]'
25 | int n,P[N],num,next[N];
| ^~~~
|
s383679011 | p03830 | C++ | #include<bits/stdc++.h>
#define kq 1000000000+7
using namespace std;
long long n,a[10123],b[10123],res=0,c,res1=1;
int main()
{
cin >> n;
for(int i=1; i<=n; i++){
c=i;
int j=2;
while(j<=c){
if(c % j == 0){
a[j]++;
c/=j;
}
else j++;
}
}
for(int i=1; i<=n; i++){
res1*=(a[i]+1);
res1%=kq;
}
cout << t;
}
| a.cc: In function 'int main()':
a.cc:23:13: error: 't' was not declared in this scope; did you mean 'tm'?
23 | cout << t;
| ^
| tm
|
s470624122 | p03830 | C++ | #include<bits/stdc++.h>
#define kq 1000000000+7
using namespace std;
long long n,a[10123],b[10123],res=0,c,res1=1;
int main()
{
cin >> n;
for(int i=1; i<=n; i++){
c=i;
int j=2;
while(j<=c){
if(c % j == 0){
a[j]++;
c/=j;
}
else j++;
}
}
for(int i=1; i<=n; i++){
res1*=(a[i]+1);
res1%=kq;
}
cout << t;
}
| a.cc: In function 'int main()':
a.cc:23:13: error: 't' was not declared in this scope; did you mean 'tm'?
23 | cout << t;
| ^
| tm
|
s864377884 | p03830 | C++ | #include<iostream>
using namespace std;
#define REP(i, n) for(int i=0; i<n; i++)
#define ll long long
ll n, a, b;
ll x[100000];
ll f;
int main(){
cin >> n >> a >> b;
REP(i, n){
cin >> x[i];
}
REP(i, n-1){
f += min(a*(x[i+1]-x[i]), b);
}
cout << f << endl;
} | a.cc:2:1: error: extended character is not valid in an identifier
2 |
| ^
a.cc:4:1: error: extended character is not valid in an identifier
4 |
| ^
a.cc:7:1: error: extended character is not valid in an identifier
7 |
| ^
a.cc:11:1: error: extended character is not valid in an identifier
11 |
| ^
a.cc:17:1: error: extended character is not valid in an identifier
17 |
| ^
a.cc:2:1: error: '\U000000a0' does not name a type
2 |
| ^
a.cc:4:1: error: '\U000000a0' does not name a type
4 |
| ^
a.cc:11:1: error: '\U000000a0' does not name a type
11 |
| ^
|
s480306682 | p03830 | C++ | #include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <string>
#define FOR(i, a, b) for(int i = a; i <= b; i++)
#define DOW(i, b, a) for(int i = b; i >= a; i--)
#define maxN 1000000 + 10
const int modi = 1e9 + 7;
using namespace std;
int n;
int prev[maxN];
int dem[maxN];
void enter(){
cin >> n;
}
void init(){
FOR(i, 2, n) prev[i] = 0;
FOR(i, 2, n){
if(prev[i] == 0){
prev[i] = i;
FOR(j, 2, n / i) prev[j * i] = i;
}
}
}
void solve(){
int s = 1;
FOR(i, 2, n) dem[i] = 0;
FOR(i, 2, n){
int t = i;
while(t != 1){
dem[prev[t]]++;
t /= prev[t];
}
}
FOR(i, 2, n){
s = (long long)s * (dem[i] + 1) % modi;
}
cout << s << endl;
}
void printAns(){
}
int main(){
enter();
init();
solve();
printAns();
return 0;
}
| a.cc: In function 'void init()':
a.cc:28:22: error: reference to 'prev' is ambiguous
28 | FOR(i, 2, n) prev[i] = 0;
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:20:5: note: 'int prev [1000010]'
20 | int prev[maxN];
| ^~~~
a.cc:30:20: error: reference to 'prev' is ambiguous
30 | if(prev[i] == 0){
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:20:5: note: 'int prev [1000010]'
20 | int prev[maxN];
| ^~~~
a.cc:31:25: error: reference to 'prev' is ambiguous
31 | prev[i] = i;
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:20:5: note: 'int prev [1000010]'
20 | int prev[maxN];
| ^~~~
a.cc:32:42: error: reference to 'prev' is ambiguous
32 | FOR(j, 2, n / i) prev[j * i] = i;
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:20:5: note: 'int prev [1000010]'
20 | int prev[maxN];
| ^~~~
a.cc: In function 'void solve()':
a.cc:43:29: error: reference to 'prev' is ambiguous
43 | dem[prev[t]]++;
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:20:5: note: 'int prev [1000010]'
20 | int prev[maxN];
| ^~~~
a.cc:44:30: error: reference to 'prev' is ambiguous
44 | t /= prev[t];
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:20:5: note: 'int prev [1000010]'
20 | int prev[maxN];
| ^~~~
|
s973802284 | p03830 | C++ | #include<iostream>
using namespace std;
int dash(int n){
if(n>1){
n=n*dash(n-1);
return n;
}
else
return 1;
}
int main(){
int n;
int nd;
int count=0;
cin>>n;
nd=dash(n);
for(int i=1;i<=n;i++){
if(nd%i==)
count++;
}
cout<<count;
return 0;
}
| a.cc: In function 'int main()':
a.cc:19:14: error: expected primary-expression before ')' token
19 | if(nd%i==)
| ^
|
s038920746 | p03830 | C++ | #include<iostream>
using namespace std;
int dash(int n){
if(n>1){
n=n*dash(n-1);
return n;
}
else
return 1;
}
int main(){
int n;
int nd;
int count=0;
cin>>n;
nd=dash(n);
for(int i=1;i<=n;i++){
if(nd%i=0)
count++;
}
cout<<count;
return 0;
}
| a.cc: In function 'int main()':
a.cc:19:10: error: lvalue required as left operand of assignment
19 | if(nd%i=0)
| ~~^~
|
s013152827 | p03830 | C++ | #include<stdio.h>
#include<string.h>
int df(int n,int x)
{
if(n<x)
return 0;
else
return n/x+df(n/x,x);
}
int main()
{
int a[1001];
int i,j;
for(i=1;i<1001;i++)
a[i]=1;
for(i=2;i<1001;i++)
{
if(a[i]==1)
{
for(j=i+i;j<1001;j+=i)
a[j]=0;
}
}
int n;
while(~scanf("%d",&n))
{long long sum=1;
for(i=2;i<=n;i++)
{if(f[i])
{sum*=(df(n,i)+1);
sum%=(10*10*10*10*10*10*10*10*10+7);
}
}
printf("%lld\n",sum%(10*10*10*10*10*10*10*10*10+7));
}
return 0;
} | a.cc: In function 'int main()':
a.cc:28:7: error: 'f' was not declared in this scope
28 | {if(f[i])
| ^
|
s162711905 | p03830 | C++ | //#include <bits/stdc++.h>
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long LL;
const int mod=1e9+7;
int a[1010],num;
LL bit[1010];
bool isprime(int x){
if(x==1) return false;
int q=sqrt(x);
for(int i=2;i<=q;i++)
if(x%i==0) return false;
return true;
}
void init(){
num=0;
for(int i=1;i<=1000;i++)
if(isprime(i)) a[num++]=i;
}
void solve(int n){
for(int i=0;i<num;i++){
if(n%a[i]) continue;
while(n%a[i]==0){
bit[i]++;
n/=a[i];
}
}
}
int main()
{
int n;
scanf("%d",&n);
if(n==1){
puts("1");
return 0;
}
init();
for(int i=0;i<num;i++)
bit[i]=1;
for(int i=2;i<=n;i++){
solve(i);
}
LL ans=1;
for(int i=0;i<num;i++){
ans=ans*bit[i]%mod;
}
printf("%lld\n",ans);
return 0;
}
| a.cc: In function 'bool isprime(int)':
a.cc:14:11: error: 'sqrt' was not declared in this scope
14 | int q=sqrt(x);
| ^~~~
|
s775127054 | p03830 | C | #include <iostream>
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define ll long long
#define ld long double
#define sz(a) ((int)(a).size())
#define clr(a,v) memset(a, v, sizeof(a))
#define all(a) (a).begin(),(a).end()
#define pii pair<int,int>
#define pdd pair<ld,ld>
#define rep(i,a,b) for(int i=a; i<b; i++)
#define dec(i,a,b) for(int i=a; i>=b; i--)
#define ler freopen("inspection.in","r",stdin);freopen("inspection.out","w",stdout)
#define fastio ios::sync_with_stdio(0), cin.tie(0)
#define debug cout<<"!!?!!\n"
using namespace std;
#define PI 2*asin(1)
#define EPS 1e-9
#define MOD 1000000007
#define MAXN 101002
#define INF 2e9
int cont[1000];
void decomp(int n){
for(int i=2; i<=n && n>1; i++){
while(n%i==0){
cont[i]++;
n/=i;
}
}
}
ll ans(){
ll r=1;
rep(i,0,1000){
r*= (cont[i]+1);
r%= MOD;
}
return r;
}
int main(){
int n;
cin >> n;
rep(i,2,n+1) decomp(i);
cout << ans() << endl;
}
| main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s042518111 | p03830 | C | #include<iostream>
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define ll long long
#define ld long double
#define sz(a) ((int)(a).size())
#define clr(a,v) memset(a, v, sizeof(a))
#define all(a) (a).begin(),(a).end()
#define pii pair<int,int>
#define pdd pair<ld,ld>
#define rep(i,a,b) for(int i=a; i<b; i++)
#define dec(i,a,b) for(int i=a; i>=b; i--)
#define ler freopen("inspection.in","r",stdin);freopen("inspection.out","w",stdout)
#define fastio ios::sync_with_stdio(0), cin.tie(0)
#define debug cout<<"!!?!!\n"
using namespace std;
#define PI 2*asin(1)
#define EPS 1e-9
#define MOD 1000000007
#define MAXN 101002
#define INF 2e9
int cont[1000];
void decomp(int n){
for(int i=2; i<=n && n>1; i++){
while(n%i==0){
cont[i]++;
n/=i;
}
}
}
ll ans(){
ll r=1;
rep(i,0,1000){
r*= (cont[i]+1);
r%= MOD;
}
return r;
}
int main(){
int n;
cin >> n;
rep(i,2,n+1) decomp(i);
cout << ans() << endl;
}
| main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s013494592 | p03830 | C | #include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define ll long long
#define ld long double
#define sz(a) ((int)(a).size())
#define clr(a,v) memset(a, v, sizeof(a))
#define all(a) (a).begin(),(a).end()
#define pii pair<int,int>
#define pdd pair<ld,ld>
#define rep(i,a,b) for(int i=a; i<b; i++)
#define dec(i,a,b) for(int i=a; i>=b; i--)
#define ler freopen("inspection.in","r",stdin);freopen("inspection.out","w",stdout)
#define fastio ios::sync_with_stdio(0), cin.tie(0)
#define debug cout<<"!!?!!\n"
using namespace std;
#define PI 2*asin(1)
#define EPS 1e-9
#define MOD 1000000007
#define MAXN 101002
#define INF 2e9
int cont[1000];
void decomp(int n){
for(int i=2; i<=n && n>1; i++){
while(n%i==0){
cont[i]++;
n/=i;
}
}
}
ll ans(){
ll r=1;
rep(i,0,1000){
r*= (cont[i]+1);
r%= MOD;
}
return r;
}
int main(){
int n;
cin >> n;
rep(i,2,n+1) decomp(i);
cout << ans() << endl;
}
| main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s172352495 | p03830 | C++ | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
int n;
int qtd[1000];
const long long mod = 1e9+7;
int main() {
memset(qtd, 0, sizeof qtd);
cin >> n;
for (int i = 1; i <= n; i++) {
int pi = i;
int val = 2;
while(pi > 1) {
int cont = 0;
while(pi % val == 0) {
pi/=val;cont++;
}
qtd[val] += cont;
val++;
}
}
long long ans = 1;
for (int i = 1; i < 1000; i++) {
ans *= (qtd[i]+1);
ans%=mod;
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:11:5: error: 'memset' was not declared in this scope
11 | memset(qtd, 0, sizeof qtd);
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <queue>
+++ |+#include <cstring>
4 | using namespace std;
|
s868449221 | p03830 | Java |
import java.io.*;
import java.util.ArrayList;
import java.util.NoSuchElementException;
import java.util.Scanner;
import javafx.beans.binding.StringBinding;
public class Main {
static int a[]=new int[1000];
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N=sc.nextInt();
ArrayList<Integer> ar=new ArrayList();
//ar.add(1);
for (int i = 2; i < 1000; i++) {
boolean t =true;
for (int j = 2;t&& j < i; j++) {
if(i%j==0)
t=false;
}
if (t) {
ar.add(i);
}
}
int n=ar.size();
int c[]=new int[n];
long ans = 0;
for (int i = N; i >1; i--) {
int q=i;
int co=0;
boolean tfftf = true;
for (int j = 0;tfftf &&j < n; j++) {
int aaa=ar.get(j);
while(q%aaa==0){
q/=aaa;
c[j]++;
}
if(q==1)
tfftf=false;
}
}
ans=1;
for (int i = 0; i < n; i++) {
if(c[i]!=0)
ans*=c[i]+1;
ans%=1000000007;
}
System.out.println(ans);
}
}
| Main.java:6: error: package javafx.beans.binding does not exist
import javafx.beans.binding.StringBinding;
^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
|
s172251606 | p03830 | C++ | #include<iostream>
using namespace std;
#incldue<math.h>
int main(){
int n;
cin >> n;
cout << n % (pow(10,9) + 7) << endl;
} | a.cc:3:2: error: invalid preprocessing directive #incldue; did you mean #include?
3 | #incldue<math.h>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:8:18: error: 'pow' was not declared in this scope
8 | cout << n % (pow(10,9) + 7) << endl;
| ^~~
|
s000363905 | p03830 | C++ | #include<iostream>
using namespace std;
#incldue<cmath>
int main(){
int n;
cin >> n;
cout << n % (pow(10,9) + 7) << endl;
} | a.cc:3:2: error: invalid preprocessing directive #incldue; did you mean #include?
3 | #incldue<cmath>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:8:18: error: 'pow' was not declared in this scope
8 | cout << n % (pow(10,9) + 7) << endl;
| ^~~
|
s169057058 | p03830 | C++ | #include<iostream>
using name space std;
#incldue<cmath>
int main(){
int n;
cin >> n;
cout << n % (pow(10,9) + 7) << endl;
} | a.cc:3:2: error: invalid preprocessing directive #incldue; did you mean #include?
3 | #incldue<cmath>
| ^~~~~~~
| include
a.cc:2:7: error: expected nested-name-specifier before 'name'
2 | using name space std;
| ^~~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin >> n;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:8:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
8 | cout << n % (pow(10,9) + 7) << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:8:18: error: 'pow' was not declared in this scope
8 | cout << n % (pow(10,9) + 7) << endl;
| ^~~
a.cc:8:36: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
8 | cout << n % (pow(10,9) + 7) << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s862946719 | p03830 | C++ | #include <bits/stdc++.h>
using namespace std;
int T[1010],prime[1010],cnt;
bool ok[1010];
typedef long long LL;
LL MOD = 1000000007;
int main()
{
memset(ok,true,sizeof(ok));
for (int i=2;i<=1000;i++)
{
if (ok[i]) prime[++cnt]=i;
for (int j=2*i;j<=1000;j+=i)ok[j]=false;
}
//for (int i=1;i<=cnt;i++)printf("%d\n",prime[i]);
int N;
scanf("%d",&N);
for (int i=1;i<=N;i++)
{
int tmp=i;
for (int j=1;j<=cnt;j++)
{
while(tmp%prime[j]==0)
{
tmp/=prime1[j];
T[j]++;
}
}
}
LL ans=1;
for (int i=1;i<=cnt;i++)ans=ans*LL(T[i]+1)%MOD;
cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:28:38: error: 'prime1' was not declared in this scope; did you mean 'prime'?
28 | tmp/=prime1[j];
| ^~~~~~
| prime
|
s284721911 | p03830 | C++ | QvQ | a.cc:1:1: error: 'QvQ' does not name a type
1 | QvQ
| ^~~
|
s898271630 | p03830 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define inf (int)1000000007
#define rep(i, n) for(int i = 0; i < (n); i++)
#define trep(i, n) for(int i = 0; i <= (n); i++)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define trrep(i, n) for(int i = (n); i >= 0; i--)
bool u[1111];
int count(int x, int n) {
if(x % n) {
return 0;
}
return count(x / n, n) + 1;
}
signed main() {
int n;
trep(i, n) {
u[i] = true;
}
int ans = 1;
for(int i = 2; i <= n; i++) {
if(u[i]) {
int now = 0;
for(int j = i; j <= n; j += i) {
now += cout(j, i);
u[i] = false;
}
ans = (ans * (now + 1)) % 1000000007;
}
}
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:32:20: error: no match for call to '(std::ostream {aka std::basic_ostream<char>}) (long long int&, long long int&)'
32 | now += cout(j, i);
| ~~~~^~~~~~
|
s227768034 | p03830 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define inf (int)1000000007
#define rep(i, n) for(int i = 0; i < (n); i++)
#define trep(i, n) for(int i = 0; i <= (n); i++)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define trrep(i, n) for(int i = (n); i >= 0; i--)
bool u[1111];
int count(int x, int n) {
if(x % n) {
return 0;
}
return cout(x / n, n) + 1;
}
signed main() {
int n;
trep(i, n) {
u[i] = true;
}
int ans = 1;
for(int i = 2; i <= n; i++) {
if(u[i]) {
int now = 0;
for(int j = i; j <= n; j += i) {
now += cout(j, i);
u[i] = false;
}
ans = (ans * (now + 1)) % 1000000007;
}
}
cout << ans << endl;
}
| a.cc: In function 'long long int count(long long int, long long int)':
a.cc:19:14: error: no match for call to '(std::ostream {aka std::basic_ostream<char>}) (long long int, long long int&)'
19 | return cout(x / n, n) + 1;
| ~~~~^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:32:20: error: no match for call to '(std::ostream {aka std::basic_ostream<char>}) (long long int&, long long int&)'
32 | now += cout(j, i);
| ~~~~^~~~~~
|
s310149849 | p03830 | Java | import java.io.InputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.OutputStreamWriter;
import java.io.IOException;
import java.math.BigInteger;
import java.util.*;
import java.util.stream.Stream;
/**
*
* @author Pradyumn Agrawal coderbond007
*/
public class Main{
public static InputStream inputStream = System.in;
public static FastReader in = new FastReader(inputStream);
public static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
public static void main(String[] args)throws java.lang.Exception
{
new Main().run();
out.close();
}
void run() throws java.lang.Exception
{
int[] primes = sieveEratosthenes(10000);
int n = ni();
long mod = (int)1e9 + 7;
long ans = 1;
for(int i = 0;n/primes[i] != 0; ++i) {
int power = 0;
int pri = primes[i];
int f = pri;
int count = 1;
while(n/f != 0) {
power += n/f;
++count;
f = (int)Math.pow(pri,count);
}
power++;
ans = ans * power;
if(ans >= mod) ans %= mod;
}
out.println(ans);
}
public static int[] sieveEratosthenes(int n) {
if(n <= 32){
int[] primes = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31 };
for(int i = 0;i < primes.length;i++){
if(n < primes[i]){
return Arrays.copyOf(primes, i);
}
}
return primes;
}
int u = n + 32;
double lu = Math.log(u);
int[] ret = new int[(int) (u / lu + u / lu / lu * 1.5)];
ret[0] = 2;
int pos = 1;
int[] isp = new int[(n + 1) / 32 / 2 + 1];
int sup = (n + 1) / 32 / 2 + 1;
int[] tprimes = { 3, 5, 7, 11, 13, 17, 19, 23, 29, 31 };
for(int tp : tprimes){
ret[pos++] = tp;
int[] ptn = new int[tp];
for(int i = (tp - 3) / 2;i < tp << 5;i += tp)
ptn[i >> 5] |= 1 << (i & 31);
for(int i = 0;i < tp;i++){
for(int j = i;j < sup;j += tp)
isp[j] |= ptn[i];
}
}
// 3,5,7
// 2x+3=n
int[] magic = { 0, 1, 23, 2, 29, 24, 19, 3, 30, 27, 25, 11, 20, 8, 4,
13, 31, 22, 28, 18, 26, 10, 7, 12, 21, 17, 9, 6, 16, 5, 15, 14 };
int h = n / 2;
for(int i = 0;i < sup;i++){
for(int j = ~isp[i];j != 0;j &= j - 1){
int pp = i << 5 | magic[(j & -j) * 0x076be629 >>> 27];
int p = 2 * pp + 3;
if(p > n)
break;
ret[pos++] = p;
for(int q = pp;q <= h;q += p)
isp[q >> 5] |= 1 << (q & 31);
}
}
return Arrays.copyOf(ret, pos);
}
public static int[] enumLowestPrimeFactors(int n) {
int tot = 0;
int[] lpf = new int[n + 1];
int u = n + 32;
double lu = Math.log(u);
int[] primes = new int[(int) (u / lu + u / lu / lu * 1.5)];
for (int i = 2; i <= n; i++)
lpf[i] = i;
for (int p = 2; p <= n; p++) {
if (lpf[p] == p)
primes[tot++] = p;
int tmp;
for (int i = 0; i < tot && primes[i] <= lpf[p] && (tmp = primes[i] * p) <= n; i++) {
lpf[tmp] = primes[i];
}
}
return lpf;
}
private static int ni(){
return in.nextInt();
}
private static long nl(){
return in.nextLong();
}
private static String ns(){
return in.nextString();
}
private static char nc(){
return in.nextCharacter();
}
private static double nd(){
return in.nextDouble();
}
private static char[] ns(int n)
{
char[] a = new char[n];
for(int i=0;i<n;i++) a[i] = nc();
return a;
}
private static char[][] nm(int n, int m)
{
char[][] map = new char[n][];
for(int i=0;i<n;i++) map[i] = ns(m);
return map;
}
private static int[] na(int n)
{
int[] a = new int[n];
for(int i=0;i<n;i++) a[i] = ni();
return a;
}
private static long[] nal(int n)
{
long[] a = new long[n];
for(int i=0;i<n;i++) a[i] = nl();
return a;
}
//private void tr(Object... o) { if(o.length() > 0)System.out.println(Arrays.deepToString(o)); }
}
class FastReader{
private boolean finished = false;
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numChars;
private SpaceCharFilter filter;
public FastReader(InputStream stream){
this.stream = stream;
}
public int read(){
if (numChars == -1){
throw new InputMismatchException ();
}
if (curChar >= numChars){
curChar = 0;
try{
numChars = stream.read (buf);
} catch (IOException e){
throw new InputMismatchException ();
}
if (numChars <= 0){
return -1;
}
}
return buf[curChar++];
}
public int peek(){
if (numChars == -1){
return -1;
}
if (curChar >= numChars){
curChar = 0;
try{
numChars = stream.read (buf);
} catch (IOException e){
return -1;
}
if (numChars <= 0){
return -1;
}
}
return buf[curChar];
}
public int nextInt(){
int c = read ();
while (isSpaceChar (c))
c = read ();
int sgn = 1;
if (c == '-'){
sgn = -1;
c = read ();
}
int res = 0;
do{
if(c==','){
c = read();
}
if (c < '0' || c > '9'){
throw new InputMismatchException ();
}
res *= 10;
res += c - '0';
c = read ();
} while (!isSpaceChar (c));
return res * sgn;
}
public long nextLong(){
int c = read ();
while (isSpaceChar (c))
c = read ();
int sgn = 1;
if (c == '-'){
sgn = -1;
c = read ();
}
long res = 0;
do{
if (c < '0' || c > '9'){
throw new InputMismatchException ();
}
res *= 10;
res += c - '0';
c = read ();
} while (!isSpaceChar (c));
return res * sgn;
}
public String nextString(){
int c = read ();
while (isSpaceChar (c))
c = read ();
StringBuilder res = new StringBuilder ();
do{
res.appendCodePoint (c);
c = read ();
} while (!isSpaceChar (c));
return res.toString ();
}
public boolean isSpaceChar(int c){
if (filter != null){
return filter.isSpaceChar (c);
}
return isWhitespace (c);
}
public static boolean isWhitespace(int c){
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
private String readLine0(){
StringBuilder buf = new StringBuilder ();
int c = read ();
while (c != '\n' && c != -1){
if (c != '\r'){
buf.appendCodePoint (c);
}
c = read ();
}
return buf.toString ();
}
public String nextLine(){
String s = readLine0 ();
while (s.trim ().length () == 0)
s = readLine0 ();
return s;
}
public String nextLine(boolean ignoreEmptyLines){
if (ignoreEmptyLines){
return nextLine ();
}else{
return readLine0 ();
}
}
public BigInteger nextBigInteger(){
try{
return new BigInteger (nextString());
} catch (NumberFormatException e){
throw new InputMismatchException ();
}
}
public char nextCharacter(){
int c = read ();
while (isSpaceChar (c))
c = read ();
return (char) c;
}
public double nextDouble(){
int c = read ();
while (isSpaceChar (c))
c = read ();
int sgn = 1;
if (c == '-'){
sgn = -1;
c = read ();
}
double res = 0;
while (!isSpaceChar (c) && c != '.'){
if (c == 'e' || c == 'E'){
return res * Math.pow (10, nextInt ());
}
if (c < '0' || c > '9'){
throw new InputMismatchException ();
}
res *= 10;
res += c - '0';
c = read ();
}
if (c == '.'){
c = read ();
double m = 1;
while (!isSpaceChar (c)){
if (c == 'e' || c == 'E'){
return res * Math.pow (10, nextInt ());
}
if (c < '0' || c > '9'){
throw new InputMismatchException ();
}
m /= 10;
res += (c - '0') * m;
c = read ();
}
}
return res * sgn;
}
public boolean isExhausted(){
int value;
while (isSpaceChar (value = peek ()) && value != -1)
read ();
return value == -1;
}
public SpaceCharFilter getFilter(){
return filter;
}
public void setFilter(SpaceCharFilter filter){
this.filter = filter;
}
public interface SpaceCharFilter{
public boolean isSpaceChar(int ch);
}
} | Main.java:9: error: illegal character: '\u00a0'
?
^
Main.java:10: error: illegal character: '\u00a0'
?
^
Main.java:19: error: illegal character: '\u00a0'
?
^
Main.java:57: error: illegal character: '\u00a0'
?
^
Main.java:63: error: illegal character: '\u00a0'
?
^
Main.java:66: error: illegal character: '\u00a0'
?
^
Main.java:78: error: illegal character: '\u00a0'
?
^
Main.java:95: error: illegal character: '\u00a0'
?
^
Main.java:131: error: illegal character: '\u00a0'
?
^
Main.java:138: error: illegal character: '\u00a0'
?
^
Main.java:145: error: illegal character: '\u00a0'
?
^
Main.java:152: error: illegal character: '\u00a0'
?
^
Main.java:161: error: illegal character: '\u00a0'
?
^
Main.java:162: error: class, interface, enum, or record expected
class FastReader{
^
Main.java:164: error: illegal character: '\u00a0'
?
^
Main.java:165: error: unnamed classes are a preview feature and are disabled by default.
private InputStream stream;
^
(use --enable-preview to enable unnamed classes)
Main.java:170: error: illegal character: '\u00a0'
?
^
Main.java:171: error: class, interface, enum, or record expected
public FastReader(InputStream stream){
^
Main.java:173: error: class, interface, enum, or record expected
}
^
Main.java:174: error: illegal character: '\u00a0'
?
^
Main.java:192: error: illegal character: '\u00a0'
?
^
Main.java:210: error: illegal character: '\u00a0'
?
^
Main.java:234: error: illegal character: '\u00a0'
?
^
Main.java:255: error: illegal character: '\u00a0'
?
^
Main.java:267: error: illegal character: '\u00a0'
?
^
Main.java:274: error: illegal character: '\u00a0'
?
^
Main.java:278: error: illegal character: '\u00a0'
?
^
Main.java:290: error: illegal character: '\u00a0'
?
^
Main.java:297: error: illegal character: '\u00a0'
?
^
Main.java:305: error: illegal character: '\u00a0'
?
^
Main.java:313: error: illegal character: '\u00a0'
?
^
Main.java:320: error: illegal character: '\u00a0'
?
^
Main.java:359: error: illegal character: '\u00a0'
?
^
Main.java:369: error: illegal character: '\u00a0'
?
^
Main.java:373: error: illegal character: '\u00a0'
?
^
Main.java:377: error: class, interface, enum, or record expected
}
^
36 errors
|
s956353189 | p03830 | C++ | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
int N, A, B, pos;
scanf("%d %d %d", &N, &A, &B);
ll ans = 0;
int cur = 1;
while(N--)
{
scanf("%d", &pos);
ans = ans + min(B, 1ll * (pos - cur) * A );
cur = pos;
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:14:24: error: no matching function for call to 'min(int&, long long int)'
14 | ans = ans + min(B, 1ll * (pos - cur) * A );
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:14:24: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
14 | ans = ans + min(B, 1ll * (pos - cur) * A );
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:14:24: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
14 | ans = ans + min(B, 1ll * (pos - cur) * A );
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
s118212729 | p03830 | C | #include <stdio.h>
#include <math.h>
const int mod = (int)1e9 + 7;
bool is_prime(int n){
for(int i = 2; i <= (int)sqrt(n); i ++){
if(n % i == 0){
return false;
}
}
return true;
}
int main(){
int n;
int j = 0, k = 0;
int primes[1000];
int foo[1000];
scanf("%d", &n);
for(int i = 2; i <= n; i ++){
if(is_prime(i)){
primes[j++] = i;
}
}
for(int i = 0; i < j; i ++){
int s = 0;
int cur_prime = primes[i];
// printf("%d ", cur_prime);
while(cur_prime <= n){
s += floor(n / (1.0 * cur_prime));
cur_prime *= primes[i];
}
foo[k ++] = s;
}
int res = 1;
for(int i = 0; i < k; i ++){
res = (long long)res * (foo[i] + 1) % mod;
}
printf("%d\n", res);
}
| main.c:4:1: error: unknown type name 'bool'
4 | bool is_prime(int n){
| ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
2 | #include <math.h>
+++ |+#include <stdbool.h>
3 | const int mod = (int)1e9 + 7;
main.c: In function 'is_prime':
main.c:7:20: error: 'false' undeclared (first use in this function)
7 | return false;
| ^~~~~
main.c:7:20: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:7:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:12: error: 'true' undeclared (first use in this function)
10 | return true;
| ^~~~
main.c:10:12: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
|
s528520737 | p03830 | C | #include <stdio.h>
#include <cmath>
const int mod = (int)1e9 + 7;
bool is_prime(int n){
for(int i = 2; i <= (int)sqrt(n); i ++){
if(n % i == 0){
return false;
}
}
return true;
}
int main(){
int n;
int j = 0, k = 0;
int primes[1000];
int foo[1000];
scanf("%d", &n);
for(int i = 2; i <= n; i ++){
if(is_prime(i)){
primes[j++] = i;
}
}
for(int i = 0; i < j; i ++){
int s = 0;
int cur_prime = primes[i];
// printf("%d ", cur_prime);
while(cur_prime <= n){
s += floor(n / (1.0 * cur_prime));
cur_prime *= primes[i];
}
foo[k ++] = s;
}
int res = 1;
for(int i = 0; i < k; i ++){
res = (long long)res * (foo[i] + 1) % mod;
}
printf("%d\n", res);
}
| main.c:2:10: fatal error: cmath: No such file or directory
2 | #include <cmath>
| ^~~~~~~
compilation terminated.
|
s400029277 | p03830 | C++ | #include <cstdio>
using namespace std;
typedef long long Int;
int main() {
int N;
const int Nmax = 1000;
const Int div = 1000000007;
Int A[Nmax + 1];
scanf_s("%d", &N);
A[1] = 1;
for (int i = 2; i <= N; i++) {
A[i] = (A[i - 1] * 2) % div;
}
printf("%lld\n", A[N]);
return 0;
} | a.cc: In function 'int main()':
a.cc:12:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
12 | scanf_s("%d", &N);
| ^~~~~~~
| scanf
|
s839656515 | p03830 | C++ | #include <cstdio>
using namespace std;
typedef long long Int;
int main() {
int N;
const int Nmax = 1000;
const Int div = 1000000007;
Int A[Nmax + 1];
scanf_s("%d", &N);
A[1] = 1;
for (int i = 2; i <= N; i++) {
A[i] = (A[i - 1] * 2) % div;
}
printf("%d %lld\n", N, A[N]);
return 0;
} | a.cc: In function 'int main()':
a.cc:12:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
12 | scanf_s("%d", &N);
| ^~~~~~~
| scanf
|
s228505676 | p03830 | C++ | import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
sc.close();
if(n<3){
System.out.println(n);
return;
}
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(2);
for(int i=3; i<=n; i++){
boolean b = true;
for(int j=0; j<list.size(); j++){
if(i % list.get(j) == 0){
b = false;
break;
}
}
if(b){
list.add(i);
}
}
long[][] num = new long[n][list.size()];
for(int i=1; i<=n; i++){
int x = i;
for(int j=0; j<list.size(); j++){
while(x % list.get(j) == 0){
num[i-1][j]++;
x /= list.get(j);
}
}
}
long[] sum = new long[list.size()];
for(int i=1; i<=n; i++){
for(int j=0; j<list.size(); j++){
sum[j] += num[i-1][j];
}
}
long ans = 1;
for(int i=0; i<list.size(); i++){
if(sum[i] != 0){
ans *= sum[i] + 1L;
}
if(ans >= 1000000007L){
ans %= 1000000007L;
}
}
System.out.println(ans);
}
} | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.ArrayList;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.Scanner;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
4 | public class Main {
| ^~~~~~
|
s184614068 | p03830 | C++ | サンプルの数字見間違えてた | a.cc:1:1: error: '\U000030b5\U000030f3\U000030d7\U000030eb\U0000306e\U00006570\U00005b57\U0000898b\U00009593\U00009055\U00003048\U00003066\U0000305f' does not name a type
1 | サンプルの数字見間違えてた
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
s248656509 | p03830 | C++ | import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;
const long MOD = 1_000_000_007;
void main(){
int n = readln.chomp.to!int;
int[] ps; // primes
int[int] cs; // prime -> count
for(int i = 2; i < 1000; i ++){
int f = 1;
for(int j = 2; j <= i / 2; j ++){
if(i % j == 0) f = 0;
}
if(f){
ps ~= i;
cs[i] = 0;
}
}
for(int i = 2; i <= n; i ++){
int x = i;
foreach(p; ps){
while(x % p == 0){
cs[p] += 1;
x /= p;
}
}
}
BigInt ans;
ans = 1;
foreach(p; ps){
ans *= cs[p] + 1;
ans %= MOD;
}
ans.writeln;
} | a.cc:1:1: error: 'import' does not name a type
1 | import std.stdio;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import std.conv, std.array, std.algorithm, std.string;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import std.math, std.random, std.range, std.datetime;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
4 | import std.bigint;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:18: error: unable to find numeric literal operator 'operator""_000_000_007'
6 | const long MOD = 1_000_000_007;
| ^~~~~~~~~~~~~
a.cc:8:1: error: '::main' must return 'int'
8 | void main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:9:17: error: 'readln' was not declared in this scope
9 | int n = readln.chomp.to!int;
| ^~~~~~
a.cc:11:12: error: structured binding declaration cannot have type 'int'
11 | int[] ps; // primes
| ^~
a.cc:11:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:11:12: error: empty structured binding declaration
a.cc:11:15: error: expected initializer before 'ps'
11 | int[] ps; // primes
| ^~
a.cc:12:13: error: expected identifier before 'int'
12 | int[int] cs; // prime -> count
| ^~~
a.cc:12:13: error: expected ']' before 'int'
12 | int[int] cs; // prime -> count
| ^~~
| ]
a.cc:12:12: error: structured binding declaration cannot have type 'int'
12 | int[int] cs; // prime -> count
| ^
a.cc:12:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:12:12: error: empty structured binding declaration
a.cc:12:18: error: expected initializer before 'cs'
12 | int[int] cs; // prime -> count
| ^~
a.cc:19:25: error: 'ps' was not declared in this scope
19 | ps ~= i;
| ^~
a.cc:20:25: error: 'cs' was not declared in this scope
20 | cs[i] = 0;
| ^~
a.cc:27:25: error: 'p' was not declared in this scope
27 | foreach(p; ps){
| ^
a.cc:27:28: error: 'ps' was not declared in this scope
27 | foreach(p; ps){
| ^~
a.cc:35:9: error: 'BigInt' was not declared in this scope
35 | BigInt ans;
| ^~~~~~
a.cc:36:9: error: 'ans' was not declared in this scope
36 | ans = 1;
| ^~~
a.cc:37:17: error: 'p' was not declared in this scope
37 | foreach(p; ps){
| ^
a.cc:37:20: error: 'ps' was not declared in this scope
37 | foreach(p; ps){
| ^~
|
s064211275 | p03830 | Java | import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;
public class A {
private void solve(Scanner in, PrintWriter out) {
int N = in.nextInt();
int[] primes = getPrimes(N + 1);
TreeMap<Integer, Integer> count = new TreeMap<>();
for (int n = 1; n <= N; n++) {
int x = n;
for (int prime : primes) {
while (x % prime == 0) {
Integer c = count.get(prime);
if (c == null)
count.put(prime, 1);
else
count.put(prime, c + 1);
x /= prime;
}
if (x == 1) break;
}
}
int MOD = (int) (1e9 + 7);
long ans = 1;
for (Map.Entry<Integer, Integer> entry : count.entrySet()) {
ans *= (entry.getValue() + 1);
ans %= MOD;
}
out.println(ans);
}
public static int[] getPrimes(int N) {
ArrayList<Integer> primes = new ArrayList<>();
boolean[] isComposite = new boolean[N + 1];
primes.add(2);
for (int i = 3; i <= N; i += 2)
if (!isComposite[i]) {
primes.add(i);
for (int j = i * 2; j <= N; j += i) {
isComposite[j] = true;
}
}
int[] array = new int[primes.size()];
for (int i = 0; i < primes.size(); i++) {
array[i] = primes.get(i);
}
return array;
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
PrintWriter out = new PrintWriter(System.out);
new A().solve(in, out);
in.close();
out.close();
}
}
| Main.java:7: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s557889756 | p03831 | Java | public class Main {
public static void main(String[] args) {
new Main().run();
}
void run() {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int a = sc.nextInt();
int b = sc.nextInt();
int[] x = new int[n];
for (int i = 0; i < n; i++) {
x[i] = sc.nextInt();
}
int ans = 0;
for (int i = 1; i < n; i++) {
int d = x[i] - x[i-1];
if( a * d < b) {
ans += a * d;
}else{
ans += b;
};
}
System.out.println(ans);
}
} | Main.java:7: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:7: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s627997125 | p03831 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long N,A,B;cin>>A>>B;vector<long long>C(N);
for(int X=0;X<N;X++){
cin>>C[X];
}
long long V=0;
for(int X=1;X<N;X++){
if((C[X]-C[X-1])*A>B)V+=C[X]-C[X-1])*A;
else V+=B;
}
cout<<V<<endl;
} | a.cc: In function 'int main()':
a.cc:10:40: error: expected ';' before ')' token
10 | if((C[X]-C[X-1])*A>B)V+=C[X]-C[X-1])*A;
| ^
| ;
|
s800398570 | p03831 | C++ | #pragma region header
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cctype>
#include <assert.h>
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <math.h>
#include <cstring>
#include <array>
// ===============================================================
//using系
#pragma region header
using namespace std;
using lint = long long;
using ld = long double;
using ulint = unsigned long long;
const int dx[] = { 1,0,-1,0 };
const int dy[] = { 0,1,0,-1 };
constexpr lint mod = 1000000007;
constexpr long double pi = 3.141592653589793238462643383279;
#pragma endregion
// ========================================================================
//define
#define INF (lint)10000000000000000;
#define mod (int)1000000007
#pragma region header
template <class T, class U>
inline bool chmin(T& lhs, const U& rhs) {
if (lhs > rhs) {
lhs = rhs;
return 1;
}
return 0;
}
template <class T, class U>
inline bool chmax(T& lhs, const U& rhs) {
if (lhs < rhs) {
lhs = rhs;
return 1;
}
return 0;
}
#pragma endregion
#pragma endregion
int main(void) {
lint n, a, b;
scanf_s("%lld%lld%lld", &n, &a, &b);
vector<lint> d(n);
for (int i = 0; i < n; i++) scanf_s("%lld", &d[i]);
lint ans = 0;
for (int i = 0; i < n - 1; i++) {
if ((d[i + 1] - d[i]) * a > b) ans += b;
else ans += a * (d[i + 1] - d[i]);
}
printf("%lld\n", ans);
return 0;
} | a.cc: In function 'int main()':
a.cc:76:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
76 | scanf_s("%lld%lld%lld", &n, &a, &b);
| ^~~~~~~
| scanf
|
s079686974 | p03831 | Java | import java.io.*;
public class Main {
public static void main(String args[])throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int N = Integer.parseInt(st.nextToken());
int A = Integer.parseInt(st.nextToken());
int B = Integer.parseInt(st.nextToken());
st = new StringTokenizer(br.readLine());
int[] arr = new int[N];
int i = 1;
long ans = 0;
arr[0] = Integer.parseInt(st.nextToken());
while(st.hasMoreTokens()) {
arr[i] = Integer.parseInt(st.nextToken());
int dif = arr[i] - arr[i-1];
if(dif*A > B) {
ans += B;
} else {
ans += (dif*A);
}
i++;
}
System.out.println(ans);
}
} | Main.java:6: error: cannot find symbol
StringTokenizer st = new StringTokenizer(br.readLine());
^
symbol: class StringTokenizer
location: class Main
Main.java:6: error: cannot find symbol
StringTokenizer st = new StringTokenizer(br.readLine());
^
symbol: class StringTokenizer
location: class Main
Main.java:11: error: cannot find symbol
st = new StringTokenizer(br.readLine());
^
symbol: class StringTokenizer
location: class Main
3 errors
|
s894409155 | p03831 | C++ | #include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
typedef long long ll;
using namespace std;
const ll INF = 1e9;
const ll MOD = 1e9 + 7;
#define repi(i, n, init) for (ll i = init; i < (n); i++)
int main()
{
int n, a, b;
cin >> n >> a >> b;
vector<ll> X(n);
repi(i, n, 0) cin >> X[i];
ll ans = 0;
repi(i, n, 1)
{
ans += min(b, a * abs(X[i] - X[i - 1]));
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:20:19: error: no matching function for call to 'min(int&, long long int)'
20 | ans += min(b, a * abs(X[i] - X[i - 1]));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:20:19: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
20 | ans += min(b, a * abs(X[i] - X[i - 1]));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:20:19: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
20 | ans += min(b, a * abs(X[i] - X[i - 1]));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
s612121931 | p03831 | C++ | #include <iostream>
#include <iomanip>
#include <algorithm>
typedef long long ll;
using namespace std;
const ll INF = 1e9;
const ll MOD = 1e9 + 7;
#define repi(i, n, init) for (ll i = init; i < (n); i++)
int main()
{
int n, a, b;
cin >> n >> a >> b;
vector<int> X(n);
repi(i, n, 0) cin >> X[i];
ll ans = 0;
repi(i, n, 1)
{
ans += min(b, a * abs(x[i] - x[i - 1]);)
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:14:5: error: 'vector' was not declared in this scope
14 | vector<int> X(n);
| ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
3 | #include <algorithm>
+++ |+#include <vector>
4 | typedef long long ll;
a.cc:14:12: error: expected primary-expression before 'int'
14 | vector<int> X(n);
| ^~~
a.cc:15:26: error: 'X' was not declared in this scope
15 | repi(i, n, 0) cin >> X[i];
| ^
a.cc:19:31: error: 'x' was not declared in this scope
19 | ans += min(b, a * abs(x[i] - x[i - 1]);)
| ^
a.cc:19:48: error: expected primary-expression before ')' token
19 | ans += min(b, a * abs(x[i] - x[i - 1]);)
| ^
|
s572990355 | p03831 | C++ | #include <bits/stdc++.h>
using namespace std;
void solve(long long N, long long A, long long B, std::vector<long long> X) {
int tmp = 0;
for(int i = 1;i<N;i++){
tmp+=min((x[i]-x[i-1])*A,B);
}
cout<<tmp;
}
// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools (tips: You
// use the default template now. You can remove this line by using your custom
// template)
int main() {
long long N;
scanf("%lld", &N);
long long A;
scanf("%lld", &A);
long long B;
scanf("%lld", &B);
std::vector<long long> X(N);
for (int i = 0; i < N; i++) {
scanf("%lld", &X[i]);
}
solve(N, A, B, std::move(X));
return 0;
}
| a.cc: In function 'void solve(long long int, long long int, long long int, std::vector<long long int>)':
a.cc:7:17: error: 'x' was not declared in this scope
7 | tmp+=min((x[i]-x[i-1])*A,B);
| ^
|
s793594815 | p03831 | C | #include <stdio.h>
#include <stdlib.h>
typedef long long ll;
#define N 100009
int main() {
int n, a, b, x[N], i;
ll tired = 0;
scanf("%d %d %d\n%d", &n, &a, &b, &x[1]);
for (i = 2; i <= n; i++) {
scanf("%d", &x[i]);
tired += min(a * (x[i] - x[i - 1]), b);
}
printf("%lld", tired);
}
| main.c: In function 'main':
main.c:12:26: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
12 | tired += min(a * (x[i] - x[i - 1]), b);
| ^~~
| main
|
s927568972 | p03831 | C | #include <stdio.h>
#include <stdlib.h>
typedef long long ll;
#define N 100009
int main() {
int n, a, b, x[N] = { 0 }, i;
ll tired = 0;
scanf("%d %d %d\n%d", &n, &a, &b, &x[1]);
for (i = 2; i <= n; i++) {
scanf("%d", &x[i]);
tired += min(a * (x[i] - x[i - 1]), b);
}
printf("%lld", tired);
} | main.c: In function 'main':
main.c:12:26: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
12 | tired += min(a * (x[i] - x[i - 1]), b);
| ^~~
| main
|
s460735497 | p03831 | C | #include <stdio.h>
#include <stdlib.h>
typedef long long ll;
#define N 100001
int main() {
int n, a, b, x[N] = { 0 }, i;
ll tired = 0;
scanf("%d %d %d\n%d", &n, &a, &b, &x[0]);
for (i = 1; i < n; i++) {
scanf("%d", &x[i]);
tired += min(a * (x[i] - x[i - 1]), b);
}
printf("%lld", tired);
}
| main.c: In function 'main':
main.c:12:26: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
12 | tired += min(a * (x[i] - x[i - 1]), b);
| ^~~
| main
|
s414570056 | p03831 | C | #include <stdio.h>
#include <stdlib.h>
typedef long long ll;
#define N 1000000007
int main() {
int n, a, b, x[N] = { 0 }, i;
ll tired=0;
scanf("%d %d %d\n%d", &n, &a, &b, &x[0]);
for (i = 1; i < n; i++) {
scanf("%d", &x[i]);
tired += min(a*(x[i]-x[i-1]),b);
}
printf("%lld", tired);
} | main.c: In function 'main':
main.c:12:26: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
12 | tired += min(a*(x[i]-x[i-1]),b);
| ^~~
| main
|
s255894699 | p03831 | C++ | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pb push_back
typedef long long ll;
typedef long double ld;
typedef pair<ll ,ll > pll;
typedef pair<int ,int > pii;
const ld pi=3.14159265359;
const int maxn=2e5+7;
const int mod=1e9+7;
const ll INF=9223372036854775807;
const int inf=2e9+7;
/*Almost copy pasted part :)*/
int a[maxn];
int main(){
int n;
cin>>n;
int A,B;
cin>>A>>B;
for(int i=1;i<=n;i++){
cin>>a[i];
}
ll ans=0;
for(int i=1;i<=n-1;i++){
int dis=a[i+1]-a[i];
ll ret=A*dis;
ans+=min(ret,B);
}
cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:30:25: error: no matching function for call to 'min(ll&, int&)'
30 | ans+=min(ret,B);
| ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:30:25: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
30 | ans+=min(ret,B);
| ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:30:25: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
30 | ans+=min(ret,B);
| ~~~^~~~~~~
|
s778074920 | p03831 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll n, a, b; cin >> a >> b;
vector<ll> v(n);
ll res = 0;
ll p; cin >> p;
for (int i = 0; i < n-1; i++) {
ll x; cin >> x;
res += min((x - p) * a, b));
p = x;
}
cout << res << endl;
} | a.cc: In function 'int main()':
a.cc:11:31: error: expected ';' before ')' token
11 | res += min((x - p) * a, b));
| ^
| ;
|
s034822909 | p03831 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int n, a, b; cin >> a >> b;
vector<ll> v(n);
ll res = 0;
ll p; cin >> p;
for (int i = 0; i < n-1; i++) {
ll x; cin >> x;
res += min((x - p) * a, b));
p = x;
}
cout << res << endl;
} | a.cc: In function 'int main()':
a.cc:11:15: error: no matching function for call to 'min(ll, int&)'
11 | res += min((x - p) * a, b));
| ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:11:15: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
11 | res += min((x - p) * a, b));
| ~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:11:15: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
11 | res += min((x - p) * a, b));
| ~~~^~~~~~~~~~~~~~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.