submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s920562669 | p00255 | C++ | #include<cstdio>
#include<algorithm>
using namespace std;
int main(){
long long int n;
while(scanf("%d",&n),n){
long long int p[10000]={0};
long long int x = 0;
long long int y = 0;
long long int ans = 0;
for(long long int i = 0; i < n; i++){
scanf("%d",&p[i]);
y += p[i];
}
sort(p,p+n);
long lon... | a.cc:48:5: error: redefinition of 'int main()'
48 | int main(){
| ^~~~
a.cc:4:5: note: 'int main()' previously defined here
4 | int main(){
| ^~~~
|
s604945917 | p00255 | C++ | #include<cstdio>
#include<algorithm>
using namespace std;
int main(){
int n;
while(scanf("%d",&n),n){
int p[10000]={0};
int x = 0;
int y = 0;
int ans = 0;
for(int i = 0; i < n; i++){
scanf("%d",&p[i]);
y += p[i];
}
sort(p,p+n);
int j[10000]={0};
for(int i = 0; i < n-1; i++){
scanf("%d",&j[i... | a.cc:48:5: error: redefinition of 'int main()'
48 | int main(){
| ^~~~
a.cc:4:5: note: 'int main()' previously defined here
4 | int main(){
| ^~~~
a.cc:92:5: error: redefinition of 'int main()'
92 | int main(){
| ^~~~
a.cc:4:5: note: 'int main()' previously defined here
4 | i... |
s179732517 | p00255 | C++ | #include<cstdio>
#include<vector>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
long long n,a;
while(cin >> n,n){
long long int p = 0;
vector<long long> J(n-1);
for(int i = 0; i < n; i++){
cin >> a;
p += a;
}
int ans = p * n;
for(int i = 1; i < n; i++){
cin >> J[i-1];
... | a.cc: In function 'int main()':
a.cc:22:34: error: no matching function for call to 'max(int&, long long int)'
22 | ans = max(ans,p * i);
| ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/vector:62,
from a.cc:2:
/usr/include/c++/14... |
s414953280 | p00255 | C++ | #include<iostream>
using namespace std;
int n,a,c,honsu,tp,tj,mx;
int p[65000];
int j[1001];
void syokika(){
tp=0;
tj=0;
mx=0;
c=0;
}
int main(){
while(true){
cin>>n;
if(n==0)break;
syokika();
for(int i=0;i<n;i++){
cin>>p[i];
tp+=p[i];
}
for(int i=0;i<n-1;i++){
cin>>j... | a.cc: In function 'int main()':
a.cc:25:5: error: 'sort' was not declared in this scope; did you mean 'short'?
25 | sort(j,j+n-1);
| ^~~~
| short
|
s442286957 | p00255 | C++ | #include<iostream>
using namespace std;
int n,a,c,honsu,tp,tj,mx;
int p[65000];
int j[1001];
void syokika(){
tp=0;
tj=0;
mx=0;
c=0;
}
int main(){
while(true){
cin>>n;
if(n==0)break;
syokika();
for(int i=0;i<n;i++){
cin>>p[i];
tp+=p[i];
}
for(int i=0;i<n-1;i++){
cin>>j... | a.cc: In function 'int main()':
a.cc:25:5: error: 'sort' was not declared in this scope; did you mean 'short'?
25 | sort(j,j+n-1);
| ^~~~
| short
|
s732155210 | p00255 | C++ | #include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int main(void)
{
int f1, n, p, cnt, *J;
unsigned int k, sum, max;
while( scanf("%d", &n) && n > 0)
{
J = new int [n - 1];
sum = 0;
cnt = 1;
for(f1 = 0; f1 < n; f1++)
{
scanf("%d", &p);
sum += p;
}
for(f1 = 0; f1 < n-... | a.cc: In function 'int main()':
a.cc:26:27: error: request for member 'push_back' in 'J', which is of non-class type 'int*'
26 | J.push_back(p);
| ^~~~~~~~~
a.cc:38:25: error: 't' was not declared in this scope
38 | t++;
| ... |
s341292214 | p00255 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
static const int MAX = 65000;
typedef long long llong;
main(){
llong n, totalp;
llong P[MAX], J[MAX];
int tcase = 0;
while(1){
cin >> n;
if ( n == 0 ) break;
tcase++;
totalp = 0;
for ( int i = 0; i < n; i++ ) {
cin >> P[i];
... | a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
7 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:36:3: error: 'assert' was not declared in this scope
36 | assert( tcase <= 100 );
| ^~~~~~
a.cc:3:1: note: 'assert' is defined in header '<cassert>'; this ... |
s943182198 | p00255 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
static const int MAX = 65000;
typedef long long llong;
main(){
llong n, totalp;
llong P[MAX], J[MAX];
int tcase = 0;
while(1){
cin >> n;
if ( n == 0 ) break;
tcase++;
totalp = 0;
for ( int i = 0; i < n; i++ ) {
cin >> P[i];
... | a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
7 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:27:5: error: 'totalj' was not declared in this scope; did you mean 'totalp'?
27 | totalj = 0;
| ^~~~~~
| totalp
|
s296523116 | p00255 | C++ | #include <iostream>
#include <algorithm>
int main()
{
std::vector<int> data;
int ddata;
int num;
int maxvul;
int count,length;
std::cin>>num;
while(num){
data.resize(num-1);
maxvul=0;
for(int i=0;i<num;i++){
... | a.cc: In function 'int main()':
a.cc:6:10: error: 'vector' is not a member of 'std'
6 | std::vector<int> data;
| ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
2 | #include <algorithm>
+++ |+#include <vector>
... |
s787060054 | p00255 | C++ | #include <iostream>
#include <algorithm>
int main()
{
std::vector<int> data;
int ddata;
int num;
int maxvul;
int count,length;
std::cin>>num;
while(num){
data.resize(num-1);
maxvul=0;
for(int i=0;i<num;i++){
std::cin>>ddata;
maxvul+=ddata;
}
ddata=maxvul;
maxvul*=num;
for(int i=0;i<num-1;... | a.cc: In function 'int main()':
a.cc:6:10: error: 'vector' is not a member of 'std'
6 | std::vector<int> data;
| ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
2 | #include <algorithm>
+++ |+#include <vector>
... |
s199904623 | p00255 | C++ | #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cst... | a.cc: In function 'int main()':
a.cc:53:33: error: 'P' was not declared in this scope
53 | sum *= (P.size() - i);
| ^
|
s736511900 | p00256 | C | #include<iostream>
#include<string.h>
#include<stdlib.h>
#include<time.h>
#include<stdio.h>
using namespace std;
struct tm T;
struct tm *a;
int maya[5]={144000,7200,360,20,1};
int sugi[5]={1,20,20,18,20};
int main(){
if(sizeof(time_t)!=8)exit(1);
time_t tt,kin,ans,s=1356015600;
char koyomi[50];
int i,j;
int n[5... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s171183221 | p00256 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
ll gettime64(ll y,ll m,ll d){
struct tm poi;
poi.tm_year = y-1900;
poi.tm_mon = m-1;
poi.tm_mday = d;
poi.tm_hour = poi.tm_min = poi.tm_sec = 0;
poi.tm_isdst = -1;
return _mktime64(&poi);
}
int toint(string s){... | a.cc: In function 'll gettime64(ll, ll, ll)':
a.cc:15:10: error: '_mktime64' was not declared in this scope; did you mean 'mktime'?
15 | return _mktime64(&poi);
| ^~~~~~~~~
| mktime
a.cc: In function 'int main()':
a.cc:73:37: error: '__time64_t' was not declared in this scope; did you... |
s116730226 | p00256 | C++ | #include <bits/stdc++.h>
#include <time.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
ll gettime64(ll y,ll m,ll d){
struct tm poi;
poi.tm_year = y-1900;
poi.tm_mon = m-1;
poi.tm_mday = d;
poi.tm_hour = poi.tm_min = poi.tm_sec = 0;
poi.tm_isdst = -1;
return _mktime64(&poi);
}
in... | a.cc: In function 'll gettime64(ll, ll, ll)':
a.cc:16:10: error: '_mktime64' was not declared in this scope; did you mean 'mktime'?
16 | return _mktime64(&poi);
| ^~~~~~~~~
| mktime
a.cc: In function 'int main()':
a.cc:74:37: error: '__time64_t' was not declared in this scope; did you... |
s651864875 | p00256 | C++ | #include <bits/stdc++.h>
#include <time.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
ll gettime64(ll y,ll m,ll d){
struct tm poi;
poi.tm_year = y-1900;
poi.tm_mon = m-1;
poi.tm_mday = d;
poi.tm_hour = poi.tm_min = poi.tm_sec = 0;
poi.tm_isdst = -1;
return _mktime64(&poi);
}
in... | a.cc: In function 'll gettime64(ll, ll, ll)':
a.cc:16:10: error: '_mktime64' was not declared in this scope; did you mean 'mktime'?
16 | return _mktime64(&poi);
| ^~~~~~~~~
| mktime
a.cc: In function 'int main()':
a.cc:74:37: error: '__time64_t' was not declared in this scope; did you... |
s690987371 | p00256 | C++ | #include <bits/stdc++.h>
#include <time.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
ll gettime64(ll y,ll m,ll d){
struct tm poi;
poi.tm_year = y-1900;
poi.tm_mon = m-1;
poi.tm_mday = d;
poi.tm_hour = poi.tm_min = poi.tm_sec = 0;
poi.tm_isdst = -1;
return mktime(&poi);
}
int t... | a.cc: In function 'int main()':
a.cc:74:33: error: invalid conversion from 'll*' {aka 'long long int*'} to 'const time_t*' {aka 'const long int*'} [-fpermissive]
74 | struct tm *birth = gmtime(&val);
| ^~~~
| |
| ... |
s973318709 | p00256 | C++ | #include<iostream>
#include<string.h>
#include<stdlib.h>
#include<time.h>
#include<stdio.h>
using namespace std;
struct tm T;
struct tm *a;
int maya[5]={144000,7200,360,20,1};
int sugi[5]={1,20,20,18,20};
int main(){
time_t tt,kin,ans,s=1356015600;
char koyomi[50];
int i,j;
int n[5]={0};
while(1){
cin>>koyomi... | a.cc: In function 'int main()':
a.cc:46:2: error: expected '}' at end of input
46 | }
| ^
a.cc:11:11: note: to match this '{'
11 | int main(){
| ^
|
s926239848 | p00256 | C++ | v#include<bits/stdc++.h>
#define LL long long int
#define INF 734858
using namespace std;
int main(void)
{
LL b,ka,t,w,ki,y,m,d,sum,cnt,mon,day,year;
LL i,j,k;
LL maya[5]={144000,7200,360,20,1};
LL month[2][12]={
{31,28,31,30,31,30,31,31,30,31,30,31},
{31,29,31,30,31,30,31,31,30,31,30,31}
};
char s[... | a.cc:1:2: error: stray '#' in program
1 | v#include<bits/stdc++.h>
| ^
a.cc:1:1: error: 'v' does not name a type
1 | v#include<bits/stdc++.h>
| ^
a.cc: In function 'int main()':
a.cc:16:17: error: 'cin' was not declared in this scope
16 | cin>>s;
| ^~~
a.cc:... |
s252257737 | p00256 | C++ | #include <stdio.h>
#include <ctype.h>
char *gets(char *);
char buf[100], *p;
int getInt(void)
{
int n = 0;
while (isspace(*p) || *p == '.') p++;
if (!*p) return -1;
while (isdigit(*p)) n = 10 * n + (*p++ - '0');
return n;
}
#define MAGIC 2456283 // 2012.12.21
long long greg2jd(int year... | /usr/bin/ld: /tmp/ccmmUhOM.o: in function `main':
a.cc:(.text+0x398): undefined reference to `gets(char*)'
collect2: error: ld returned 1 exit status
|
s422692828 | p00256 | C++ | #include <stdio.h>
#include <ctype.h>
char *gets(char *);
char buf[100], *p;
int getInt(void)
{
int n = 0;
while (isspace(*p) || *p == '.') p++;
if (!*p) return -1;
while (isdigit(*p)) n = 10 * n + (*p++ - '0');
return n;
}
#define MAGIC 2456283 // 2012.12.21
long long greg2jd(int year... | /usr/bin/ld: /tmp/ccIeUlRE.o: in function `main':
a.cc:(.text+0x398): undefined reference to `gets(char*)'
collect2: error: ld returned 1 exit status
|
s810716488 | p00257 | Java | import java.io.BufferedReader;
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
while(true){
final int max =sc.nextInt();
if(max == 0){
break;
}
final int n = sc.nextInt();
final int size = n + 2;
int[] map ... | Main.java:5: error: cannot find symbol
public static void main(String[] args) throws IOException {
^
symbol: class IOException
location: class Main
Main.java:6: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location... |
s123884830 | p00257 | C++ | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s715805802 | p00257 | C++ | #include<cstdio>
#include<queue>
#include<vector>
#define rep(i,a) for( int i = 0; i != (a); ++i )
#define repi(i,a,b) for( int i = (a); i != (b); ++i )
int ma;
int n;
int d[252];
std::vector<int> G[252], rG[252];
bool reach[252], rev[252];
void dfs( int v )
{
rev[v] = true;
rep( i, rG[v].size() )
if( !rev[rG[v]... | a.cc: In function 'int main()':
a.cc:60:17: error: 'memset' was not declared in this scope
60 | memset( reach, false, sizeof( reach ) );
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<q... |
s092725041 | p00257 | C++ | #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;
// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt"
typedef int Weig... | a.cc: In function 'int main()':
a.cc:231:82: error: no match for 'operator==' (operand types are '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' and 'std::vector<std::vector<int> >::iterator')
231 | if (find(edges[i].begin(), edges[i].end(), next) == edges.end()) {
| ... |
s731482620 | p00257 | C++ | if(Solve(x+i)==true)return true;
}
}
flg[x]=false;
return false;
}
int main(){
while(cin>>mx , mx){
cin >> n;
d[0]=0;
for(int i=1; i<=n; i++){
cin>>d[i];
flg[i]=false;
}
if(Solve(0)==true)cout<<"OK"<<endl;
else cout<<"NG"<<endl;
}
return 0;
... | a.cc:1:6: error: expected unqualified-id before 'if'
1 | if(Solve(x+i)==true)return true;
| ^~
a.cc:2:5: error: expected declaration before '}' token
2 | }
| ^
a.cc:4:3: error: expected declaration before '}' token
4 | }
| ^
a.cc:6:3: error: 'flg' does not name a type... |
s522500780 | p00257 | C++ | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
int M;
int N;
int D[259];
int main()
{
while(true){
scanf("%d",&M);
if(M==0)break;
scanf("%d",&N);
for(int i=1;i<=N;i++)scanf("%d",&D[i]);
vector<int> G[259];
for(int i=1;i<=N;i++){
if(i+D[i]<0)G[i].pb(0);
else if(i+D[i]>N+1)G[i].pb(N+... | a.cc: In function 'int main()':
a.cc:37:41: error: 'r' was not declared in this scope
37 | r++;
| ^
a.cc:58:54: error: 'G1' was not declared in this scope; did you mean 'F1'?
58 | ... |
s951172836 | p00257 | C++ | #include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
const INF = 1 << 22;
int main()
{
int Max,n;
while(cin >> Max, Max){
int map[252] = {};
int dist[252][252];
cin >> n;
for(int i = 1; i <= n; ++i){
cin >> map[i];
}
fill... | a.cc:6:7: error: 'INF' does not name a type
6 | const INF = 1 << 22;
| ^~~
a.cc: In function 'int main()':
a.cc:17:46: error: 'INF' was not declared in this scope
17 | fill((int*)dist,(int*)(dist + n + 2),INF);
| ^~~
|
s028224734 | p00257 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <vector>
#include <string>
using namespace std;
int maxCount, n;
vector<int> kouka;
int memo[252];//251があがり0がふりだし
int passed[252];
const int AGARI = 100000;
bool dfs(int index)
{
if(passed[index]) return false;
passed[index] = true;
... | a.cc: In function 'int main()':
a.cc:56:17: error: 'memset' was not declared in this scope
56 | memset(memo, true, sizeof(memo));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <queue>
... |
s867004081 | p00257 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <vector>
#include <string>
using namespace std;
int maxCount, n;
vector<int> kouka;
int memo[252];//251があがり0がふりだし
int passed[252];
const int AGARI = 100000;
bool dfs(int index)
{
if(passed[index]) return false;
passed[index] = true;
... | a.cc: In function 'int main()':
a.cc:56:17: error: 'memset' was not declared in this scope
56 | memset(memo, true, sizeof(memo));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <queue>
... |
s504398744 | p00257 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <vector>
#include <string>
using namespace std;
int maxCount, n;
vector<int> kouka;
int memo[252];//251があがり0がふりだし
int passed[252];
const int AGARI = 100000;
bool dfs(int index)
{
if(passed[index]) return false;
passed[index] = true;
... | a.cc: In function 'int main()':
a.cc:56:17: error: 'memset' was not declared in this scope
56 | memset(memo, true, sizeof(memo));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <queue>
... |
s396518566 | p00257 | C++ | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int maxCount, n;
vector<int> kouka;
int memo[252];//251があがり0がふりだし
int passed[252];
const int AGARI = 100000;
bool dfs(int index)
{
if(passed[index]) return false;
passed[index] = true;
index = min(n + 1, max(0 ,kouka[index] + index));
... | a.cc: In function 'int main()':
a.cc:53:17: error: 'memset' was not declared in this scope
53 | memset(memo, true, sizeof(memo));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <vector>... |
s729677270 | p00257 | C++ | #include <iostream>
#include <vector>
#include <bitset>
using namespace std;
int M, N, D[256];
bool G[256][256];
int main()
{
for(; cin >> M && M; ) {
memset(G, false, sizeof G);
cin >> N;
for(int i = 1; i <= N; i++) {
cin >> D[i];
}
for(int i = 0; i <= N; i++) {
for(int j = 1; j <= M; j++) {
... | a.cc: In function 'int main()':
a.cc:14:17: error: 'memset' was not declared in this scope
14 | memset(G, false, sizeof G);
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <bitset>
+++... |
s435671760 | p00258 | C | #include <iostream>
#include <algorithm>
using namespace std;
int n, c, a[32], b[32], dp[32][65536], st[32][65536];
int bit_count(int x){
int res = 0;
for(int i = 0 ; i < 16 ; i++ ){
if( x & (1 << i) ) res++;
}
return res;
}
int main(){
while( cin >> n >> c, n || c ){
fill(a, a + 32, 0);
fill(b, b + 32, ... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s256211004 | p00258 | C++ | #include<iostream>
using namespace std;
int n,c;
int a[33];
int b[33];
int memo[31][1 << 16 + 1];
int dp(int index,int bit);
int main(){
while(1){
cin >> n >> c;
if(n == 0 && c == 0) break;
for(int i=0;i<n;i++){
a[i] = 0;
for(int j=0;j<16;j++){
int aa;
cin >> aa;
if(aa) a[i] |= 1 << j;
}
... | a.cc: In function 'int main()':
a.cc:31:17: error: 'memset' was not declared in this scope
31 | memset(memo,0,sizeof(memo));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+... |
s930285341 | p00258 | C++ | #include <iostream>
#include <stdio.h>
#include <utility>
#include <algorithm>
#include <functional>
#include <string>
using namespace std;
typedef long long ll;
int st[31][1<<16],dp[31][1<<16];
int count(int num){
int res=0;
for(int i=0;i<16;i++)if((num>>i)&1)res++;
return res;
}
int main()
{
int n,c;
while(cin>>... | a.cc: In function 'int main()':
a.cc:19:17: error: 'memset' was not declared in this scope
19 | memset(st,0,sizeof(st));
| ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
5 | #include <functional>
++... |
s941202690 | p00258 | C++ | #include <iostream>
#include <stdio.h>
#include <utility>
#include <algorithm>
#include <functional>
#include <string>
#include <set>
using namespace std;
typedef long long ll;
int st[31][1<<16],dp[31][1<<16];
int count(int num){
int res=0;
for(int i=0;i<16;i++)if((num>>i)&1)res++;
return res;
}
int main()
{
int n,... | a.cc: In function 'int main()':
a.cc:20:17: error: 'memset' was not declared in this scope
20 | memset(st,0,sizeof(st));
| ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
7 | #include <set>
+++ |+#in... |
s339972208 | p00258 | C++ | const int pannels=16;
const int bits=2<<pannels;
int DP[bits+1][31]={};
int main(){
while(true){
int n,c,tmp;
cin >> n >> c;
if(n==0)
break;
queue<bitset<pannels> > qoo[2];
vector<bitset<pannels> > light;
vector<bitset<pannels> > push;
for(int i=0;i<bits;i++)
for(int j=0;j<31;j++)
DP[i][j... | a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
7 | cin >> n >> c;
| ^~~
a.cc:10:3: error: 'queue' was not declared in this scope
10 | queue<bitset<pannels> > qoo[2];
| ^~~~~
a.cc:10:9: error: 'bitset' was not declared in this scope; did you mean 'bits'?
... |
s050611388 | p00258 | C++ | #include <iostream>
#include <vector>
using namespace std;
int popcount(unsigned i) {
i = ((i & 0xaaaaaaaa) >> 1) + (i & 0x55555555);
i = ((i & 0xcccccccc) >> 2) + (i & 0x33333333);
i = ((i & 0xf0f0f0f0) >> 4) + (i & 0x0f0f0f0f);
i = ((i & 0xff00ff00) >> 8) + (i & 0x00ff00ff);
i = ((i & 0xffff0000... | a.cc: In function 'bool solve()':
a.cc:59:14: error: 'max_element' was not declared in this scope
59 | cout << *max_element(memo[0].begin(), memo[0].end()) << endl;
| ^~~~~~~~~~~
|
s147730084 | p00259 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;
public class Main_TLE_2 {
public static final int SIZE = 100000;
public static int[] queue = new int[SIZE + 1];
public static int tp = 0;
pu... | Main.java:8: error: class Main_TLE_2 is public, should be declared in a file named Main_TLE_2.java
public class Main_TLE_2 {
^
1 error
|
s158939390 | p00259 | C++ | #include<iostream>
using namespace std;
int power(int x,int k,int p){
if(k==0)return 1;
int tmp=power(x,k/2,p);
tmp*=tmp; tmp%=p;
if(k%2==1){tmp*=x; tmp%=p;}
return tmp;
}
int plus(int x,int y,int p){
return (x+y)%p;
}
int minus(int x,int y,int p){
return (x-y+p)%p;
}
int mul(int x,int y,int p){
return (x*y... | a.cc: In function 'int get()':
a.cc:31:29: error: 'rec' was not declared in this scope
31 | if(t[x]=='(')return rec();
| ^~~
a.cc: In function 'int rec()':
a.cc:53:51: error: 'p' was not declared in this scope
53 | if(C=='*')cur=mul(cur,aaa,p);
... |
s451106790 | p00259 | C++ | #include <cassert>
#include <cstdlib>
#include <iostream>
#include <sstream>
using namespace std;
int mod;
const char *p;
int mod_pow(int x, int n) {
int res = 1;
while(n > 0) {
if(n & 1) res = (res * x) % mod;
x = (x * x) % mod;
n >>= 1;
}
return res;
}
int mod_inverse(int x) {
return mod_pow(x, mod - 2)... | a.cc: In function 'int main()':
a.cc:86:39: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'const char*'
86 | s.erase(remove(s.begin(), s.end(), ' '), s.end());
| ~~~~~~~^~
| |
| ... |
s376639875 | p00259 | C++ | #include <algorithm>
#include <cctype>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
#define reps(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reps(i,0,n)
int p;... | a.cc: In function 'int num(std::string&, int&)':
a.cc:40:15: error: 'isnumber' was not declared in this scope
40 | while(isnumber(s[t])){
| ^~~~~~~~
|
s803103081 | p00259 | C++ | /* package whatever; // don't place package name! */
import java.util.*;
import java.util.regex.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
public static void main(String[] args) {
try (BufferedReader in = new BufferedReader(new... | a.cc:3:1: error: 'import' does not name a type
3 | import java.util.*;
| ^~~~~~
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 java.util.regex.*;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.... |
s411457144 | p00259 | C++ | #line 0 "cmacro.cpp"
#include <bits/stdc++.h>
using namespace std;
#define in ,
#define esc_paren(...) __VA_ARGS__
#define pp_empty(...)
#define pp_cat_i(x, y) x ## y
#define pp_cat(x, y) pp_cat_i(x, y)
#define pp_inc0 1
#define pp_inc1 2
#define pp_inc2 3
#define pp_inc3 4
#define pp_inc4 5
#define pp_inc5 6
#defin... | procon.cpp: In function 'int main()':
procon.cpp:172:9: error: 'res' was not declared in this scope; did you mean 'rep'?
|
s787678740 | p00259 | C++ |
#include <iostream>
#include <vector>
#include <cmath> // ??????
#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 REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
typedef long long ll;
using namespace std;
long long inv_mod(lon... | a.cc: In function 'int main()':
a.cc:9:53: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'const char*'
9 | #define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
| ~~~~~~~~~~~^~
| ... |
s846810579 | p00259 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include... | a.cc:27:2: error: stray '#' in program
27 |     
| ^
a.cc:27:8: error: stray '#' in program
27 |     
| ^
a.cc:27:14: error: stray '#' in program
27 |     
| ^
a.cc:27:20: error: stray '#' in program
27 | ... |
s089113821 | p00259 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include... | a.cc: In function 'int main()':
a.cc:219:16: error: no matching function for call to 'remove(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator)'
219 | s.erase(remove(all(s)), s.end()));
| ~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:86,
... |
s050528497 | p00259 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include... | a.cc: In function 'int main()':
a.cc:219:16: error: no matching function for call to 'remove(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator)'
219 | s.erase(remove(all(s)), s.end());
| ~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:86,
... |
s590414429 | p00259 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <stack>
#include <cli... | a.cc: In function 'int analysis(std::string&, int, int)':
a.cc:132:12: error: expected ';' before '}' token
132 | return -1
| ^
| ;
133 | }
| ~
|
s520813380 | p00260 | C++ | #include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cmath>
#include <climits>
#include <utility>
#include <bitset>
#include <iostream>
using namespace std;
#define EPS 1e-7
typedef vector<double> vdouble;
typedef complex<double> P;
typedef const P &rP;
typedef pair<double,int> pdi;... | a.cc: In function 'int solve()':
a.cc:135:39: error: 'DBL_MAX' was not declared in this scope
135 | double cuts = DBL_MAX;
| ^~~~~~~
a.cc:11:1: note: 'DBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
... |
s951645918 | p00260 | C++ | #include<stdio.h>
#include<algorithm>
#include<math.h>
using namespace std;
double x[20];
double y[20];
double Abs(int a){
return max(a,-a);
}
const double EPS=1e-10;
const double INF=1e+6;
const double PI=acos(-1);
int sig(double r){return (r<-EPS)?-1:(r>+EPS)?+1:0;}
struct Pt{
double x,y;
Pt(){}
Pt(double x,double y)... | a.cc:117:101: error: stray '#' in program
117 | val2[Sz++]=point[(k+1)%a]+(pLL(point[i],point[j],point[k],point[(k+1)%a]-point[(k+1)%a])*(1.0-EPS); }
| ^
a.cc: In function 'int main()':
a.cc:116:87: error: e... |
s991262808 | p00260 | C++ | #include<stdio.h>
#include<algorithm>
#include<math.h>
using namespace std;
double x[20];
double y[20];
double Abs(int a){
return max(a,-a);
}
const double EPS=1e-10;
const double INF=1e+6;
const double PI=acos(-1);
int sig(double r){return (r<-EPS)?-1:(r>+EPS)?+1:0;}
struct Pt{
double x,y;
Pt(){}
Pt(double x,double y)... | a.cc:117:102: error: stray '#' in program
117 | val2[Sz++]=point[(k+1)%a]+(pLL(point[i],point[j],point[k],point[(k+1)%a])-point[(k+1)%a])*(1.0-EPS); }
| ^
a.cc: In function 'int main()':
a.cc:117:103: error... |
s196625564 | p00260 | C++ | g#include <iostream>
#include <complex>
#include <vector>
#include <algorithm>
using namespace std;
const double EPS = 1e-9;
typedef complex<double> P;
inline double dot(const P &a, const P &b) {
return a.real()*b.real() + a.imag()*b.imag();
}
inline double cross(const P &a, const P &b) {
return a.real()*b... | a.cc:1:2: error: stray '#' in program
1 | g#include <iostream>
| ^
a.cc:1:1: error: 'g' does not name a type
1 | g#include <iostream>
| ^
In file included from /usr/include/c++/14/complex:43,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __... |
s403981806 | p00261 | C | #include<iostream>
#include<cstring>
using namespace std;
string removedFirst(string str) {
string ans;
if(str.length() == 1) {
return ans;
}
else {
for(int i=1; i<str.length(); i++) {
ans += str[i];
}
return ans;
}
}
int main() {
string str;
getline(cin, str);
while(str != "#... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s379823326 | p00261 | C++ | #include<iostream>
#include<cstring>
using namespace std;
string removedFirst(string str) {
string ans;
if(str.length() == 1) {
return ans;
}
else {
for(int i=1; i<str.length(); i++) {
ans += str[i];
}
return ans;
}
}
int main() {
string str;
getline(cin, str);
while(str != '#... | a.cc: In function 'int main()':
a.cc:24:13: error: no match for 'operator!=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
24 | while(str != '#') {
| ~~~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::... |
s613671504 | p00261 | C++ | #include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int g[6][2]={{1,2},{0,3},{1,0},{4,5},{5,2},{2,1}};
char str[128];
while(scanf("%s",str),str[0]!='#'){
int pos=0;
for(int i=0;str[i];i++){
pos=g[pos][str[i]-'0'];
}
puts(pos==5?"... | a.cc:21:5: error: redefinition of 'int main()'
21 | int main(){
| ^~~~
a.cc:5:5: note: 'int main()' previously defined here
5 | int main(){
| ^~~~
|
s050067329 | p00261 | C++ | #include <bits/stdc++.h>
using namespace std;
const signed int t[2][6] = {{1, -1, 1, 4, 5, 2},
{2, 3, -1, 5, 2, 1},
};
int main(void){
string str;
while(cin >> str, str != "#"){
int now_pos = 0;
for(int p=0; p < str.size(); p++){
if([str[p] - '0'][no... | a.cc: In function 'int main()':
a.cc:13:14: error: expected ',' before '[' token
13 | if([str[p] - '0'][now_pos] == -1){
| ^
| ,
a.cc:13:14: error: expected identifier before '[' token
a.cc: In lambda function:
a.cc:13:24: error: expected '{' before '[' token
13 | ... |
s423713050 | p00261 | C++ | #include <iostream>
using namespace std;
#define F(i,n) for( int i = 0; i < n; i++ )
char graph[6][2] = {
// fで失敗
{ 'x', 'y' }, // a
{ 'f', 'z' }, // x
{ 'x', 'f' }, // y
{ 'w', 'b' }, // z
{ 'b', 'y' }, // w
{ 'y', 'x' } // b
};
bool simulate( string s ){
char now = 'a';
F( i, s.size() ){
... | a.cc:33:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
33 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:41:4: error: expected '}' at end of input
41 | }
| ^
a.cc:33:7: note: to match this '{'
33 | main(){
| ^
|
s500239099 | p00262 | C++ | #include <iostream>
using namespace std;
int b[1000000];
int main(){
int n;
while(cin >>n , n){
for (int i = 0; i < n; ++i){
cin >> b[i];
}
int i = 0;
for (; i <= 10000; ++i){
bool f = true;
for (int k = 0; k < 1000000 && b[k]; ++k){
if (b[k] != k+1){
f = false;
... | a.cc: In function 'int main()':
a.cc:51:14: error: expected ';' before 'cout'
51 | } else {0
| ^
| ;
52 | cout << -1 << endl;
| ~~~~
|
s268810443 | p00262 | C++ | 6
1 4 1 3 2 4
5
1 2 3 4 5
10
1 1 1 1 1 1 1 1 1 1
9
1 1 1 1 1 1 1 1 1
12
1 4 1 3 2 4 3 3 2 1 2 2
1
5050
3
10000 10000 100
0 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 6
| ^
|
s184958794 | p00262 | C++ | #include <bits/stdc++.h>
using namespace std;
#define SMIN 3
#define SMAX 1000000
#define NMIN 1
#define NMAX 100
#define BMIN 1
#define BMAX 10000
#define LIM 10000
#define TCASE 20
bool valid[SMAX+1];
bool check(vector<int> v){
if ( v[0] != 1 ) return false;
for ( int i = 1; i < v.size(); i++ ){
if ( v[i-1]... | a.cc:39:1: error: '::main' must return 'int'
39 | void main(){
| ^~~~
|
s425918817 | p00263 | C | #include <iostream>
#include <cstdio>
using namespace std;
int main(){
int Q;
cin >> Q;
while(Q--){
unsigned int s;
scanf("%x" ,&s);
if(s >> 31) cout << '-';
int integer = (s & 0x7fffffff) >> 7;
int decimal = (s & 0x0000007f);
double c[7],d = 0.0;
c[0] = 0.5;
for(int i = 1... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s092627399 | p00263 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int n, x, t;
int main() {
scanf("%d", &n);
for(int i = 0; i < n; i++) {
scanf("%x", &x);
t = x >= 0 ? 1 : -1;
x = x >= 0 ? x : x - 2147483648;
cout << x / 128.0 * t << x % 128 == 0 ? "0" : "" << endl;
}
} | a.cc: In function 'int main()':
a.cc:11:50: error: no match for 'operator==' (operand types are 'std::basic_ostream<char>' and 'int')
11 | cout << x / 128.0 * t << x % 128 == 0 ? "0" : "" << endl;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~ ~
| ... |
s344785345 | p00263 | C++ | #include<iostream>
#include<map>
#include<cmath>
#include<cstdlib>
#include<iomanip>
#include<sstream>
using namespace std;
string toBinary(string c)
{
if(c == "0")
return "0000";
int val = (atoi)(c.c_str());
string ret,ret2;
while(true)
{
if(val == 1)
{
ret += "1";
break;
}
v... | a.cc: In function 'std::string toBinary(std::string)':
a.cc:25:3: error: 'reverse' was not declared in this scope
25 | reverse(ret.begin(),ret.end());
| ^~~~~~~
|
s507130319 | p00263 | C++ | #include<iostream>
#include<map>
#include<string>
#include<cstring>
#include<cstdlib>
#include<cstdio>
using namespace std;
char pat[16][5] = {"0000" ,
"0001" ,
"0010" ,
"0011" ,
"0100" ,
"0101" ,
"0110" ,
"0111" ,
"1000" ,
"1001" ,
"1010" ,
"1011" ,
... | a.cc: In function 'int main()':
a.cc:51:42: warning: converting to non-pointer type 'char' from NULL [-Wconversion-null]
51 | char str_input[9] = {NULL};
| ^
a.cc:63:43: warning: converting to non-pointer type 'char' from NULL [-Wconversion-null]
63 |... |
s735769508 | p00263 | C++ |
#include<iostream>
#include<map>
#include<string>
#include<cstring>
#include<cstdlib>
#include<cstdio>
using namespace std;
char pat[16][5] = {"0000" ,
"0001" ,
"0010" ,
"0011" ,
"0100" ,
"0101" ,
"0110" ,
"0111" ,
"1000" ,
"1001" ,
"1010" ,
"10... | a.cc: In function 'int main()':
a.cc:60:42: warning: converting to non-pointer type 'char' from NULL [-Wconversion-null]
60 | char str_input[9] = {NULL};
| ^
a.cc:72:43: warning: converting to non-pointer type 'char' from NULL [-Wconversion-null]
72 |... |
s577091265 | p00264 | C | #include <stdio.h>
#include <string.h>
#include <math.h>
#define PI 3.1415926535897932384626433832795028841971693993751058209749445923078164
struct point{
int x,y;
};
struct wind{
int w,a;
};
double getlen(int x1,int y1,int x2,int y2){
return sqrt(pow((x1-x2)*1.0,2)+pow((y1-y2)*1.0,2));
}
int check(int N,point *... | main.c:18:17: error: unknown type name 'point'; did you mean 'int'?
18 | int check(int N,point *tree,point house,wind wind,int dtree){
| ^~~~~
| int
main.c:18:29: error: unknown type name 'point'; did you mean 'int'?
18 | int check(int N,point *tree,point house,wind win... |
s582851142 | p00264 | C++ | #include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<numeric>
using namespace std;
const double PI = 3.14159265358979;
class Point {
public:
double x, y;
Point(double x = 0.0, double y = 0.0) :x(x), y(y) {}
};
class Wind {
public:
double w, a;
};
bool include(double angle... | a.cc: In function 'bool savor(const Point&, const Wind&, const std::vector<Point>&, double)':
a.cc:40:29: error: 'EPS' was not declared in this scope
40 | if(dist <= wind.a + EPS && include(angle, wind.w - d, wind.w + d)) return true;
| ^~~
|
s534281777 | p00264 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef pair<int,int>pint;
typedef vector<int>vint;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);i++)
template<class T,class U>void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>void chmax(T &t,U f){if(t<f)t=f;}
typedef complex<doubl... | a.cc: In function 'bool ok(P, P, double, double, double)':
a.cc:58:18: error: too many arguments to function 'double cross(const P&, const P&)'
58 | return (cross(from,p1,to)>EPS)&&(cross(from,p2,to)<EPS);
| ~~~~~^~~~~~~~~~~~
a.cc:24:15: note: declared here
24 | inline double cross(const P &... |
s765206702 | p00264 | C++ | #include <bits/stdc++.h>
using namespace std;
#define EPS (1e-8)
#define equals(a, b) (fabs((a) - (b)) < EPS )
#define dle(a, b) (equals(a, b) || a < b )
#define LIM 0.001
static const double PI = acos(-1);
class Point{
public:
double x, y;
Point ( double x = 0, double y = 0): x(x), y(y){}
Point op... | a.cc: In function 'double getDistance(Segment, Segment)':
a.cc:75:10: error: 'isIntersect' was not declared in this scope
75 | if ( isIntersect(s1, s2) ) return 0.0;
| ^~~~~~~~~~~
|
s676988207 | p00264 | C++ | #include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloa... | a.cc: In function 'int main()':
a.cc:123:38: error: cannot bind non-const lvalue reference of type 'std::vector<Point>&' to an rvalue of type 'std::vector<Point>'
123 | if(ok && check(h[i], vector<Point>(1, Point(0, 0)), angle[0], dir[j], len[j]))
| ^~~~~~~~~... |
s828086912 | p00264 | C++ | #include <iostream>
#include <algorithm>
#include <complex>
#include <vector>
#include <cmath>
using namespace std;
typedef complex<double> P;
const double PI = acos(-1);
const double EPS = 1e-9;
bool hit(P p,double a,double b,double r){
if( abs(p) > r + EPS ) return false;
double deg = atan2(p.imag(),p.real());
if... | a.cc: In function 'int main()':
a.cc:23:50: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'double')
23 | for(int i = 0 ; i < H ; i++) cin >> home[i].real() >> home[i].imag();
| ~~~ ^~ ~~~~~~~~... |
s363902184 | p00265 | Java | import java.util.*;
import java.io.*;
import static java.lang.Math.*;
class Main {
public static void main( final String[] args ) {
final Scanner stdin = new Scanner( System.in );
final String[] param = stdin.nextLine().split( " " );
final int N = Integer.parseInt( param[ 0 ] );
final int Q = Integer.parseI... | Main.java:27: error: variable i is already defined in method main(String[])
for ( int i : cs ) {
^
Main.java:30: error: package Systme does not exist
Systme.out.println( maxMod );
^
2 errors
|
s839549182 | p00265 | Java | import java.io.*;
public class ModuloQuery {
public static void main(String[] args) throws Exception {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String input = in.readLine();
String[] tmp = input.split(" ",0);
int n = Integer.parseInt(tmp[0]);
int Q = Integer.parseInt(tmp[1])... | Main.java:3: error: class ModuloQuery is public, should be declared in a file named ModuloQuery.java
public class ModuloQuery {
^
1 error
|
s398247879 | p00265 | C++ | #include <iostream>
#include <vector>
using namespace std;
vector<int> card;
int main(void){
int N, Q, c, q;
cin >> N >> Q;
for(int i = 0; i < N; i++){
cin >> c;
card.push_back(c);
}
sort(card.begin(), card.end());
int me = card[N - 1];
for(int i = 0; i < Q; i++){
cin >> q;
int M = -1;
... | a.cc: In function 'int main()':
a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'?
14 | sort(card.begin(), card.end());
| ^~~~
| short
|
s305779547 | p00265 | C++ | #include<stdio.h>
int main(){
int N,Q,c[300000],q[100000],i,j;
innt j=-1
scanf("%d",&N);
scanf("%d",&Q);
for(i=0;i<N;i++){
scanf("%d",&c[i]);
}
for(i=0;i<Q;i++){
scanf("%d",&q[i]);
}
for(i=0;i<Q;i++){
for(j=0;j<N;j++){
if(c[j]%q[i]>g){
g=c[j]%q[i];
}
}
printf("%d\n",g);
g=0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:1: error: 'innt' was not declared in this scope; did you mean 'int'?
5 | innt j=-1
| ^~~~
| int
a.cc:16:14: error: 'g' was not declared in this scope
16 | if(c[j]%q[i]>g){
| ^
a.cc:20:15: error: 'g' was not declared in this scope
20 | print... |
s478024152 | p00265 | C++ | #include<stdio.h>
int main(){
int N,Q,c[300000],q[100000],i,j;
int j=-1
scanf("%d",&N);
scanf("%d",&Q);
for(i=0;i<N;i++){
scanf("%d",&c[i]);
}
for(i=0;i<Q;i++){
scanf("%d",&q[i]);
}
for(i=0;i<Q;i++){
for(j=0;j<N;j++){
if(c[j]%q[i]>g){
g=c[j]%q[i];
}
}
printf("%d\n",g);
g=0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:5: error: redeclaration of 'int j'
5 | int j=-1
| ^
a.cc:4:31: note: 'int j' previously declared here
4 | int N,Q,c[300000],q[100000],i,j;
| ^
a.cc:16:14: error: 'g' was not declared in this scope
16 | if(c[j]%q[i]>g){
... |
s774836197 | p00265 | C++ | #include<stdio.h>
int main(){
int N,Q,c[300000],q[100000],i,j;
int j=-1;
scanf("%d",&N);
scanf("%d",&Q);
for(i=0;i<N;i++){
scanf("%d",&c[i]);
}
for(i=0;i<Q;i++){
scanf("%d",&q[i]);
}
for(i=0;i<Q;i++){
for(j=0;j<N;j++){
if(c[j]%q[i]>g){
g=c[j]%q[i];
}
}
printf("%d\n",g);
g=0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:5: error: redeclaration of 'int j'
5 | int j=-1;
| ^
a.cc:4:31: note: 'int j' previously declared here
4 | int N,Q,c[300000],q[100000],i,j;
| ^
a.cc:16:14: error: 'g' was not declared in this scope
16 | if(c[j]%q[i]>g){
... |
s882517466 | p00265 | C++ | int main(){
int N,Q,c[300000],q[100000],i,j,g=-1;
scanf("%d",&N);
scanf("%d",&Q);
for(i=0;i<N;i++){
scanf("%d",&c[i]);
}
for(i=0;i<Q;i++){
scanf("%d",&q[i]);
}
for(i=0;i<Q;i++){
for(j=0;j<N;j++){
if(c[j]%q[i]>g){
g=c[j]%q[i];
}
}
printf("%d\n",g);
g=0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:3:1: error: 'scanf' was not declared in this scope
3 | scanf("%d",&N);
| ^~~~~
a.cc:17:1: error: 'printf' was not declared in this scope
17 | printf("%d\n",g);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#... |
s418973112 | p00265 | C++ | #include <cstdio>
#define MAX_N 300000
#define MAX_C 300000
int main(){
int N, Q;
scanf("%d %d\n", &N, &Q);
int card[MAX_N];
bool has_card[MAX_C+1];
for(int i = 0; i < N; i++){
scanf("%d", &card[i]);
// printf("card %d ", card[i]);
}
for(int i = 0; i <= MAX_C; i++){
has_card[i] = false;
}
... | a.cc: In function 'int main()':
a.cc:27:31: error: expected primary-expression before '>' token
27 | for(int init = q-1; init => 0; init--){
| ^
|
s899280983 | p00265 | C++ | #include<iostream>
int p[1<<20],n,q,a,i,j,c;main(){cin>>n>>q;for(i=0;i<n;i++){std::cin>>a;p[a]=1;}for(i=0;i<q;i++){cin>>a;for(j=a-1;j>=0;j--){c=j;while(1){if(p[c]){std::cout<<j<<"\n";goto E;}c+=a;if(c>300000)break;}}E:;}} | a.cc:2:26: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | int p[1<<20],n,q,a,i,j,c;main(){cin>>n>>q;for(i=0;i<n;i++){std::cin>>a;p[a]=1;}for(i=0;i<q;i++){cin>>a;for(j=a-1;j>=0;j--){c=j;while(1){if(p[c]){std::cout<<j<<"\n";goto E;}c+=a;if(c>300000)break;}}E:;}}
| ... |
s744007052 | p00265 | C++ | #include<iostream>
int p[1<<20],n,q,a,i,j,c;main(){std::cin>>n>>q;for(i=0;i<n;i++){std::cin>>a;p[a]=1;}for(i=0;i<q;i++){cin>>a;for(j=a-1;j>=0;j--){c=j;while(1){if(p[c]){std::cout<<j<<"\n";goto E;}c+=a;if(c>300000)break;}}E:;}} | a.cc:2:26: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | int p[1<<20],n,q,a,i,j,c;main(){std::cin>>n>>q;for(i=0;i<n;i++){std::cin>>a;p[a]=1;}for(i=0;i<q;i++){cin>>a;for(j=a-1;j>=0;j--){c=j;while(1){if(p[c]){std::cout<<j<<"\n";goto E;}c+=a;if(c>300000)break;}}E:;}}
| ... |
s836033119 | p00265 | C++ | #include<iostream>
using namespace std;
int main(){
int c[300001] = { 0 },N,Q,max=1,num,q;
cin >> N >> Q;
for(int i=0;i<N;i++){
cin >> num;
c[num]=1;
if(max < num)max=num;
}
for(int i=0; i<Q ; i++){
cin >> q;
for(int j=q-1;j>=0;j--){
for(int k = j;k <= max;k+=q){
if(c[k]){???
co... | a.cc: In function 'int main()':
a.cc:16:15: error: expected primary-expression before '?' token
16 | if(c[k]){???
| ^
a.cc:16:16: error: expected primary-expression before '?' token
16 | if(c[k]){???
| ^
a.cc:16:17: error: expected primary-expression before '?' t... |
s636912344 | p00265 | C++ | #include<bits/stdc++.h>
#define int long long
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
bool b[10000001];
int main() {
int n, q; scanf("%lld%lld", &n, &q);
... | cc1plus: error: '::main' must return 'int'
|
s606772394 | p00265 | C++ | # include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
#include<limits.h>
#include<unorde... | a.cc: In function 'int main()':
a.cc:31:29: error: template argument 1 is invalid
31 | std::bitset<???00000> bit;
| ^
a.cc:35:20: error: invalid types 'int[int]' for array subscript
35 | bit[nn-1] = 1;
| ^
a.cc:44:40: error: invali... |
s612130536 | p00265 | C++ |
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
long n,qq;
scanf ("%ld %ld",&n,&qq);
vector<long> c;
int k;
for(k=0;k<n;k++){
c.push_back(0);
scanf ("%ld",&c[k]);
}
long q;
long ans=0;
for(int t=0;t<qq;t++... | a.cc: In function 'int main()':
a.cc:21:12: error: expected ';' before 'scanf'
21 | ans=0
| ^
| ;
22 | scanf ("%ld",&q);
| ~~~~~
|
s167144935 | p00265 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(void){
int n,q;
cin>>n>>q;
int m=n;
int a[300010];
while(m--)cin>>a[i];
int ans=0;
for(int i=0;i<q;i++){
int x;
cin>>x;
for(int j=x;j<300000;j+=x)ans=max(ans,a[lower_bound(a,a+n,j)-a-1]%x);
c... | a.cc: In function 'int main()':
a.cc:9:22: error: 'i' was not declared in this scope
9 | while(m--)cin>>a[i];
| ^
|
s553525072 | p00266 | C | #include <iostream>
#include <algorithm>
#include <vector>
int main(void){
clock_t startTime, endTime;
using namespace std;
int i,j;
//階乗の計算
long long int fact[100000]={0};
for(i=0; i<100000; i++){
if(i==0) fact[i] = 1;
else fact[i] = (fact[i-1]*i)%1000000007;
}
long int N,K;
cin >> N;
while(N!=0){
ci... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s083203370 | p00266 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
const long long B = 1000000007;
bool countOne(){
int N, R;
cin >> N;
if(N==0) return false;
cin >> R;
int *counter = new int[N]();
for(int r=0; r<R; r++){
int s, t;
*fin >> s >> t;
for(int i=t-1; i>=s; i--){
int a = counter[i-1];
int b = c... | a.cc: In function 'bool countOne()':
a.cc:15:18: error: 'fin' was not declared in this scope
15 | *fin >> s >> t;
| ^~~
|
s739410953 | p00266 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<map>
using namespace std;
const int N_MAX = 100000;
const int R_MAX = 50;
const int BigNumber = 1000000007;
struct squaence{
int start,length, counter;
squaence(){}
squaence(int _start, int _end){
start = _start;
length = _end - _start + 1;
... | a.cc: In function 'int main()':
a.cc:43:25: error: 'fin' was not declared in this scope
43 | fin >> tmp_s >> tmp_t;
| ^~~
|
s429306671 | p00266 | C++ | #include<bits/stdc++.h>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
using namespace std;
typedef long long ll;
const ll MOD = 1000000007LL;
int N;
ll fact[200000];
ll compute(vector<int> vec){
ll ret = fact[vec.size()];
set<int> S;
rep(i,vec.size()) {
int tp = -1;
for(int j=N;j... | In file included from /usr/include/c++/14/cassert:44,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:106,
from a.cc:1:
a.cc: In function 'll compute(std::vector<int>)':
a.cc:21:13: error: 'ceof' was not declared in this scope; did you mean 'coef'?
21 | assert( ceof >= 0... |
s808753994 | p00266 | C++ | include<bits/stdc++.h>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
using namespace std;
typedef long long ll;
const ll MOD = 1000000007LL;
int N;
ll fact[200000];
ll compute(vector<int> vec){
ll ret = fact[vec.size()];
set<int> S;
rep(i,vec.size()) {
int tp = -1;
for(int j=N;j>... | a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
a.cc:13:12: error: 'vector' was not declared in this scope
13 | ll compute(vector<int> vec){
| ^~~~~~
a.cc:13:19: error: expected primary-expression before 'int'
13 | ll compute(vector<int> vec){
... |
s665943316 | p00266 | C++ | #include <iostream>
#include <set>
#include <vector>
using namespace std;
typedef long long ll;
#define MOD 1000000007LL
int n, m;
int a[52], b[52];
int t[100002];
ll f[100002];
vector<int> cg;
void mkFact(){
f[0] = 1;
for(ll i = 1; i <= 100000; i++){
f[i] = f[i - 1] * i;
f[i] %= MOD;
}
}
void show(i... | a.cc: In function 'void show(int, int)':
a.cc:30:5: error: 'next_permutation' was not declared in this scope
30 | next_permutation(s.begin(), s.end());
| ^~~~~~~~~~~~~~~~
|
s548250469 | p00268 | C++ | #include <cmath>
#include <queue>
#include <cstdio>
#include <cassert>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
const double EPS=1e-8;
const double PI=acos(-1);
struct point{
double x,y;
point():x(0),y(0){}
point(double x,double y):x(x),y(y){}
point &operator+=(const point &a){ x+=a.x; y+=a.... | a.cc: In function 'std::vector<int> reg(std::vector<int>)':
a.cc:59:15: error: 'min_element' was not declared in this scope
59 | int k=min_element(a.begin(),a.end())-a.begin();
| ^~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:87:25: error: 'sort' was not declared in this scope; did you ... |
s924946478 | p00268 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<string>
#include<stack>
#include<cstdio>
#include<cmath>
using namespace std;
typedef long long LL;
typedef long double LD;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<int,pair<bool,double> > ... | a.cc: In function 'int main()':
a.cc:52:34: error: 'Sleep' was not declared in this scope
52 | ppp++; if(ppp>=6)Sleep(100000);
| ^~~~~
|
s789091142 | p00268 | C++ | #include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<complex>
#include<deque>
#include<vector>
using namespace std;
double eps=1e-6;
double x[110];
double y[110];
double px[700];
double py[700];
int ijk[700];
int v[700];
const double EPS = 1e-8;
const double INF = 1e12;
double PI=3.1415926535... | a.cc: In function 'int ccw(const P&, const P&, const P&)':
a.cc:53:13: error: passing 'const P' as 'this' argument discards qualifiers [-fpermissive]
53 | b=b-a;c=c-a;
| ^
a.cc:19:8: note: in call to 'constexpr P& P::operator=(P&&)'
19 | struct P{
| ^
a.cc:53:19: error: pa... |
s022392472 | p00268 | C++ | #include <bits/stdc++.h>
#ifdef LOCAL
#include "dump.hpp"
#else
#define dump(...)
#endif
using namespace std;
struct point {
int x, y;
explicit point(double x_ = 0.0, double y_ = 0.0):x(x_), y(y_) {}
point(const point &p):x(p.x), y(p.y) {}
point operator+(const point &p) const {
return point(x + p.x, y + p.y)... | a.cc: In function 'std::ostream& operator<<(std::ostream&, const point&)':
a.cc:74:19: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::pair<int, int>')
74 | return os << make_pair(p.x, p.y);
| ~~ ^~ ~~~~~~~~~~~~~~~~~~~
|... |
s244460381 | p00268 | C++ | #include <bits/stdc++.h>
#define M_PI (3.141592653589793)
using namespace std;
const double EPS = 1e-10;
class Point{
public:
double x, y;
int id;
Point(double x = 0, double y = 0): x(x), y(y){}
Point operator + (Point p){return Point(x + p.x, y + p.y);}
Point operator - (Point p){return Point(x... | a.cc:3:9: warning: "M_PI" redefined
3 | #define M_PI (3.141592653589793)
| ^~~~
In file included from /usr/include/c++/14/cmath:47,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:114,
from a.cc:1:
/usr/include/math.h:1121:10: note: this is the location of the... |
s861850638 | p00268 | C++ | // Library.
#include<cassert>
#include<map>
#include<vector>
#include<cmath>
#include<queue>
#include<algorithm>
// Type.
typedef int Label;
typedef double Weight;
// Class.
template<typename Vertex, typename Edge>
class PlaneGraph {
public:
void insert(const Vertex& v);
void insert(Edge e);
const PlaneGraph<Vert... | a.cc: In member function 'const PlaneGraph<Vertex, Edge> PlaneGraph<Vertex, Edge>::dualgraph() const':
a.cc:54:22: error: 'bottom' was not declared in this scope
54 | if(list.first == bottom) outside_color = color[list.second.front().from][list.second.front().to];
| ^~~~~~
a.cc:54:30: ... |
s748388198 | p00268 | C++ | int bottom;
int outside_color;
// Library.
#include<cassert>
#include<map>
#include<vector>
#include<cmath>
#include<queue>
#include<algorithm>
// Type.
typedef int Label;
typedef int Weight;
// Class.
template<typename Vertex, typename Edge>
class PlaneGraph {
public:
void insert(const Vertex& v);
void insert(Edg... | a.cc: In member function 'const std::map<int, int> PlaneGraph<Vertex, Edge>::Dijkstra(const Label&) const':
a.cc:82:53: error: 'function' is not a member of 'std'
82 | std::priority_queue<Edge, std::vector<Edge>, std::function<bool(Edge, Edge)>> q([](Edge lhs, Edge rhs) {
| ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.