submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s475147447 | p03676 | C++ | #include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
using namespace std;
const int maxn=1e5+7;
const int mod=1e9+7;
int a[maxn];
int vis[max... | a.cc: In function 'int main()':
a.cc:44:48: error: expected ';' before 'cout'
44 | while (ans<0) ans=(ans+mod)%mod
| ^
| ;
45 | cout<<ans<<endl;
| ~~~~ ... |
s942517088 | p03676 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
#include<cstdio>
#include<cstdlib>
using namespace std;
#define r... | a.cc: In function 'int main()':
a.cc:86:56: error: expected ',' or ';' before ')' token
86 | int ans = (C.comb(n+1,i)-C.comb(n-r+l,i-1))+MOD)%MOD;
| ^
|
s489876704 | p03676 | C++ | #include<iostream>
#include<string>
#include<cstdio>
#include <cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#i... | a.cc: In function 'll comb(ll, ll)':
a.cc:68:12: error: 'rt' was not declared in this scope; did you mean 'ret'?
68 | return rt;
| ^~
| ret
|
s426636539 | p03676 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) FOR(i,0,b)
#define INF mugen
#define dump(x) cerr<<#x<<"="<<x<<endl
#define ALL(a) (a).begin(),(a).end()
#define EACH(e,v) for(auto& e:v)
#define SORT(v) sort(ALL(v))
#define PERM(v) SORT(v);for(bool c##p=1;c##p;c##p=... | a.cc: In function 'int main()':
a.cc:75:100: error: expected ';' before ')' token
75 | else cout<<(COM(n-1,k)+COM(idx+c,k-1)+2*(COM(idx+b+c,k-1)-COM(idx+c,k-1))%mod+COM(n-1,k-2)))%mod<<endl;
| ^
| ... |
s337705957 | p03676 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL N=1e5+100;
const LL MOD=1e9+7;
int n;
LL a[N];
int v[N];
LL fac[N],finv[N],inv[N];
void make()
{
fac[0]=fac[1]=1;
finv[0]=finv[1]=1;
inv[1]=1;
for(int i=2;i<100010;i++)
{
inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
fac[i]=fac[i-1]* i%MOD;... | a.cc: In function 'int main()':
a.cc:49:14: error: 'i' was not declared in this scope
49 | for (i=0;i<=n;i++)
| ^
|
s001573301 | p03676 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL N=1e5+100;
const LL MOD=1e9+7;
int n;
LL a[N];
int v[N];
LL fac[N],finv[N],inv[N];
void make()
{
fac[0]=fac[1]=1;
finv[0]=finv[1]=1;
inv[1]=1;
for(int i=2;i<100010;i++)
{
inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
fac[i]=fac[i-1]* i%MOD;... | a.cc: In function 'int main()':
a.cc:49:14: error: 'i' was not declared in this scope
49 | for (i=0;i<=n;i++)
| ^
|
s219328232 | p03676 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL mod = 1e9+7;
int maxn;
int vis[100005];
LL fac[100005]={1,1};
LL opp[100005]={1,1};
LL fi[100005]={1,1};
void init()
{
for(int i=2; i<=100000; ++i)
{
fac[i] = fac[i-1]*i%mod;
opp[i] = (mod-mod/i)*opp[mod%i]%mod;
... | a.cc: In function 'LL c(LL, LL)':
a.cc:21:19: error: 'op_fa' was not declared in this scope
21 | return fac[n]*op_fa[n-m]%mod*op_fa[m]%mod;
| ^~~~~
a.cc: In function 'int main()':
a.cc:32:20: error: 'mak' was not declared in this scope
32 | if(mak[temp])
| ... |
s678212634 | p03676 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;
return c+i_7;
}
using namespace std;
//typedef long long ll;
long long po(long a, long ... | a.cc: In function 'int main()':
a.cc:58:10: error: wrong number of template arguments (1, should be at least 2)
58 | map<int> mp;
| ^
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/inc... |
s037865441 | p03676 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;
return c+i_7;
}
using namespace std;
//typedef long long ll;
long long po(long a, long ... | a.cc: In function 'int main()':
a.cc:58:10: error: wrong number of template arguments (1, should be at least 2)
58 | map<int> mp;
| ^
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/inc... |
s324542152 | p03676 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;
return c+i_7;
}
//using namespace std;
//typedef long long ll;
long long po(long a, lon... | a.cc: In function 'int main()':
a.cc:56:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
56 | cin>>n;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::... |
s063972709 | p03676 | C++ | N = int(input())
L = [-1] * N
a = [int(i)-1 for i in input().split()]
for i in range(N+1):
if L[a[i]] == -1:
L[a[i]] = i
else:
x1, x2 = (min(L[a[i]], i), max(L[a[i]], i))
A = x1
B = x2-x1-1
C = N-x2
def power(a, b):
if b == 0:
return 1
elif b == 1:
return a % 1000000007
elif b % 2 == 0:
... | a.cc:27:2: error: invalid preprocessing directive #\U0000968e\U00004e57\U0000306e\U00009006\U00005143\U00003092\U00006c42\U00003081\U0000308b
27 | #階乗の逆元を求める
| ^~~~~~~~~~~~~~~~~~
a.cc:1:1: error: 'N' does not name a type
1 | N = int(input())
| ^
|
s908233350 | p03676 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<... | a.cc: In function 'int main()':
a.cc:87:36: error: 'tmp' was not declared in this scope; did you mean 'tm'?
87 | if (i >= 0 && i <= tmp)ans = (ans + MOD - comb(tmp, i)) % MOD;
| ^~~
| tm
|
s479652897 | p03676 | C++ | #include <bits/stdc++.h>
// statics
using namespace std;
using int64 = int_fast64_t;
using PAIR = pair<int, int>;
constexpr int INF = 1 << 30;
constexpr int64 LINF = 1LL << 60;
constexpr int MOD = 1e9 + 7;
constexpr int MAX_N = 1e5 + 1;
// init/input
#define int int64
#define INIT ios::sync_with_stdio(false);cin.tie(0... | a.cc: In function 'int main()':
a.cc:83:44: error: expected primary-expression before ')' token
83 | (ans = nCr(n + 1, i + 1) + ) %= MOD;
| ^
|
s247513147 | p03676 | C++ | int mod_pow(int a, int n, int mod){
int ret = 1;
while(n){
if(n & 1) ret = (long long)ret * a % mod;
a = (long long)a * a % mod;
n >>= 1;
}
return ret;
}
template<int mod>
class NTT {
public:
int get_mod() const { return mod; }
void _ntt(vector<int>& a, int sign){
const int n = (int)a.size();
const ... | a.cc:15:19: error: 'vector' has not been declared
15 | void _ntt(vector<int>& a, int sign){
| ^~~~~~
a.cc:15:25: error: expected ',' or '...' before '<' token
15 | void _ntt(vector<int>& a, int sign){
| ^
a.cc:41:18: error: 'vector' has not bee... |
s347343150 | p03676 | C++ | #include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto& (a): (b))
#define all(v) (v).begi... | a.cc: In function 'int main()':
a.cc:189:5: error: 'fast_int32mod_convolution' was not declared in this scope
189 | fast_int32mod_convolution(x,y,res);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
|
s081361372 | p03676 | Java | import java.io._
import java.util.StringTokenizer
import scala.collection.mutable
import scala.util.Sorting
import math.{abs, max, min}
import scala.collection.mutable.{ArrayBuffer, ListBuffer}
import scala.reflect.ClassTag
object Main {
val MOD = 1000000007
val out = new PrintWriter(System.out)
def solve(): U... | Main.java:1: error: as of release 9, '_' is a keyword, and may not be used as an identifier
import java.io._
^
Main.java:1: error: ';' expected
import java.io._
^
Main.java:2: error: ';' expected
import java.util.StringTokenizer
^
Main.java:4: error: ';' ex... |
s798918706 | p03676 | C++ | // D.
#include <iostream>
#include <algorithm>
#include <sstream>
#include <vector>
using namespace std;
typedef long long LL;
static const LL MOD = 1000000007;
static const size_t MAX_N = 100001;
struct modll {
long long x;
modll() { }
modll(long long _x) : x(_x) { }
operator int() const { return (int)x; }
m... | a.cc: In function 'modll combination(LL, LL)':
a.cc:47:23: error: operands to '?:' have different types 'modll' and 'long long int'
47 | return n >= r ? fact[n] * inv[r] * inv[n - r] : 0LL;
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:47:23: note: and each type can be converted ... |
s783608435 | p03676 | C++ | // D.
#include <iostream>
#include <algorithm>
#include <sstream>
#include <vector>
using namespace std;
typedef long long LL;
static const LL MOD = 1000000007;
static const size_t MAX_N = 100001;
struct modll {
long long x;
modll() { }
modll(long long _x) : x(_x) { }
operator int() const { return (int)x; }
m... | a.cc: In function 'modll combination(LL, LL)':
a.cc:47:23: error: operands to '?:' have different types 'modll' and 'int'
47 | return n >= r ? fact[n] * inv[r] * inv[n - r] : 0;
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:47:23: note: and each type can be converted to the other
|
s067762852 | p03676 | C++ | #include <bits/stdc++.h>
const int mod = 1e9 + 7;
const int maxn = 1e5 + 10;
int fac[maxn];
int inv[maxn];
int a[maxn];
int n;
int add;
int fin[maxn];
int id;
long long pow_mod(long long x)
{
long long res = 1;
long long n=mod-2;
while (n)
{
if (n & 1)
res = res * x % mod;
... | a.cc: In function 'void findd()':
a.cc:47:9: error: expected primary-expression before '}' token
47 | }
| ^
a.cc:46:19: error: expected ';' before '}' token
46 | return
| ^
| ;
47 | }
| ~
|
s702187616 | p03676 | C++ | #include "bits/stdc++.h"
#define ll long long
#define rep2(i,a,b) for(ll int i=a;i<=b;++i)
#define rep(i,n) for(ll int i=0;i<n;i++)
#define rep3(i,a,b) for(int i=a;i>=b;i--)
#define pii pair<int,int>
#define ti3 tuple<int,int,int>
ll int MOD=1e9+7;
int INF=1e6;
ll int MAX_N=1e18;
using namespace std;
string alphabet("a... | a.cc:22:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
22 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:38:16: error: 'comb2' was not declared in this scope; did you mean 'comb3'?
38 | comb1[0]=1,comb2[0]=1,comb3[0]=1;
| ^~~~~
| ... |
s243101849 | p03676 | C++ | #include "bits/stdc++.h"
#define ll long long
#define rep2(i,a,b) for(ll int i=a;i<=b;++i)
#define rep(i,n) for(ll int i=0;i<n;i++)
#define rep3(i,a,b) for(int i=a;i>=b;i--)
#define pii pair<int,int>
#define ti3 tuple<int,int,int>
ll int MOD=1e9+7;
int INF=1e6;
ll int MAX_N=1e18;
using namespace std;
string alphabet("a... | a.cc:22:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
22 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:38:16: error: 'comb2' was not declared in this scope; did you mean 'comb3'?
38 | comb1[0]=1,comb2[0]=1,comb3[0]=1;
| ^~~~~
| ... |
s199579986 | p03676 | Java |
import java.io.*;
import java.util.*;
class Main{
public static void main(String[] args){
solve();
}
public static void solve(){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] a = new int[n+1];
long etc = (long)Math.pow(10, 9) + 7;
for(int... | Main.java:18: error: cannot find symbol
ArrayList<Point> list = new ArrayList<Point>();
^
symbol: class Point
location: class Main
Main.java:18: error: cannot find symbol
ArrayList<Point> list = new ArrayList<Point>();
^
symbol: c... |
s958684515 | p03676 | C++ | #include <iostream>
int main(void) {
# dummy comment
cout << 0 << endl;
} | a.cc:4:7: error: invalid preprocessing directive #dummy
4 | # dummy comment
| ^~~~~
a.cc: In function 'int main()':
a.cc:5:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
5 | cout << 0 << endl;
| ^~~~
| std::cout
In file included from a.cc:1:
/u... |
s958409684 | p03676 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int div = 1000000007;
long long fac[100002];
void calc_fac(){
fac[0] = 1;
for(int i = 1; i < 100002; i++){
fac[i] = fac[i-1] * i % div;
}
}
long long pow(long long a, long long n){
if(n==1){return a%div;}
long long half_pow = pow(a,... | a.cc:5:5: error: 'int div' redeclared as different kind of entity
5 | int div = 1000000007;
| ^~~
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/ext/string_conversions.h:43,
from /usr/include/c++/14/bits/basic_string.h:4154,
... |
s553554956 | p03676 | C++ | #include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<set>
#include <unordered_set>
typedef long long int ll;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) fo... | a.cc: In function 'void FC(ll)':
a.cc:54:16: error: 'LP' was not declared in this scope; did you mean 'P'?
54 | Com[i]=LP(temp,MOD-2);
| ^~
| P
|
s115509504 | p03676 | C++ | #include <iostream>
using namespace std;
#define MOD 1000000007
long long mod(long long x, int n) {
//cout << x << endl;
if(n == 0) return 1;
long long ret = mod(x * x % MOD, n / 2);
if(n % 2) ret = ret * x % MOD;
return ret;
}
long long p(long long l, long long r) {
//cout << "mod: " << l *... | a.cc: In function 'int main()':
a.cc:31:15: error: 'max_element' was not declared in this scope
31 | int *pp = max_element(used, used + n + 1);
| ^~~~~~~~~~~
|
s123435986 | p03676 | C++ | #include<cstdio>
#include<algorithm>
using namespace std;
#define N 300005
#define Mo 1000000007
int i,jm,n,p,k,inv[N],fac[N];
int C(int x,int y)
{
if (x<y) return 0;
return 1ll*fac[x]*inv[y]%Mo*inv[x-y]%Mo;
}
int power(int x,int y)
{
}
int main()
{
scanf("%d",&n);
fac[0]=1;... | a.cc: In function 'int power(int, int)':
a.cc:20:1: warning: no return statement in function returning non-void [-Wreturn-type]
20 | }
| ^
a.cc: In function 'int main()':
a.cc:31:24: error: 'vis' was not declared in this scope
31 | if (vis[k]) len=k-vis[k]+1;
| ... |
s454720070 | p03676 | C++ | #include<cstdio>
#include<algorithm>
using namespace std;
#define N 300005
#define Mo 1000000007
int i,jm,n,p,k,inv[N],fac[N];
int C(int x,int y)
{
if (x<y) return 0;
return 1ll*fac[x]*inv[y]%Mo*inv[x-y]%Mo;
}
int main()
{
scanf("%d",&n);
fac[0]=1;
for (i=1;i<N;++i) fac[... | a.cc: In function 'int main()':
a.cc:22:37: error: 'power' was not declared in this scope
22 | for (i=0;i<N;++i) inv[i]=power(fac[i],Mo-2);
| ^~~~~
a.cc:26:24: error: 'vis' was not declared in this scope
26 | if (vis[k]) len=k-vis[k]+1;
... |
s426110632 | p03676 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long LL;
const LL MOD = 1000000007LL;
bool b[100001] = { false };
int num[100001];
LL fact[100001];
LL inv[100001];
LL inv_fact[100001];
LL mod_pow(LL x, LL a) {
if (a == 0) return 1;
if (a % 2 == 0) {
LL ret = mod_pow(x, a... | a.cc: In function 'int main()':
a.cc:60:10: error: expected '}' at end of input
60 | }
| ^
a.cc:28:12: note: to match this '{'
28 | int main() {
| ^
|
s581266122 | p03676 | C++ |
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
ll mo=1000000007;
ll combi(ll N_, ll C_) {
const int NUM_=400001;
static ll fact[NUM_+1],factr[NUM_+1],inv[NUM_+1];
if (fact[0]==0) {
inv[1]=fact[0]=factr[0]=1;
for (int i=2;i<=NUM_;++i) inv[i] = inv[mo % i] * (mo - mo / i) % mo;
... | a.cc: In function 'void solve()':
a.cc:30:9: error: 'FOR' was not declared in this scope
30 | FOR(i,N+1) {
| ^~~
|
s255222609 | p03676 | C++ | ll mo=1000000007;
ll combi(ll N_, ll C_) {
const int NUM_=400001;
static ll fact[NUM_+1],factr[NUM_+1],inv[NUM_+1];
if (fact[0]==0) {
inv[1]=fact[0]=factr[0]=1;
for (int i=2;i<=NUM_;++i) inv[i] = inv[mo % i] * (mo - mo / i) % mo;
for (int i=1;i<=NUM_;++i) fact[i]=fact[i-1]*i%mo, factr[i]=factr[i-1]*inv[i]%mo;
... | a.cc:1:1: error: 'll' does not name a type
1 | ll mo=1000000007;
| ^~
a.cc:2:1: error: 'll' does not name a type
2 | ll combi(ll N_, ll C_) {
| ^~
a.cc:17:1: error: 'vector' does not name a type
17 | vector<int> V;
| ^~~~~~
a.cc: In function 'void solve()':
a.cc:19:28: error: 'string' was n... |
s021843981 | p03676 | C++ | #include<iostream>
#include<cmath>
using namespace std;
long long n;
long long a[100010];
int use[100010];
long long jl[100000];
int check;
long long mod=1000000007;
long long C(int a,int b)
{
b=min(b,n+1-b);
if(a==n+1&&jl[b]!=0) return jl[b];
long long x=1;
if(a==n)
{
x=jl[b-1]*(a-b+1)/(b)%mod; ... | a.cc: In function 'long long int C(int, int)':
a.cc:15:14: error: no matching function for call to 'min(int&, long long int)'
15 | b=min(b,n+1-b);
| ~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s257484398 | p03676 | C++ | #include <cassert>
#include <cstdio>
#include <vector>
#define repeat(i, n) for (int i = 0; (i) < int(n); ++(i))
#define repeat_from(i, m, n) for (int i = (m); (i) < int(n); ++(i))
using ll = long long;
using namespace std;
ll powmod(ll x, ll y, ll p) { // O(log y)
assert (0 <= x and x < p);
assert (0 <= y);
... | a.cc: In function 'int main()':
a.cc:60:9: error: 'retult' was not declared in this scope; did you mean 'result'?
60 | retult = (result + mod) % mod;
| ^~~~~~
| result
|
s717660736 | p03676 | C++ | #include <iostream>
#include <vector>
using namespace std;
typedef unsigned long long u64;
typedef signed long long l64;
u64 binpow(u64 n, u64 x, u64 mod)
{
u64 tgt = 1;
u64 dig = n;
while (x > 0) {
if (x%2) {
tgt = (tgt * dig) % mod;
}
dig = (dig * dig) % mod;
x /= 2;
}
return tgt;
}
... | a.cc: In function 'int main()':
a.cc:72:30: error: invalid operands of types 'u64' {aka 'long long unsigned int'} and 'double' to binary 'operator%'
72 | if (up>dn) return (up-dn)%(1e9+7);
| ~~~~~~~^~~~~~~~
| | |
| |... |
s698976436 | p03676 | C++ | //15:53-17:33
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i... | a.cc: In function 'int main()':
a.cc:42:16: error: expected ';' before 'for'
42 | int x;a
| ^
| ;
43 | for(int i=1;i<=n+1;i++){
| ~~~
a.cc:43:21: error: 'i' was not declared in this scope
43 | for(int i=1;i<=n+1;i++){
| ... |
s107431879 | p03676 | C++ | //15:53-17:33
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i... | a.cc: In function 'int main()':
a.cc:42:16: error: expected ';' before 'for'
42 | int x;a
| ^
| ;
43 | for(int i=1;i<=n+1;i++){
| ~~~
a.cc:43:21: error: 'i' was not declared in this scope
43 | for(int i=1;i<=n+1;i++){
| ... |
s765699063 | p03676 | C++ | #include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <utility>
#include <map>
#include <stack>
#include <set>
#include <vector>
#include <queue>
#include <deque>
#define x first
#define y second
#define mp make_pair
#define pb push_... | a.cc: In function 'int main()':
a.cc:65:9: error: 'p' was not declared in this scope
65 | p=p1=0;
| ^
a.cc:65:11: error: 'p1' was not declared in this scope; did you mean 'y1'?
65 | p=p1=0;
| ^~
| y1
|
s134197012 | p03676 | C++ | #include <bits/stdc++.h>
#define ll long long
#define ls rt << 1
#define rs rt << 1 | 1
#define mp make_pair
#define pb push_back
#define pii pair<int, int>
#define X first
#define Y second
using namespace std;
const int N = 1e5 + 10;
const ll mod = 1e9 + 7;
inline int read()
{
int x = 0, f = 1; char ch = getchar();
... | a.cc:22:10: error: 'id' does not name a type; did you mean 'void'?
22 | id[N];
| ^~
| void
a.cc: In function 'int main()':
a.cc:52:16: error: 'id' was not declared in this scope
52 | memset(id, -1, sizeof(id));
| ^~
|
s998200844 | p03676 | C++ | #include <bits/stdc++.h>
#define ll long long
#define ls rt << 1
#define rs rt << 1 | 1
#define mp make_pair
#define pb push_back
#define pii pair<int, int>
#define X first
#define Y second
using namespace std;
const int N = 1e5 + 10;
const int mod = 1e9 + 7;
inline int read()
{
int x = 0, f = 1; char ch = getchar();... | a.cc: In function 'int main()':
a.cc:67:59: error: expression list treated as compound expression in initializer [-fpermissive]
67 | ll ret = C(n + 1, i), C(s + (n - t), i - 1);
| ^
|
s604891894 | p03676 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, ty... | a.cc: In function 'int main()':
a.cc:72:75: error: expected primary-expression before '.' token
72 | if (n - 1 - c >= k - 1) ans -= ncr(n - 1 - c, k - 1, MOD);.
| ^
|
s810075112 | p03676 | C++ |
#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include... | a.cc:317:2: error: #else after #else
317 | #else
| ^~~~
a.cc:281: error: the conditional began here
281 | #if 1
a.cc:275:6: error: 'auto fact' redeclared as different kind of entity
275 | auto fact = fact_set_c<100001>();
| ^~~~
a.cc:214:48: note: previous declaration 'template<long unsigned int... |
s209793840 | p03676 | C++ | #include<bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pb push_back
#define pii pair<ll,ll>
#define vi vector<ll>
using namespace std;
const ll Maxn = 123456;
const ll Mod = 1000000007;
ll A[Maxn];
ll fact[Maxn];
ll inv[Maxn], ifact[Maxn];
ll freq[Maxn];
template<typename T, typename T1>
T mod... | a.cc: In function 'int main()':
a.cc:114:25: error: overloaded function with no contextual type information
114 | if(ans<0)ans+=mod;
| ^~~
|
s611557471 | p03676 | C++ | #include <stdio.h>
#include <algorithm>
#include <vector>
#include <deque>
using namespace std;
using ll = long long;
using ull = unsigned long long;
template<ull max_n, ull m>
class nCr_mod_m
{
public:
nCr_mod_m() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[0] = 0;
inv[1] = 1;
for (ull i = 2; i <= m... | a.cc: In function 'int main()':
a.cc:36:9: error: 'memset' was not declared in this scope
36 | memset(have, -1, sizeof(have));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <deque>
+++ |+#include <c... |
s712642094 | p03676 | C++ | #include<cstdio>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#define rep(n) for(int i=0;i<n;i++)
#define repp(j, n) for(int j=0;j<n;j++)
#define reppp(i, m, n) for(int i=m;i<=n;i++)
#define all(c)... | a.cc: In function 'int main()':
a.cc:78:21: error: 'dup' was not declared in this scope
78 | dup += (comb((ll)d1, (ll)j) * comb((ll)(n-d2), (ll)(i-1-j))) % MOD;
| ^~~
a.cc:80:24: error: 'dup' was not declared in this scope
80 | ans -= dup % MOD;
... |
s761094821 | p03676 | C++ | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
#include <stdio.h>
using namespace std;
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)... | a.cc:50:11: error: expected identifier before numeric constant
50 | ll facts=[100001]
| ^~~~~~
a.cc:52:1: error: type-specifier invalid in lambda
52 | long long nCr(long long n, long long r, long long mod) {
| ^~~~
a.cc:52:6: error: type-specifier invalid in lambda
52 | long long nCr(long... |
s093272707 | p03676 | C++ | #include <stdio.h>
#include <algorithm>
#include <vector>
#include <deque>
#include "nCr_mod_m.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
template<ull max_n, ull m>
class nCr_mod_m
{
public:
nCr_mod_m() {
fac[0] = fac[1] = 1;
for (int i = 2; i <= max_n; i++)
fac[i] = fac[i -... | a.cc:5:10: fatal error: nCr_mod_m.h: No such file or directory
5 | #include "nCr_mod_m.h"
| ^~~~~~~~~~~~~
compilation terminated.
|
s199108619 | p03676 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <utility>
using namespace std;
#define mod 1000000007
#define ADD(X,Y) ((X)... | a.cc: In function 'int main()':
a.cc:85:17: error: 'f' was not declared in this scope
85 | f(D[N + i - 1]!=-1)p =D[i];
| ^
a.cc:86:17: error: 'else' without a previous 'if'
86 | else
| ^~~~
|
s794388542 | p03676 | C++ | #include <cstdio>
#include <vector>
int N;
int A[100003];
int cnt[100003];
using namespace std;
template< bool B, class T = void >
using enable_if_t = typename enable_if<B,T>::type;
template<int M, bool IsPrime = false>
class Modulo {
using ll = long long;
int n;
static enable_if_t<IsPrime, ll> inv(ll a, ll p... | a.cc:17:10: error: reference to 'enable_if_t' is ambiguous
17 | static enable_if_t<IsPrime, ll> inv(ll a, ll p) {
| ^~~~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/ve... |
s921212990 | p03676 | Java | import java.util.*;
public class Main {
static long MOD = (long)Math.pow(10, 9) + 7;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long n = sc.nextLong();
long[] kaijou = new long[n + 1];
kaijou[0] = 1;
for(int i = 1; i < n + 1; i++) {
kaijou[i] = (kaijou[i... | Main.java:8: error: incompatible types: possible lossy conversion from long to int
long[] kaijou = new long[n + 1];
^
Main.java:13: error: incompatible types: possible lossy conversion from long to int
int[] suuretu = new int[n + 1];
^
Main.java:14: e... |
s110909015 | p03676 | C++ | #include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i =... | a.cc: In function 'll Combination(int, int)':
a.cc:65:12: error: 'cb' was not declared in this scope
65 | return cb[r]=result;
| ^~
|
s351239225 | p03676 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <utility>
using namespace std;
#define mod 1000000007
#define ADD(X,Y) ((X)... | a.cc: In function 'int main()':
a.cc:85:17: error: 'f' was not declared in this scope
85 | f(D[N + i - 1]!=-1)p =D[i];
| ^
a.cc:86:17: error: 'else' without a previous 'if'
86 | else
| ^~~~
|
s415154608 | p03676 | Java | import java.util.*;
public class Main {
static long MOD = (long)Math.pow(10, 9) + 7;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long n = sc.nextLong();
long[] kaijou = new long[n + 1];
kaijou[0] = 1;
for(int i = 1; i < n + 1; i++) {
kaijou[i] = (kaijou[i... | Main.java:8: error: incompatible types: possible lossy conversion from long to int
long[] kaijou = new long[n + 1];
^
Main.java:13: error: incompatible types: possible lossy conversion from long to int
int[] suuretu = new int[n + 1];
^
Main.java:14: e... |
s226800402 | p03676 | C++ | #include <algorithm>
#include <cassert>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
constexpr long MOD = 1000000000 + 7;
long gcd(long a, lon... | a.cc:32:1: error: expected primary-expression before 'long'
32 | long comb(long a, long b)
| ^~~~
a.cc:30:18: error: expected ']' before 'long'
30 | long COMB[50001][
| ^
| ]
31 |
32 | long comb(long a, long b)
| ~~~~
a.cc: In function... |
s617325482 | p03676 | C++ | #include<string>
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<math.h>
#include<unordered_set>
using namespace std;
typedef long long ll;
#define FOR(i,N) for(int i=0;i<N;i++)
int mod=1e9+7;
ll mo=1000000007;
map<pair<ll,ll>, ll>mem;
const int NUM_=1000... | a.cc: In function 'int main()':
a.cc:33:5: error: 'memset' was not declared in this scope
33 | memset(fact,0,sizeof(fact));
| ^~~~~~
a.cc:10:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
9 | #include<unordered_set>
+++ |+#include <cstr... |
s682262880 | p03676 | C++ | https://arc077.contest.atcoder.jp/submit | a.cc:1:1: error: 'https' does not name a type
1 | https://arc077.contest.atcoder.jp/submit
| ^~~~~
|
s291548113 | p03676 | C++ | #include <iostream>
#include <sstream>
#include <string>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <functional>
#include <numeric>
#include <iomanip>
using nam... | a.cc:51:1: error: expected unqualified-id before '{' token
51 | {
| ^
a.cc: In function 'll modDivision(ll, ll)':
a.cc:59:17: error: 'modInverse' was not declared in this scope
59 | return (p * modInverse(q)) % MOD;
| ^~~~~~~~~~
|
s564821707 | p03676 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <set>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define INF ((int... | a.cc:23:39: error: extended character — is not valid in an identifier
23 | #define REPR(i,M,m) for(int i=M; i>m; i—-)
| ^
a.cc:25:40: error: extended character — is not valid in an identifier
25 | #define REPLLR(i,M,m) for(ll i=M; i>m; i—-)
| ... |
s664128799 | p03676 | C++ | C:\Filyan\Competitive Programming\CP\CP\Source.cpp | a.cc:1:3: error: stray '\' in program
1 | C:\Filyan\Competitive Programming\CP\CP\Source.cpp
| ^
a.cc:1:10: error: stray '\' in program
1 | C:\Filyan\Competitive Programming\CP\CP\Source.cpp
| ^
a.cc:1:34: error: stray '\' in program
1 | C:\Filyan\Competitive Programming\CP\CP\Source.... |
s609572835 | p03676 | C++ |
#if 0
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#includ... | a.cc: In function 'RET combination(Integral, Integral)':
a.cc:369:24: error: 'DP_comb' was not declared in this scope
369 | return DP_comb[get];
| ^~~~~~~
|
s563181646 | p03676 | C++ | #include <stdio.h>
#define MOD 1000000007
long long fac[100005];
long long invfac[100005];
long long powmod(long long a,int b)
{
if (b==1) return a;
if (b&1) return (powmod((a*a)%MOD,b/2)*a)%MOD;
return powmod((a*a)%MOD,b/2);
}
long long inv(long long a)
{
return powmod(a,MOD-2);
}
long long choose(... | a.cc: In function 'int main()':
a.cc:71:32: error: expected ')' before ';' token
71 | printf("%lld\n",ans%MOD;
| ~ ^
|
s370473686 | p03676 | C++ | #include <type_traits>
#include <utility>
#include <cassert>
#include <iostream>
#include <functional>
#include <vector>
#include <string>
#include <algorithm>
namespace loquat {
template <typename T>
static std::pair<T, T> extended_gcd(T a, T b){
if(b == 0){ return std::pair<T, T>(1, 0); }
const auto p = extended_gc... | a.cc:59:8: error: 'identity' is not a class template
59 | struct identity<std::plus<modulus_integer<MOD>>> {
| ^~~~~~~~
a.cc:65:54: error: type/value mismatch at argument 1 in template parameter list for 'template<int MOD> struct loquat::identity'
65 | struct identity<std::multiplies<modulus_integer<... |
s921162138 | p03677 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;
class Parser {
private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
private static final Iterator<String> stringIterator = br.li... | Main.java:190: error: reached end of file while parsing
}l
^
1 error
|
s560300095 | p03677 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAX_N = 100005;
int n,m,A[MAX_N];
map<int, pair<ll, ll>> sum;
// x[a..b]++ und add[a..b] += c
void magic(int a, int b, int c)
{
if (a > b)
return;
sum[a].first++;
sum[b+1].second--;
sum[a].second += c;
sum[b+1].second -= c;
}
int ... | a.cc: In function 'int main()':
a.cc:43:35: error: base operand of '->' has non-pointer type 'std::pair<const int, std::pair<long long int, long long int> >'
43 | sub = max(sub, (it->first-1)*px + padd);
| ^~
a.cc:44:25: error: base operand of '->' has non-poin... |
s456220463 | p03677 | C++ | #pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define F first
#define S second
#define int long long
#define ll long long
//#define int unsigned long long
#define pb push_back
//#define double long double
using namespace std;
using namespace __gnu_pbds;
typedef tree<... | a.cc:21:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
21 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:28:13: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'long long int')
28 | cin >> a[i]--;
| ... |
s315258682 | p03677 | C++ | #ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
# include <intrin.h>
# define __builtin_popcount __popcnt
#endif
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <iostream>
#include <vector>
#include <unordered_map>
#include <stack>
#include <list>
#include <math.h>
#include <map>
#include <iomanip>
#include <... | a.cc: In function 'int main()':
a.cc:113:30: error: 'LLONG_MAX' was not declared in this scope
113 | long long best_sum = LLONG_MAX;
| ^~~~~~~~~
a.cc:23:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
22 | #in... |
s650523860 | p03677 | C++ | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5+5;
int arr[MAXN];
int pref[MAXN];
int pref2[MAXN];
int ans;
int res= 1e9;
int main(){
int n,m;
cin>>n>>m;
for(int i=1;i<=n;i++){
cin>>arr[i];
}
for(int i=1;i<n;i++){
int x = arr[i];
int y =... | a.cc: In function 'int main()':
a.cc:38:21: error: 'tot' was not declared in this scope
38 | pref2[i] += tot[i-1];
| ^~~
|
s593243313 | p03677 | C++ | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5+5;
int arr[MAXN];
int pref[MAXN];
int pref2[MAXN];
int ans;
int res= 1e9;
int main(){
int n,m;
cin>>n>>m;
for(int i=1;i<=n;i++){
cin>>arr[i];
}
for(int i=1;i<n;i++){
int x = arr[i];
int y =... | a.cc: In function 'int main()':
a.cc:38:9: error: 'tot' was not declared in this scope
38 | tot[i] += tot[i-1];
| ^~~
|
s113120807 | p03677 | C++ | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5+5;
int arr[MAXN];
int pref[MAXN];
int tot[MAXN];
int ans;
int res= 1e9;
int main(){
int n,m;
cin>>n>>m;
for(int i=1;i<=n;i++){
cin>>arr[i];
}
for(int i=1;i<n;i++){
int x = arr[i];
int y = a... | a.cc: In function 'int main()':
a.cc:39:9: error: 'pref2' was not declared in this scope; did you mean 'pref'?
39 | pref2[i]-=pref[i];
| ^~~~~
| pref
|
s387751857 | p03677 | C++ | #include <iostream> // cin, cout, cerr, clog
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota, accumulate, inner_product
#include <cstdio> // printf, scanf
#include <climits> // INT_MIN, LLONG_MIN
#include <cmath> // long, trig, pow
#include <string> // string, stoi, to_string
#include <vector> // ... | a.cc:37:30: error: 'std::istream_iterator' has not been declared
37 | void _err(std::ostream& cerr,std::istream_iterator<std::string> it) { cerr << '\n'; }
| ^~~
a.cc:37:51: error: expected ',' or '...' before '<' token
37 | void _err(std::ostream& cerr,std::istream_iterator<std... |
s189757535 | p03677 | C++ | #include <iostream>
#include <fstream>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <numeric>
#include <functional>
#include <string>
#include <vector>
#include <bitset>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
using namespace std;
using ... | a.cc:82:74: error: invalid use of non-static data member 'SegmentTreePointAddRangeSum<T>::nodeNum'
82 | T getvar(const int a, const int b, int k = 0, int l = 0, int r = nodeNum) {
| ^~~~~~~
a.cc:53:16: note: declared here
53 | ... |
s567201139 | p03677 | C | #include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <stack>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#defin... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s823402445 | p03677 | C++ |
#include <bits/stdc++.h>
#define null ""
#define endl '\n'
#define all(dat) dat.begin(), dat.end()
#define loop(i, to) for (num i = 0; i < to; ++i)
#define cont(i, to) for (num i = 1; i <= to; ++i)
#define circ(i, fr, to) for (num i = fr; i <= to; ++i)
#define fo... | a.cc: In function 'int main()':
a.cc:106:16: error: no matching function for call to 'max(int, num)'
106 | l = max(1, pos - mx + 2);
| ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
... |
s116131694 | p03677 | C++ |
#include <bits/stdc++.h>
#define null ""
#define endl '\n'
#define all(dat) dat.begin(), dat.end()
#define loop(i, to) for (num i = 0; i < to; ++i)
#define cont(i, to) for (num i = 1; i <= to; ++i)
#define circ(i, fr, to) for (num i = fr; i <= to; ++i)
#define fo... | a.cc: In function 'int main()':
a.cc:106:16: error: no matching function for call to 'max(int, num)'
106 | l = max(1, pos - mx + 2);
| ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
... |
s676097461 | p03677 | C++ | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n,m;cin>>n>>m;
vector<ll> a(n),imos(m+10,0);
map<ll,ll> mp;
for(int i=0;i<n;i++){
cin>>a[i];
a[i]--;
}
ll cnt=0; // x=0 の時のコスト
for(int i=1;... | a.cc: In function 'int main()':
a.cc:40:9: error: 'res' was not declared in this scope
40 | res=min(res,cnt);
| ^~~
a.cc:42:11: error: 'res' was not declared in this scope
42 | cout<<res<<endl;
| ^~~
|
s302995735 | p03677 | C++ | #include <iostream>
#include <algorithm>
#include <array>
#include <numeric>
using namespace std;
const int maxn = 3e5 + 1e2;
using ll = long long;
array<int, maxn> a;
array<ll, maxn> p;
int n, m;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll tot = 0;
cin >> n >> m;
for (int i = 0; i < ... | In file included from /usr/include/c++/14/numeric:62,
from a.cc:4:
/usr/include/c++/14/bits/stl_numeric.h: In instantiation of '_OutputIterator std::partial_sum(_InputIterator, _InputIterator, _OutputIterator) [with _InputIterator = long long int*; _OutputIterator = array<long long int, 300100>]':
a.cc... |
s870101693 | p03677 | C++ | #include<iostream>
using namespace std;
const int N=100100;
long long n,m,t3,t4,a[N*2],sum;
long long ans;
int main()
{
ios::sync_with_stdio(false);
cin>>n>>m>>t3;
for(int i=2;i<=n;++i)
{
int d,t1,t2;
cin>>t4;
t1=t3;t2=t4;
if(t2<t1) t2+=m;
d=t2-t1;
ans+=d;... | a.cc: In function 'int main()':
a.cc:42:17: error: no matching function for call to 'max(long long int&, int&)'
42 | maxx=max(a[i-m],maxx);
| ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s172723609 | p03677 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll
#define int ll;
int m,n;
int a[100010];
struct LazySegmentTree {
private:
int n;
vector<ll> node, lazy;
public:
LazySegmentTree(const vector<ll>& v) {
int sz = (int)v.size()... | a.cc:8:13: error: expected initializer before 'll'
8 | #define int ll;
| ^~
a.cc:11:1: note: in expansion of macro 'int'
11 | int m,n;
| ^~~
a.cc:11:5: error: 'm' does not name a type; did you mean 'tm'?
11 | int m,n;
| ^
| tm
a.cc:8:13: error: 'll' does not name a ... |
s651524870 | p03677 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
#define int ll;
int m,n;
int a[100010];
struct LazySegmentTree {
private:
int n;
vector<ll> node, lazy;
public:
LazySegmentTree(const vector<ll>& v) {
int sz = (int)v.size(... | a.cc:8:13: error: declaration does not declare anything [-fpermissive]
8 | #define int ll;
| ^~
a.cc:11:1: note: in expansion of macro 'int'
11 | int m,n;
| ^~~
a.cc:11:5: error: 'm' does not name a type; did you mean 'tm'?
11 | int m,n;
| ^
| tm
a.cc:8:13: error: d... |
s585845001 | p03677 | C++ | #include <bits/stdc++.h>
using namespace std;
//#define FILE_IO
int \, M;
int v[100005];
class BinaryIndexedTree
{
public:
int aib[100005];
void U(int pos, int val)
{
for(; pos <= M; pos += (pos & (-pos)))
aib[pos] += val;
}
void update(int st, int dr, int val)
{
... | a.cc:7:5: error: stray '\' in program
7 | int \, M;
| ^
a.cc:7:6: error: expected unqualified-id before ',' token
7 | int \, M;
| ^
a.cc: In function 'int main()':
a.cc:44:20: error: 'N' was not declared in this scope
44 | scanf("%d%d", &N, &M);
| ^
|
s619408963 | p03677 | C++ | 10 10
10 9 8 7 6 5 4 3 2 1 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 10 10
| ^~
|
s880392321 | p03677 | C++ | 10 10
10 9 8 7 6 5 4 3 2 1 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 10 10
| ^~
|
s389472028 | p03677 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long LL;
int main(){
// freopen("test.txt", "r", stdin);
LL n, m, pre, now;
scanf("%lld%lld%lld", &n, &m, &pre);
vector<LL> a(m+2, 0);
vector<LL> b(m+2, 0);
for (int i = 1; i < n; i++) {
scanf(... | a.cc: In function 'int main()':
a.cc:38:14: error: 'INT_MAX' was not declared in this scope
38 | LL ret = INT_MAX;
| ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
3 | #include <algorithm>
+++ |+#include <climit... |
s448783025 | p03677 | C++ | #include <iostream>
using namespace std;
const int MAXM=100010;
int m,n;
int segment[MAXM*2];
int segexit[MAXM*2];
int gensum[MAXM*2];
int main() {
memset(segment,0,sizeof(segment));
memset(segexit,0,sizeof(segexit));
int result = 0;
cin>>n>>m;
int last; cin>>last;
for (int i=1,now;i<n;i++,last=(now-1)%6+1) {
... | a.cc: In function 'int main()':
a.cc:10:9: error: 'memset' was not declared in this scope
10 | memset(segment,0,sizeof(segment));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#incl... |
s457538634 | p03677 | C++ | #include <bits/stdc++.h>
using namespace std;
int n,m,i,j,a[100005];
long long s[200005];
int main(){
scanf("%d%d", &n, &m);
for(i = 0; i < n; i++){
scanf("%d", &a[i]);
a[i]--;
}
long long tot = 0;
for(i = 1; i < n; i++){
int l = a[i - 1];
int r = a[i];
if(l <= r){
s[l + 2]++;
s[r + 1]-... | a.cc: In function 'int main()':
a.cc:47:24: error: 'tmp' was not declared in this scope; did you mean 'tm'?
47 | res = min(res, tmp - (s[i] + s[i + m]));
| ^~~
| tm
|
s466189341 | p03677 | C++ | #include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cstdio>
#include <map>
#include <set>
#include <cmath>
#include <vector>
#include <ctime>
#include <queue>
#include <sstream>
#include <utility>
#include <bitset>
using namespace std;
#define MP make_pair
#defi... | a.cc:31:25: error: 'l' is not a type
31 | inline void update(ll a,l b)
| ^
|
s063542025 | p03677 | C++ | #include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cstdio>
#include <map>
#include <set>
#include <cmath>
#include <vector>
#include <ctime>
#include <queue>
#include <sstream>
#include <utility>
#include <bitset>
using namespace std;
#define MP make_pair
#defi... | a.cc: In function 'int main()':
a.cc:71:2: error: expected '}' at end of input
71 | }
| ^
a.cc:57:1: note: to match this '{'
57 | {
| ^
|
s754472002 | p03677 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()
typedef long long LL;
using namespace std;
int main(){
LL n,m;
cin>>n>>m;
LL sum[m];
LL ad[m];
fill_n(sum,m,0);
fill_n(ad,m,0);
LL a[n];
REP(i,n){
cin>>a[i];
a[i... | a.cc: In function 'int main()':
a.cc:28:16: error: no matching function for call to 'max(LL&, long int)'
28 | LL maxn=max(sum[0],0L);
| ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
... |
s473295116 | p03677 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()
typedef LL long long;
using namespace std;
int main(){
LL n,m;
cin>>n>>m;
LL sum[m];
LL ad[m];
fill_n(sum,m,0);
fill_n(ad,m,0);
LL a[n];
REP(i,n){
cin>>a[i];
a[i... | a.cc:4:9: error: 'LL' does not name a type; did you mean 'ALL'?
4 | typedef LL long long;
| ^~
| ALL
a.cc: In function 'int main()':
a.cc:10:5: error: 'LL' was not declared in this scope; did you mean 'ALL'?
10 | LL n,m;
| ^~
| ALL
a.cc:11:10: error: 'n' was no... |
s453773296 | p03677 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()
#define LL long long
using namespace std;
int main(){
int n,m;
cin>>n>>m;
LL sum[m];
LL ad[m];
fill_n(sum,m,0);
fill_n(ad,m,0);
LL a[n];
REP(i,n){
cin>>a[i];
a[i... | a.cc: In function 'int main()':
a.cc:33:13: error: no matching function for call to 'max(int, long long int&)'
33 | maxn=max(0,maxn);
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
... |
s530398893 | p03677 | C++ |
Spylft:
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int M=100005;
typedef long long LL;
template<class T>void Min(T &x,T y){
if(x>y)x=y;
}
LL val[M],cnt[M];
int n,m,beg,x;
int main(){
scanf("%d %d",&n,&m),n--;
scanf("%d",&x);
for(int i=1;i<=n;i++){
sca... | a.cc:2:1: error: 'Spylft' does not name a type
2 | Spylft:
| ^~~~~~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:5:
... |
s721485647 | p03677 | C++ | #include <cstdio>
using namespace std;
int rd() {
int x = 0; char c = getchar();
while (c > '9' || c < '0') c = getchar();
while (c >= '0' && c <= '9') x = x * 10 + c - 48, c = getchar();
return x;
}
const int N = 2e5 + 5;
long long n, m, sum, ans = 1e18, a[N], b[N], c[N];
int main() {
n = rd(), m = rd... | a.cc: In function 'int main()':
a.cc:28:45: error: 'min' was not declared in this scope; did you mean 'main'?
28 | for (int i = 1; i <= m; i ++) ans = min(ans, sum - c[i] + b[i]);
| ^~~
| main
|
s059050716 | p03677 | C++ | #include <bits/stdc++.h>
#define INF 100000000
#define MOD9(a) (a%1000000009)
#define MOD7(a) (a%1000000007)
#define ABS(a) (a<0?-(a):a)
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define REP(i,a) for(int i=0;i<a;i++)
using namespace std;
int main(){
long long int n,m;
cin >> n >> m;
long long int a... | a.cc: In function 'int main()':
a.cc:25:12: error: expected primary-expression before '=' token
25 | po + = MIN((now<a[j+1]?(a[j+1]-now):(m-now+a[j+1])), 1+(i<=a[j+1]?(a[j+1]-i):(m-i+a[j+1])));
| ^
|
s108921370 | p03677 | C++ | //Artie WANG
//io
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <sstream>
//data structure
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>
//#include <unordered_map>
//#include <unordered_set>... | a.cc: In function 'int main()':
a.cc:137:21: error: 'min_element' was not declared in this scope
137 | printf("%lld\n", *min_element(b+1, b+1+n));
| ^~~~~~~~~~~
|
s438525220 | p03677 | C++ | #include <bits/stdc++.h>
using namespace std;
#define N 100005
int n, m, arr[N];
int f(int);
inline int dis(int, int);
int main(){
srand(time(NULL));
ios_base::sync_with_stdio(0);cin.tie(0);
cin>>n>>m;
for(int i=0;i<n;i++) cin>>arr[i];
int x=rand()%m + 1, y=f(x);
for(int i=0;i<400;i++){
int newX = max(0, int(... | a.cc: In function 'int main()':
a.cc:16:69: error: 'step' was not declared in this scope; did you mean 'strsep'?
16 | int newX = max(0, int(x+((rand()&1)?1:-1)*rand()/(3*step))%m), newY=f(newX);
| ^~~~
| ... |
s238472461 | p03677 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n, m;
scanf("%d%d", &n, &m);
vector<int> a(n);
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
vector<pair<int, pair<int, int>>> evs;
long long tot = 0;
for (int i = 0; i + 1 < n; i++) {
if ... | a.cc: In function 'int main()':
a.cc:27:5: error: 'sort' was not declared in this scope; did you mean 'short'?
27 | sort(evs.begin(), evs.end());
| ^~~~
| short
|
s137432477 | p03677 | C++ | #include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<cmath>
using namespace std;
template<typename Type> class StarrySkyTree {
private:
unsigned size_; std::vector<Type> dat1, dat2;
inline void update_(unsigned a, unsigned b, Type x, unsigned k, unsigned l, unsigned r) {
... | a.cc: In constructor 'StarrySkyTree<Type>::StarrySkyTree()':
a.cc:29:37: error: class 'StarrySkyTree<Type>' does not have any field named 'dat'
29 | StarrySkyTree() : size_(0), dat(std::vector<Type>()) {};
| ^~~
a.cc: In constructor 'StarrySkyTree<Type>::StarrySkyTre... |
s049513317 | p03678 | C++ | #include<bits/stdc++.h>
#define N 200010
#define ll long long
using namespace std;
struct data
{
ll len,a[30];
data()
{
len=0;
memset(a,0,sizeof(a));
}
}f[100];
data operator + (data a,data b)
{
data c;
c.len=a.len+b.len;
for(int i=0;i<26;i++)
c.a[i]=a.a[i]+b.a[i];
return c;
}
data operator - (data a... | a.cc:18:1: error: reference to 'data' is ambiguous
18 | data operator + (data a,data b)
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/us... |
s702465258 | p03678 | C++ | #include <iostream>
#include<vector>
using namespace std;
typedef long long lint;
const int MAXN = 200005;
char str[MAXN];
int fail[MAXN];
lint dp[222];
lint cnt[222][26];
vector<lint> solve(lint p, int s, int t){
memset(dp, 0, sizeof(dp));
memset(cnt, 0, sizeof(cnt));
vector<lint> dap(26);
dp[0] = s;
dp[1] = s... | a.cc: In function 'std::vector<long long int> solve(lint, int, int)':
a.cc:14:9: error: 'memset' was not declared in this scope
14 | memset(dp, 0, sizeof(dp));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #in... |
s441476676 | p03678 | C++ | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;
const int maxn = 1e6 + 10;
const int M = 26;
char s[maxn];
int next[maxn];
struct Node
{
LL cnt[M];
Node() { memset(cnt, 0, sizeof cnt); }
void operator += (const Node &a)
{
for (int i = 0; i < M; ++ i)
cn... | a.cc: In function 'Node Calc(int, LL)':
a.cc:47:38: error: reference to 'next' is ambiguous
47 | LL x = len, y = len + (len - next[len]);
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
from /usr/include/c++/14/algorithm:60,... |
s978288778 | p03678 | C++ | #include <bits/stdc++.h>
#define b 31ll
#define mod 1004535809ll
#define ll long long
using namespace std;
char s[400005];
ll l[1005],fib[1005][27],ans[27];
ll has[400005],m[400005],lo,hi;
int len,t;
inline ll get(int l,int r)
{if (l>r) return 0;
ll ret=(has[r]-has[l-1]*m[r-l+1])%mod;
return (ret<0?ret+mod:ret);
}
inli... | a.cc: In function 'int main()':
a.cc:43:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
43 | gets(s+1);len=strlen(s+1);
| ^~~~
| getw
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.