submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s180277001
p00274
C++
#include<bits/stdc++.h> using namespace std; int main() { int a, n, i, m k = 0; cin >> n; m = n; while(n != 0 || k != 100) { for(i = 1; i <= n; i++) { cin >> a; if (a <= 1) { m--; } } if (m <= 0) { cout << "NA" << endl; }else{ cout << m + 1 << endl; } cin >> n; m = n; k++; } }
a.cc: In function 'int main()': a.cc:5:24: error: expected initializer before 'k' 5 | int a, n, i, m k = 0; | ^ a.cc:7:9: error: 'm' was not declared in this scope 7 | m = n; | ^ a.cc:8:25: error: 'k' was not declared in this scope 8 | while...
s831987682
p00274
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: In function 'int main()': a.cc:49:29: error: 'A' was not declared in this scope 49 | if (A[i] > 0) { | ^
s442238192
p00274
C++
#include<stdio.h> int main(void){ int N = 1; static int k[10000]; int i; int a, b; for (;;){ scanf_s("%d", &N); if (N == 0) break; for (i = 0; i < N; i++) scanf_s("%d", &k[i]); a = 0, b = 0; for (i = 0; i < N; i++){ if (k[i] == 0) a++; if (k[i] < 2) b++; } if (b == N) prin...
a.cc: In function 'int main()': a.cc:9:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 9 | scanf_s("%d", &N); | ^~~~~~~ | scanf
s335675996
p00274
C++
#include <iostream> #include <algorithm> using namespace std; const int MAX = 1e4; int main(){ int n; while(cin >> n,n){ int k[MAX+1],m = 1<<29,M = -1<<29; bool flg = false; for(int i = 0 ; i < n ; i++){#include <iostream> #include <algorithm> using namespace std; const int MAX = 1e4; int main(){ i...
a.cc:12:34: error: stray '#' in program 12 | for(int i = 0 ; i < n ; i++){#include <iostream> | ^ a.cc: In function 'int main()': a.cc:12:35: error: 'include' was not declared in this scope 12 | for(int i = 0 ; i < n ; i++){#include <iostream> | ...
s405936677
p00274
C++
#include <iostream> using namespace std; int N,a,b,c; int main(){ for(;;){ cin >> N if(N==0){ a = 1; b = 0; for(int i = 0; i < N; i++){ cin >> c; if(c != 0){ a++; } if(c > 1){ b++; } } if(b == 0){ cout << "NA" ...
a.cc: In function 'int main()': a.cc:8:13: error: expected ';' before 'if' 8 | cin >> N | ^ | ; 9 | if(N==0){ | ~~ a.cc:26:6: error: 'else' without a previous 'if' 26 | }else{ | ^~~~
s736189139
p00274
C++
#include<iostream> #include<string> #include<algorithm> #include<map> #include<vector> #include<cmath> #include<cstdio> #define loop(i,a,b) for(int i=a;i<b;i++) #define rep(i,a) loop(i,0,a) #define pb(in,tmp) in.push_back(tmp) #define all(in) in.begin(),n.end() #define PI acos(-1) using namespace std; int main(){ in...
a.cc: In function 'int main()': a.cc:25:8: error: 'tmp' was not declared in this scope; did you mean 'tm'? 25 | if(tmp<2)cout<<in.size()+1<<endl; | ^~~ | tm
s613464587
p00275
Java
import java.util.*; public class Bonze { public static void main(String[] args){ int n, field = 0, taihi = 0, zyun = 0; String a; Scanner scan = new Scanner(System.in); while(true){ n = scan.nextInt(); if(n == 0)break; int[] player = new int[n]; for(int b = 0; b < n; b++){ player[b] = 0; ...
Main.java:3: error: class Bonze is public, should be declared in a file named Bonze.java public class Bonze { ^ 1 error
s329920326
p00275
Java
import java.util.*; public class Bonze { public static void main(String[] args){ int n, field = 0, taihi = 0, zyun = 0; String a; Scanner scan = new Scanner(System.in); while(true){ n = scan.nextInt(); if(n == 0)break; int[] player = new int[n]; for(int b = 0; b < n; b++){ player[b] = 0; ...
Main.java:3: error: class Bonze is public, should be declared in a file named Bonze.java public class Bonze { ^ 1 error
s032070954
p00275
Java
public class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n,ba = 0,jun = 0; String a; while(true){ n = scan.nextInt(); if(n == 0) break; int[] mochi = new int[n]; a = scan.next(); char fuda[] = a.toCharArray(); for(int i = 0; i<100; i++)...
Main.java:4: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:34: error: cannot find symbol...
s321354031
p00275
Java
import java.util.*; public class Main{ public void output(){ Scanner scan = new Scanner(System.in); int[] hito = new int[1000]; int p = 0; int g = 0; int taihi = 0; while(true){ int n = scan.nextInt(); if(n == 0)break; int yama = 0; int ba = 0; for(int r = 0;r < n;r++){ hito[r] = 0; ...
Main.java:56: error: class, interface, enum, or record expected } ^ 1 error
s402345448
p00275
C
#include<iostream> #include<stdio.h> using namespace std; int main(){ int N; int p[10]={0}; int i,j,temp,s; int ba=0; char c[200]; while(1){ cin>>N; if(N==0){ break; } ba=0; for(i=0;i<10;i++){ p[i]=0; } cin>>c; for(j=0;j<100;j++){ s=j%N; if(c[j]=='M'){ p[s]=p[s]+1; } else if(...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s473472609
p00275
C
#include<stdio.h> int main(void) { int n,i,r,f,h,u,x=0; char c[100+1]; char p[10]; scanf("%d",&n); scanf("%s",&c); r=0; p=0; for(i=0;i<100;i++){ switch( c[i] ){ case 'M': p[r]=p[r]+1; break; case 'S': p[10]=h+1-c; p[r]=x+p[r]; break; case 'L': p[r]=p[r]+x;; f=0; break; } r...
main.c: In function 'main': main.c:10:10: error: assignment to expression with array type 10 | p=0; | ^ main.c:17:34: error: invalid operands to binary - (have 'int' and 'char *') 17 | p[10]=h+1-c; | ~~~^ | ...
s144312265
p00275
C
#include<stdio.h> int main(void) { while(1){ int n,i,j=0,t[10]={0},fi=0,bum char c[201]; scanf("%d",&n); if(n==0){ break; } scanf("%s",c); for(i=0;i<100;i++){ t[j]++; if(c[i]=='S'){ fi=fi+t[j]; t[j]=0; } if(c[i]=='L'){ t[j]=t[j]+fi; fi=0; } j++; if(j==n){ j=0; ...
main.c: In function 'main': main.c:6:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'char' 6 | char c[201]; | ^~~~ main.c:11:28: error: 'c' undeclared (first use in this function) 11 | scanf("%s",c); | ^ ma...
s680543217
p00275
C
a[11],j;main(N,i){for(;scanf("%d",&N),j=N;memset(a,0,sizeof(a))){ for(getchar(),i=0;(j=getchar())!='\n';i++)if(j=='M')a[i%N]++;else if(j-'L')a[N]+=a[i%N]+1,a[i%N]=0;else a[i%N]+=a[N]+1,a[N]=0; for(i=0;i<N;printf("%d ",a[i++])for(j=N-1;j>i;j--)if(a[j]<a[j-1])a[j-1]^=a[j],a[j]^=a[j-1],a[j-1]^=a[j]; printf("%d...
main.c:1:1: warning: data definition has no type or storage class 1 | a[11],j;main(N,i){for(;scanf("%d",&N),j=N;memset(a,0,sizeof(a))){ | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:1:7: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int] 1 | ...
s235251115
p00275
C++
import java.io.*; import java.math.*; import java.util.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); char[] c; String s; int[] huda=new int[10]; int n; int turn; int field; int i,j; while(true){ ...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.math.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: ...
s017494653
p00275
C++
import java.io.*; import java.math.*; import java.util.*; public class Main{ public static void main(String[] args) throws IOException{ BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); char[] c; String s; int[] huda=new int[10]; int n; int turn; int field; int i,j; while(tru...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.math.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: ...
s662931517
p00275
C++
#include <iostream> #include <vector> using namespace std; int main() { int N; while (cin >> N, N) { vector<int> v(N, 0); int ba = 0; char c; int k = 0; for (int i=0; i<100; ++i) { cin >> c; if (c == 'M') { ++ v[k]; } e...
a.cc: In function 'int main()': a.cc:25:9: error: 'sort' was not declared in this scope; did you mean 'short'? 25 | sort(v.begin(), v.end()); | ^~~~ | short
s166225945
p00275
C++
#include<iostream> #include<cstdio> #include<string> int N; string ss; int P[10],B; int main() { while(true){ scanf("%d",&N); if(N==0)break; for(int i=0;i<N;i++)P[i]=0; B=0; cin >> ss; for(int i=0;i<ss.length();i++){ if(ss[i]=='S'){ B+=(P[i%N]+1); P[i%N]=0; } else if(ss[i]=='L'){ P[i%N]+=(B+1); ...
a.cc:5:1: error: 'string' does not name a type; did you mean 'stdin'? 5 | string ss; | ^~~~~~ | stdin a.cc: In function 'int main()': a.cc:14:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 14 | cin >> ss; | ^~~ | std::cin In file included from a.cc:1: /usr/inc...
s247361617
p00275
C++
#include<iostream> using namespace std; int main(){ int n; while(cin>> n,n){ char huda[100]; for(int i=0;i<100;i++){ cin>> huda[i]; } int player=0; int score[10]={0}; int stage=0; for(int i=0;i<100;i++){ if(huda[i]=='M'){ score[player]++; } else if(huda[i]=='S')...
a.cc: In function 'int main()': a.cc:31:5: error: 'sort' was not declared in this scope; did you mean 'short'? 31 | sort(score,score+n); | ^~~~ | short
s499222017
p00275
C++
int main(){ int a, n, m[10], f = 0; char c[100]; for(int i = 0; i < 10; i++) m[i] = 0; while(1){ cin >> n; if(n <= 1 || n >= 10) break; for(int i = 0; i < 100; i++) cin >> c[i]; for(int j = 0; j <= 100/n; j++){ for(int k = 0; k < n; k++){ if(c[j*n+k] == 'M') m[k]++; else if...
a.cc: In function 'int main()': a.cc:6:5: error: 'cin' was not declared in this scope 6 | cin >> n; | ^~~ a.cc:21:32: error: 'cout' was not declared in this scope 21 | for(int i = 0; i < n; i++) cout << m[i] << " "; | ^~~~ a.cc:22:5: error: 'cout' was not de...
s741066469
p00275
C++
int main(){ int a, n, m[10], f = 0; char c[100]; for(int i = 0; i < 10; i++) m[i] = 0; while(1){ cin >> n; if(n <= 1 || n >= 10) break; for(int i = 0; i < 100; i++) cin >> c[i]; for(int j = 0; j <= 100/n; j++){ for(int k = 0; k < n; k++){ if(c[j*n+k] == 'M') m[k]++; else if...
a.cc: In function 'int main()': a.cc:6:5: error: 'cin' was not declared in this scope 6 | cin >> n; | ^~~ a.cc:21:32: error: 'cout' was not declared in this scope 21 | for(int i = 0; i < n; i++) cout << m[i] << " "; | ^~~~ a.cc:22:5: error: 'cout' was not de...
s236804459
p00275
C++
#include<iostream> using namespace std; int main(){ int n = 0, ba = 0; char card; while(1){ cin >> n; if(n == 0){ break; } int temochi[n]; for(int i = 0 ; i < 100; i++ ){ cin >> card; temochi[i % n]; if(card == 'M'){ temochi[i % n] ++; } else if(card == 'S'){ ba = ba + temochi[...
a.cc: In function 'int main()': a.cc:33:17: error: 'sort' was not declared in this scope; did you mean 'short'? 33 | sort(temochi, temochi + n); | ^~~~ | short a.cc:40:2: error: expected '}' at end of input 40 | } | ^ a.cc:4:11: note: to match thi...
s381026993
p00275
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int n = 0, ba = 0; char card; while(1){ cin >> n; if(n == 0){ break; } int temochi[n]; for(int i = 0 ; i < 100; i++ ){ cin >> card; temochi[i % n]; if(card == 'M'){ temochi[i % n] ++; } else if(card == 'S'){ ...
a.cc: In function 'int main()': a.cc:41:2: error: expected '}' at end of input 41 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s832041156
p00275
C++
#include<stdio.h> #include<string.h> int main() { int ba=0,pl[10]={0},n,i,j; char yama[100]; while(1) { scanf("%d",&n); if(n==0){break;} gets(yama); for(i=0;i<100;i++) { if(i%n==0){j=0;} if(strcmp(yama[i],"M")==0){pl[j]++;} if(strcmp(yama[i],"L")==0){pl[j]+=ba+1;ba=0;} if(strcmp(yama[i],"S")==...
a.cc: In function 'int main()': a.cc:11:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 11 | gets(yama); | ^~~~ | getw a.cc:15:41: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 15 | i...
s751384900
p00275
C++
#include<iostream> #include<vector> #include<string> #include<algorithm> using namespace std; int main(){ int n=0; int i=0; int j=0; int k=0; int a[12]; int m=0; int sa=0; string c; string b; b="MSL"; vector<int> v1[105]; cin>>n; while(n!=0){ cin>>c; memset(a,0,sizeof(a)); for(i=0;i<100;i++){ m=i%...
a.cc: In function 'int main()': a.cc:21:17: error: 'memset' was not declared in this scope 21 | memset(a,0,sizeof(a)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include<algorithm> +++ |+...
s357898854
p00275
C++
using namespace std; int main(){ while (true) { int N; cin >> N; if (N == 0) break; string c; cin >> c; int maisu[10]; for (int i = 0; i < N;i++) { maisu[i] = 0; } int ba = 0; int turn = 0; for (int i = 0; i , c.size(); i++) { if (c[i] == 'M') maisu[turn]++; else if (c[i] == 'S') {...
a.cc: In function 'int main()': a.cc:7:17: error: 'cin' was not declared in this scope 7 | cin >> N; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace ...
s494484017
p00275
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int main() { while(true) { int N; cin >> N; if(N == 0) break; string c; cin >> c; int maisu[10]; for (int i = 0; i < c.size(); i++){ maisu[i] = 0; } int ba = 0; int turn = 0; for (int i = 0; i < c.size(); i++) { ...
a.cc: In function 'int main()': a.cc:45:2: error: expected '}' at end of input 45 | } | ^ a.cc:7:12: note: to match this '{' 7 | int main() { | ^
s680814202
p00275
C++
#include<iostream> #include<algorithm> using namespace std; string Card; int p[10]={0},N,f; int main(){ while(1){ int c=0; cin>>N; if(N==0)break; cin>>Card; while(cnt < 100){ for(intj=0;j<N;j++,c++){ if(c>=100)break; if(Card[c] =='M...
a.cc: In function 'int main()': a.cc:12:15: error: 'cnt' was not declared in this scope; did you mean 'int'? 12 | while(cnt < 100){ | ^~~ | int a.cc:13:17: error: 'intj' was not declared in this scope; did you mean 'int'? 13 | for(intj=0;j<N;j++,c++){ ...
s991907682
p00275
C++
#include<iostream> #include<algorithm> using namespace std; string Card; int p[10]={0},N,f; int main(){ while(1){ int c=0; cin>>N; if(N==0)break; cin>>Card; while(cnt < 100){ for(int j=0;j<N;j++,c++){ if(c>=100)break; if(Card[c] =='...
a.cc: In function 'int main()': a.cc:12:15: error: 'cnt' was not declared in this scope; did you mean 'int'? 12 | while(cnt < 100){ | ^~~ | int a.cc:35:9: error: 'field' was not declared in this scope 35 | field=0; | ^~~~~
s259563938
p00275
C++
#include<iostream> #include <stdio.h> using namespace std; void cal(int *tehuda, int *ba, char c){ switch(c){ case 'M':*tehuda++; break; case 'S':*ba+=*tehuda;*tehuda = 0;break; case 'L':*tehuda+=*ba;*ba = 0;break; } int main(){ while(true){ int result[10] = {}; int n; cin >> n; if(n == 1)return 0; ...
a.cc: In function 'void cal(int*, int*, char)': a.cc:10:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 10 | int main(){ | ^~ a.cc:10:9: note: remove parentheses to default-initialize a variable 10 | int main(){ | ^~ | -- a.cc:1...
s313566533
p00275
C++
#include <iostream> #include <algorithm> using namespace std; /*void sort(int* array, int index){ bool finish = true; while(finish){ finish = false; for(int i = 1; i < index; i++){ if(array[i - 1] > array[i]){ int temp = array[i - 1]; array[i - 1] = a...
a.cc: In function 'int main()': a.cc:46:13: error: no matching function for call to 'sort(int [5], int&)' 46 | sort(players, n); | ~~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: ...
s961061767
p00275
C++
#include<iostream> using namesoace std; int main(){ int N; cin>>N; int player[N+1]; int all; int num=1; for(int i=1;i<101;i++){ char x; cin>>x; if(x=='M'){ player[num]+=1; num++; if(num=>6){ num=1; } } if(x=='S'){ all+=player[num]; player[num]=0; num++; if(num=>6){ num=1...
a.cc:2:7: error: expected nested-name-specifier before 'namesoace' 2 | using namesoace std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin>>N; | ^~~ | std::cin In file included fr...
s718436571
p00275
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ while(true){ int N; cin>>N; if(N==0)break; int n[10]=[0]; int m=0; for(int i=0;i<100;i++){ char c; cin>>c; n[i%N]++; if(c=='S'){ m+=n[i%N]; n[i%N]=0; }else if(c=='L'){ n[i%N]+=m; m=0; } } sort(n,n+N); for(i...
a.cc: In function 'int main()': a.cc:12:20: error: expected identifier before numeric constant 12 | int n[10]=[0]; | ^ a.cc: In lambda function: a.cc:12:22: error: expected '{' before ';' token 12 | int n[10]=[0]; | ^ a.cc: In function 'int main(...
s830348987
p00275
C++
#include<stdio.h> #include<conio.h> #include<algorithm> using namespace std ; int main() { int n ; while( 1 ) { scanf( "%d" ,&n ) ; if( n == 0 ) { return 0 ; } int player[ 10 ] = { 0 } ; int ba = 0 ; int i = 0 ; while( i < 100 ) { int p = i % n ; switch( getch() ) { cas...
a.cc:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s476131132
p00275
C++
// // main.cpp // pck2013 // // Created by Wanikawa on 2013/09/14. // Copyright (c) 2013年 Wanikawa. All rights reserved. // #include <iostream> #include <vector> using namespace std; int main() { /* hitogagominoyouda */ while (1) { int num,feeld = 0; int play[10] = {0}; s...
a.cc: In function 'int main()': a.cc:52:9: error: 'sort' was not declared in this scope; did you mean 'short'? 52 | sort(p.begin(), p.end()); | ^~~~ | short
s506384362
p00275
C++
#include<stdio.h> int main(void) { int n,a,i,pl=1,fl=0; int p[101]={0}; char s; while(0==0){ scanf("%d",&n); if(n==0)break; for(i==0;i<100;i++){ scanf("%c",&s); if(s =='S'){ fl+=p[pl]+1; p[pl]=0; }else if(s =='M')p[pl]+=1; else if(s =='L'){ p[pl]+=fl+1; fl=0; } pl++; if(pl>...
a.cc: In function 'int main()': a.cc:25:2: error: expected '}' at end of input 25 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s994566378
p00275
C++
#define _USE_MATH_DEFINES #define INF 10000000 #include <iostream> #include <sstream> #include <cstdio> #include <cmath> #include <algorithm> #include <queue> #include <stack> #include <limits> #include <map> #include <string> #include <cstring> #include <set> #include <deque> #include <bitset> #include <list> using n...
a.cc: In function 'int main()': a.cc:35:19: error: expected ')' before numeric constant 35 | memset(players.0,sizeof(players)); | ~ ^~ | ) a.cc:35:11: error: too few arguments to function 'void* memset(void*, int, size_t)' 35 | memset(players.0,sizeof(players)...
s624655478
p00275
C++
#define _USE_MATH_DEFINES #define INF 10000000 #include <iostream> #include <sstream> #include <cstdio> #include <cmath> #include <algorithm> #include <queue> #include <stack> #include <limits> #include <map> #include <string> #include <cstring> #include <set> #include <deque> #include <bitset> #include <list> using n...
a.cc: In function 'int main()': a.cc:35:19: error: expected ')' before numeric constant 35 | memset(players.0,sizeof(players)); | ~ ^~ | ) a.cc:35:11: error: too few arguments to function 'void* memset(void*, int, size_t)' 35 | memset(players.0,sizeof(players)...
s372778900
p00275
C++
#include<iostream> using namespace std; int main(){ int n,have[110],stage,turn,tmp; char c[110]; while(1){ cin >> n; if(n==0) break; stage=0; memset(have,0,sizeof(have)); cin << c; for(int i=0,turn=0;i<100;i++,turn++){ if(turn>=n) turn=0; if(c[i]=='M'){ //男の場合。 have[tur...
a.cc: In function 'int main()': a.cc:10:5: error: 'memset' was not declared in this scope 10 | memset(have,0,sizeof(have)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring> ...
s717025958
p00275
C++
#include<iostream> using namespace std; int main(){ int n,have[110],stage,turn,tmp; char c[110]; while(1){ cin >> n; if(n==0) break; stage=0; memset(have,0,sizeof(have)); cin << c; for(int i=0,turn=0;i<100;i++,turn++){ if(turn>=n) turn=0; if(c[i]=='M'){ //男の場合。 have[tur...
a.cc: In function 'int main()': a.cc:10:5: error: 'memset' was not declared in this scope 10 | memset(have,0,sizeof(have)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring> ...
s383293635
p00276
Java
import java.util.*; public class mon6{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int R = 0; R = scan.nextInt(); for(int k = 1;k<=R;k++){ int count = 0; int C = scan.nextInt(); int A = scan.nextInt(); int N = scan.nextInt(); while(true){ if(N != 0 && ...
Main.java:3: error: class mon6 is public, should be declared in a file named mon6.java public class mon6{ ^ 1 error
s481018319
p00276
C
4 3 0 0 1 1 1 9 4 1 0 1 2
main.c:1:1: error: expected identifier or '(' before numeric constant 1 | 4 | ^
s140546783
p00276
C
#include <stdio.h> int main (void) { int a; scanf("%d",&a); int b[100][3]={}; int i; int j; int k=0; for(i=0;i<a;i++){ for(j=0;j<3;j++) scanf("%d",&b[i][j]); int b2[3]={}; int c=0; b2[0]=b[i][0]; b2[1]=b[i][1]; b2[2]=b[i][2]; while(1){ b2[0]-=1; b2[1]-=1; b2[2]-=1; if(b2[0]<0||b2[1]<0||b2[2]<0) ...
main.c: In function 'main': main.c:50:1: error: expected declaration or statement at end of input 50 | } | ^
s388238822
p00276
C
#include <stdio.h> int main(void) { int i,ii,y,c,a,n,sum,ans; scanf("%d",&y); for(i=0;i<y;i++){ scanf("%d%d%d",&c,&a,&n); if(c==0){ printf("0\n"); }else{ sum=c+a+n; for(ii=0;ii<c;ii++){ sum=sum-3; if(sum>0){ ans++; }else break } printf("%d\n",ans); } } return 0; }
main.c: In function 'main': main.c:17:44: error: expected ';' before '}' token 17 | }else break | ^ | ; 18 | } | ~ ...
s564031600
p00276
C
#define m(a,b)(a<b?a:b) r;main(c,a,n){for(gets(&c);r=~scanf("%d%d%d",&c,&a,&n);printf("%d\n",r+n+(c-n*2)/3))r=m(c,m(a,n)),c-=r,a-=r,n=min(c/2,a);}
main.c:2:1: warning: data definition has no type or storage class 2 | r;main(c,a,n){for(gets(&c);r=~scanf("%d%d%d",&c,&a,&n);printf("%d\n",r+n+(c-n*2)/3))r=m(c,m(a,n)),c-=r,a-=r,n=min(c/2,a);} | ^ main.c:2:1: error: type defaults to 'int' in declaration of 'r' [-Wimplicit-int] main.c:2:3: error: return type d...
s756897507
p00276
C++
#include <stdio.h> #include <algorithm> #include <stdlib.h> #include <string.h> #include <queue> #define rep(i,n) for(int i = 0; i < n; ++i) #define rrep(i,n) for(int i = 1; i <= n; ++i) using namespace std; typedef pair<int,int> P; const int INF = 1000000000; int c,a,n; int main(){ int q; scanf("%d",&q); rep(i...
a.cc: In function 'int main()': a.cc:33:23: error: expected primary-expression before '=' token 33 | ans + = c/3; | ^
s082751251
p00276
C++
#include<iostream> #include<algorithm> #include<string> #include <time.h> using namespace std ; int main() { int N ,c,a,n ; vector< int > ans; cin >> N ; ans.assign( N, 0) ; for( int i = 0 ; i < N ; ++i ) { cin >> c >> a >> n ; if(c <= a && c <= n) { ans[i] += c ; c = 0 ; } ...
a.cc: In function 'int main()': a.cc:11:3: error: 'vector' was not declared in this scope 11 | vector< int > ans; | ^~~~~~ 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> 3 | #inc...
s308300661
p00276
C++
#include <iostream> using namespace std; int main(){ int Q; cin>>Q; for(int i=0;i<Q;i++){ int c,a,n,can=0,cca=0,ccc=0; cin>>c>>a>>n; for(int j=0;j<c;j++){ if(1<=n&&1<=a&&1<=c){ can=n; a=a-n; c=c-n; n=0; } if(1<=a&&1<=c/2){ cca=a; c=c-a*2; a=0 } ...
a.cc: In function 'int main()': a.cc:16:21: error: expected ';' before '}' token 16 | c=c-a*2; a=0 | ^ | ; 17 | } | ~
s754534859
p00276
C++
#include <iostream> using namespace std; int main(){ int Q; cin>>Q; for(int i=0;i<Q;i++){ int c,a,n,can=0,cca=0,ccc=0; cin>>c>>a>>n; if(1<=n&&1<=a&&1<=c){ can=n; a=a-n; c=c-n; n=0; } else if(1<=a&&1<=c/2){ cca=a; c=c-a*2; a=0; } else if(1<=...
a.cc: In function 'int main()': a.cc:23:11: error: 'can' was not declared in this scope; did you mean 'scanf'? 23 | cout<<can+cca+ccc<<endl; | ^~~ | scanf a.cc:23:15: error: 'cca' was not declared in this scope 23 | cout<<can+cca+ccc<<endl; | ^~~ a.cc:23...
s018269312
p00276
C++
#include<iostream> #include<algorithm> int mymin(int a, int b, int c) { int tmp = min(a, b); return min(tmp, c); } using namespace std; int main() { int q; cin >> q; for (int i = 0; i < q; i++) { int c, a, n, ct = 0; cin >> c >> a >> n; ct += mymin( c ,a ,n ); c -= ct, a -= ct, n -= ct; if (a > 0 && c...
a.cc: In function 'int mymin(int, int, int)': a.cc:5:19: error: 'min' was not declared in this scope; did you mean 'std::min'? 5 | int tmp = min(a, b); | ^~~ | std::min In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/...
s356086107
p00276
C++
#include<iostream> #include<queue> using namespace std; struct Team{ int c; int a; int n; int TeamNum; Team(){ c=0; a=0; n=0; TeamNum=0; } }; void Clear(Team& a,Team& b){ a.c = b.c; a.a = b.a; a.n = b.n; a.TeamNum = b.TeamNum; } int main(){ int Q = 0; cin >> Q; for...
a.cc: In function 'int main()': a.cc:62:16: error: 'answer' was not declared in this scope 62 | if(answer < tmp.TeamNum){ | ^~~~~~ a.cc:95:17: error: 'answer' was not declared in this scope 95 | cout << answer << endl; | ^~~~~~
s817692995
p00276
C++
#include<iostream> #include<queue> using namespace std; struct Team{ int c; int a; int n; int TeamNum; Team(){ c=0; a=0; n=0; TeamNum=0; } }; void Clear(Team& a,Team& b){ a.c = b.c; a.a = b.a; a.n = b.n; a.TeamNum = b.TeamNum; } int main(){ int Q = 0; cin >> Q; for...
a.cc: In function 'int main()': a.cc:38:21: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 38 | cout << 0 << end; | ~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/iostream:41, from a.cc...
s736813905
p00276
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int Q; cijn>>Q; for(int i=0;i<Q;i++){ int c,a,n; cin>>c>>a>>n; int can=min(min(c,a),n); c-=can; a-=can; int cca=min(c/2,a); c-=cca*2; int ccc=c/3; cout<<can+cca+ccc<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: 'cijn' was not declared in this scope 7 | cijn>>Q; | ^~~~
s061925976
p00276
C++
#include<iostream> #include<algorithm> using namespace std; int main() { int N; cin>>N; for(int i=0;i<100;i++){ int c,a,n; int can=min(min(c,a),n); c-=can; a-=can; int cca=min(c?2,a); c-=cca*2; int ccc=c/3; cout<<can+cca+ccc<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:16:42: error: expected ':' before ')' token 16 | int cca=min(c?2,a); | ^ | : a.cc:16:42: error: expected primary-expression before ')' token
s067434468
p00276
C++
#include<iostream> #include<algorithm> using namespace std; int main() { int Q; cin>>Q; for(int i=0;i<Q;i++){ int c,a,n; int can=min(min(c,a),n); c-=can; a-=can; int cca=min(c?2,a); c-=cca*2; int ccc=c/3; cout<<can+cca+ccc<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:16:42: error: expected ':' before ')' token 16 | int cca=min(c?2,a); | ^ | : a.cc:16:42: error: expected primary-expression before ')' token
s523059319
p00276
C++
#include <cstdio> #include <cstdlib> #include <algorithm> #include <functional> using namespace std; int main() { int Q; int can[3]; int total,temp; scanf("%d",&Q); for(int i = 0; i < Q; i++){ total = INT_MAX; for(int j = 0; j < 3; j++){ scanf("%d",&can[j]); if(total > can[j]) total = can[j]; } ...
a.cc: In function 'int main()': a.cc:15:25: error: 'INT_MAX' was not declared in this scope 15 | total = INT_MAX; | ^~~~~~~ a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include <functional> ...
s826923611
p00277
Java
00.05 sec 18484 KB 122 lines 1798 bytes 2014-10-17 22:00 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86...
Main.java:1: error: class, interface, enum, or record expected 00.05 sec 18484 KB 122 lines 1798 bytes 2014-10-17 22:00 ^ Main.java:187: error: ')' or ',' expected queA.add(new Pair(1,0); ^ 2 errors
s327183768
p00277
Java
00.05 sec 18484 KB 122 lines 1798 bytes 2014-10-17 22:00 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86...
Main.java:1: error: class, interface, enum, or record expected 00.05 sec 18484 KB 122 lines 1798 bytes 2014-10-17 22:00 ^ 1 error
s471314551
p00277
Java
va.util.Scanner; public class Main { public static void main(String[] args) { new Main().run(); } private void run() { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int R = scanner.nextInt(); int L = scanner.nextInt(); int[] P = new int[N]; int[] T = new int[N]; int PT = 0;...
Main.java:1: error: class, interface, enum, or record expected va.util.Scanner; ^ 1 error
s828808992
p00277
Java
public class Main { /** ???????????????° */ public static int TEAM_AMOUNT; /** ???¬????????????° */ public static long RECORD_AMOUNT; /** ???????????????????????? */ public static long CONTEST_TIME; public static void main(String[] args) throws IOException { // ??\???????????????...
Main.java:9: error: cannot find symbol public static void main(String[] args) throws IOException { ^ symbol: class IOException location: class Main Main.java:12: error: cannot find symbol BufferedReader br = new BufferedReader(new InputStreamReader(Sys...
s147521642
p00277
Java
import java.util.*; public class mondai7 { public static void main(String[] args){ int n, l, r, d, t = 0, x = 0, kiroku = 0, max =0, maxban = 0,max2 = 0, hensu = 0; Scanner scan = new Scanner(System.in); n = scan.nextInt(); int[] ten = new int[n]; int[] byou = new int[n]; r = scan.nextInt(); l = scan.ne...
Main.java:3: error: class mondai7 is public, should be declared in a file named mondai7.java public class mondai7 { ^ 1 error
s325613125
p00277
Java
import java.util.*; public class mondai7 { public static void main(String[] args){ int n, l, r, d, p= 0, t = 0, x = 0, kiroku = 0, max =0, max2 = 0, hensu = 0; Scanner scan = new Scanner(System.in); n = scan.nextInt(); int[] ten = new int[n]; int[] byou = new int[n]; r = scan.nextInt(); int[] ban = new ...
Main.java:3: error: class mondai7 is public, should be declared in a file named mondai7.java public class mondai7 { ^ 1 error
s858901976
p00277
C
#include <stdio.h> int time[1000000]; int main(void) { int n, r, l; int i; int before_time = 0; int longest = 0; scanf("%d %d %d", &n, &r, &l); for (i = 0; i < r; i++){ int d, t, x; scanf("%d %d %d", &d, &t, &x); time[d - 1] += t - before_time; before_time = t; } time[d - 1] += 600 - t; for (i =...
main.c: In function 'main': main.c:20:14: error: 'd' undeclared (first use in this function) 20 | time[d - 1] += 600 - t; | ^ main.c:20:14: note: each undeclared identifier is reported only once for each function it appears in main.c:20:30: error: 't' undeclared (first use in this function...
s469735893
p00277
C
#include <stdio.h> int time[1000000]; int main(void) { int n, r, l; int i; int before_time = 0; int longest = 0; scanf("%d %d %d", &n, &r, &l); for (i = 0; i < r; i++){ int d, t, x; scanf("%d %d %d", &d, &t, &x); time[d - 1] += t - before_time; before_time = t; } time[d - 1] += 600 - before_time;...
main.c: In function 'main': main.c:20:14: error: 'd' undeclared (first use in this function) 20 | time[d - 1] += 600 - before_time; | ^ main.c:20:14: note: each undeclared identifier is reported only once for each function it appears in
s675884518
p00277
C++
#include<bits/stdc++.h> using namespace std; int n,r,l; int d[100001],t[100001],x[1000001]; int i,j,flg,max,min; int a[1000001]={0},b[1000001]={0}; int main(void) { cin>>n>>r>>l; flg=0; for(i=1;i<=r;i++){ cin>>d[i]>>t[i]>>x[i]; if(x[i]<0){ flg=1,b[d[i]]=x[i],x[i]=0; } } if(flg==0){ for(j=r;j>0;j...
a.cc: In function 'int main()': a.cc:37:9: error: reference to 'max' is ambiguous 37 | max=-1,min=1000010; | ^~~ In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14...
s798220550
p00277
C++
#include <cstdio> #include <algorithm> using namespace std; struct dat{ int id, point; }; #define SIZE 1 << 17 int N, R, L; int res[MAX_N + 1]; dat seg[SIZE * 2 - 1]; int n; void init(){ n = 1; while(n < N) n *= 2;//nはseg木の要素数 for(int i = 0; i < 2 * n - 1; i++) seg[i].point = 0; for(int j = 0; j <= N; j++){ se...
a.cc:9:9: error: 'MAX_N' was not declared in this scope 9 | int res[MAX_N + 1]; | ^~~~~ a.cc:6:16: warning: left shift count >= width of type [-Wshift-count-overflow] 6 | #define SIZE 1 << 17 | ^ a.cc:10:9: note: in expansion of macro 'SIZE' 10 | dat seg[SIZE * 2 - 1]; ...
s213657774
p00277
C++
#include <iostream> #include <map> #define INF (2 << 28) using namespace std; typedef pair<int, int> iiP; int n; iiP seg[2 * 100001 - 1]; void init(int q){ n = 1; while(n < q) n *= 2; for(int i = 0; i < n; i++) seg[i] = iiP(-INF, -i); } void update(int i, iiP a){ i += n - 1; seg[i] = a; while(i > 0...
a.cc: In function 'int main()': a.cc:57:11: error: 'max_element' was not declared in this scope 57 | cout << max_element(sumt + 1, sumt + N + 1) - sumt << endl; | ^~~~~~~~~~~
s787330995
p00277
C++
#include <iostream> #include <cstdio> #include <queue> #include <algorithm> using namespace std; #define rep(i,j) REP((i), 0, (j)) #define REP(i,j,k) for(int i=(j);(i)<(k);++i) #define MP make_pair #define F first #define S second typedef pair<int, int> P; int N, R, L; int point[100005]; int res[100005]; int main(...
a.cc: In function 'int main()': a.cc:23:3: error: 'memset' was not declared in this scope 23 | memset(point, 0, sizeof(point)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <algorithm> +++ |+#include <cstring>...
s974719568
p00277
C++
#include <iostream> #include <cstdio> #include <cstdlib> #include <queue> #include <algorithm> using namespace std; #define rep(i,j) REP((i), 0, (j)) #define REP(i,j,k) for(int i=(j);(i)<(k);++i) #define MP make_pair #define F first #define S second typedef pair<int, int> P; int N, R, L; int point[100005]; int res[...
a.cc: In function 'int main()': a.cc:24:3: error: 'memset' was not declared in this scope 24 | memset(point, 0, sizeof(point)); | ^~~~~~ a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include <algorithm> +++ |+#include <cstring>...
s792083230
p00277
C++
import java.util.*; class MyComp implements Comparator<Pair> { public int compare(Pair arg0, Pair arg1) { Pair t0 = (Pair) arg0; Pair t1 = (Pair) arg1; if(t0.time > t1.time) { return -1; } else if(t0.time < t1.time) { return 1; ...
a.cc:2:1: error: 'import' does not name a type 2 | import java.util.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:25: error: expected initializer before 'Comparator' 4 | class MyComp implements Comparator<Pair> { | ^~~~~~~~~~ a.cc:36:11:...
s201585195
p00277
C++
n, r, l = map(int, input().split()) point, time = [], [] rev = {0: []} for i in range(n): point.append(0) time.append(0) rev[0].append(i) now, tv, tmax = 0, 0, 0 for i in range(r): d, t, x = map(int, input().split()) time[tv] += t - now now = t m = point[d-1] rev[point[d-1]].remove(d-1)...
a.cc:1:1: error: 'n' does not name a type 1 | n, r, l = map(int, input().split()) | ^ a.cc:4:1: error: expected unqualified-id before 'for' 4 | for i in range(n): | ^~~
s062538940
p00277
C++
#include <iostream> #include <vector> #include <map> #include <list> #include <set> #include <stack> #include <queue> #include <string> #include <utility> #include <algorithm> #define REP(i,n) for(int i = 0; i < n; i++) #define REP(j,n) for(int j = 0; j < n; j++) using namespace std; typedef pair<int, int> P; int mai...
a.cc:12:9: warning: "REP" redefined 12 | #define REP(j,n) for(int j = 0; j < n; j++) | ^~~ a.cc:11:9: note: this is the location of the previous definition 11 | #define REP(i,n) for(int i = 0; i < n; i++) | ^~~ a.cc: In function 'int main()': a.cc:24:5: error: 'memset' was not declared...
s922085401
p00277
C++
#include<iostream> #include<cstring> #include<map> using namespace std; #define MAX 1111111 #define MIN -1111111 typedef pair<int,int> P; void init(int n); void update(int k,int x); P maxx(int k1,int k2); P dat[2*100000]; int tim[100001]={0}; int N; int main(){ int R,L; cin >> N >> R >> L; int n_tmp = N; init(...
a.cc: In function 'int main()': a.cc:31:14: error: 'max_element' was not declared in this scope 31 | int *ans = max_element(tim,tim+n_tmp+1); | ^~~~~~~~~~~
s939868124
p00277
C++
#include<bits/stdc++.h> using namespace std; pair<int,int> rmq[1111111111111]; int N,R,L; int d[1111111]={0}; int t[1111111]={0}; int x[1111111]={0}; int team[11111111]={0}; void updata(int k,int x){ int no=k; k += N-1; rmq[k].first += x; rmq[k].second = k; while(k > 0){ k = (k - 1) / 2; if(rmq[k*2+...
/tmp/ccQjQPos.o: in function `updata(int, int)': a.cc:(.text+0x16): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccQjQPos.o /tmp/ccQjQPos.o: in function `main': a.cc:(.text+0x2b6): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /...
s244500577
p00277
C++
#include<bits/stdc++.h> using namespace std; pair<int,int> rmq[1111111111111]; int N,R,L; int d[1111111]={0}; int t[1111111]={0}; int x[1111111]={0}; int team[11111111]={0}; void updata(int k,int x){ int no=k; k += N-1; rmq[k].first += x; rmq[k].second = k; while(k > 0){ k = (k - 1) / 2; if(rmq[k*2+...
/tmp/ccrgfrAU.o: in function `updata(int, int)': a.cc:(.text+0x16): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccrgfrAU.o /tmp/ccrgfrAU.o: in function `main': a.cc:(.text+0x2b6): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /...
s551644265
p00277
C++
#include <iostream> #include <algorithm> #include <cstdio> #include <string> #include <cstring> using namespace std; void update(int k,int x); pair<int, int> seg[1 << 18]; int main(){ int n,r,l; int d,t,x; int i; int team[1000]; int sento=0,watch=0,maxi=0; scanf("%d %d %d",&n,&r,&l); for(i=0;i<n;i+...
a.cc: In function 'void update(int, int)': a.cc:55:24: error: no match for 'operator>' (operand types are 'int' and 'std::pair<int, int>') 55 | if(seg[k*2+1].first>seg[k*2+2]) seg[k]=seg[k*2+1]; | ~~~~~~~~~~~~~~~~^~~~~~~~~~~ | | | | int ...
s433372745
p00277
C++
#include <iostream> #include <algorithm> #include <cstdio> #include <string> #include <cstring> using namespace std; void update(int k,int x); pair<int, int> seg[1 << 18]; int main(){ int n,r,l; int d,t,x; int i; int team[1000]; int sento=0,watch=0,maxi=0; scanf("%d %d %d",&n,&r,&l); for(i=0;i<n;i+...
a.cc: In function 'void update(int, int)': a.cc:55:24: error: no match for 'operator>' (operand types are 'int' and 'std::pair<int, int>') 55 | if(seg[k*2+1].first>seg[k*2+2]) seg[k]=seg[k*2+1]; | ~~~~~~~~~~~~~~~~^~~~~~~~~~~ | | | | int ...
s596085120
p00277
C++
#include <stdio.h> #include <algorithm> #include <stdlib.h> #include <string.h> #include <queue> #define rep(i,n) for(int i = 0; i < n; ++i) #define rrep(i,n) for(int i = 1; i <= n; ++i) using namespace std; typedef pair<int,int> P; const int INF = 1000000000; int main(){ /* int N,R,L; int n,t,s; int nowN=-1,befT=...
a.cc: In function 'int main()': a.cc:46:81: error: expected ')' before ':' token 46 | nowN = (scr[n-1]==scr[nowN]?min(n-1,nowN):scr[n-1]>scr[nowN]>n-1:nowN); | ~ ^ | ...
s551107002
p00277
C++
#include<iostream> #include<queue> using namespace std; #define MAX_N 100000000 #define MAX_TEAM 10000000 priority_queue<pair<int, int>> Q; int d[MAX_N], n, s, L, x[MAX_N], y[MAX_N], t[MAX_N], d[MAX_TEAM], ti[MAX_TEAM]; int main() { cin >> n >> s >> L; Q.push(make_pair(0, -1000000000)); x[0] = 0; t[0] = 0; y[0] =...
a.cc:9:54: error: conflicting declaration 'int d [10000000]' 9 | int d[MAX_N], n, s, L, x[MAX_N], y[MAX_N], t[MAX_N], d[MAX_TEAM], ti[MAX_TEAM]; | ^ a.cc:9:5: note: previous declaration as 'int d [100000000]' 9 | int d[MAX_N], n, s, L, x[MAX_N], y[MAX_N...
s683833173
p00277
C++
#include<iostream> #include<queue> using namespace std; #define MAX_N 10000000 #define MAX_TEAM 10000000 priority_queue<pair<int, int>> Q; int d[MAX_N], n, s, L, x[MAX_N], y[MAX_N], t[MAX_N], d[MAX_TEAM], ti[MAX_TEAM]; int main() { cin >> n >> s >> L; Q.push(make_pair(0, -1000000000)); x[0] = 0; t[0] = 0; y[0] = ...
a.cc:9:54: error: redefinition of 'int d [10000000]' 9 | int d[MAX_N], n, s, L, x[MAX_N], y[MAX_N], t[MAX_N], d[MAX_TEAM], ti[MAX_TEAM]; | ^ a.cc:9:5: note: 'int d [10000000]' previously declared here 9 | int d[MAX_N], n, s, L, x[MAX_N], y[MAX_N], t[MAX...
s668354319
p00277
C++
#include<iostream> #include<algorithm> using namespace std; static const int MAX = 1000000; int Time[MAX]; int Team[MAX]; int takai[MAX]; int takai_n[MAX]; int Team_max[MAX]; int main(){ int N,R,L; int d,t,x; int temp,temp1=0,flag = 0; cin >> N >> R >> L; memset(takai,0,sizeof(takai+N)+1); memset(takai_n,0,sizeof...
a.cc: In function 'int main()': a.cc:15:9: error: 'memset' was not declared in this scope 15 | memset(takai,0,sizeof(takai+N)+1); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<algorithm> +++ |+#incl...
s939783607
p00277
C++
#include "MDebug.h" #include <iostream> #include <queue> #include <cstring> #include <algorithm> #include <conio.h> using namespace std; static const int MAX_N = 1000001; int T_Time[MAX_N], Score[MAX_N]; int main() { int N, R, L, d, t, x, most, P_T = 0, P_D = 1; priority_queue< pair< int, int > > ScoreHeap; mem...
a.cc:1:10: fatal error: MDebug.h: No such file or directory 1 | #include "MDebug.h" | ^~~~~~~~~~ compilation terminated.
s564026815
p00277
C++
#include<stdio.h> int main(){ int a,toread,N,R,L,d,t,x,i,time=0,team,T[1001],P[1001],i2,max,dscanf[1001],tscanf[1001],xscanf[1001]; scanf("%d%d%d",&N,&R,&L); for(i=0;i<=R;i++){ T[i]=0; P[i]=0; } for(i=1;i<=R;i++){ scanf("%d%d%d",&d,&t,&x); dscanf[i]=d; tscanf[i]=t; xscanf[i]=x; } for(i=1;i<=R;i++){ ...
a.cc:66:2: error: stray '#' in program 66 | }#include<stdio.h> | ^ a.cc:66:3: error: 'include' does not name a type 66 | }#include<stdio.h> | ^~~~~~~
s891183620
p00277
C++
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /** * 0282 Programming Contest */ public class Main { public static void main(String[] args) throws IOException { // Read contest basic info Contest contest = readContest(); // Read record and count up time conte...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.BufferedReader; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.io.IOException; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fm...
s548167235
p00277
C++
#include<bits/stdc++.h> #define int long long #define P pair<int,int> #define INF LLONG_MAX/3 using namespace std; P segment[500000]; int point[100000]; signed main(){ int a,b,c; cin>>a>>b>>c; int d=1; while(d<a)d*=2; for(int e=0;e<d;e++){ if(e<a)segment[d-1+e]=P(0,e); else segment[d-1-e]=P(INF,I...
a.cc: In function 'int main()': a.cc:24:19: error: 'sacnf' was not declared in this scope; did you mean 'scanf'? 24 | int x,y,z;sacnf("%lld%lld%lld",&x,&y,&z); | ^~~~~ | scanf
s031953368
p00277
C++
#include<cstring> #include<cstdio> #include<algorithm> using namespace std; #define MAX 2000000 #define INFTY (1<<30) struct Team{ int id; int point; int showed; Team(int ia,int ib,int ic); }; int H,team[MAX+1]; void swap(*a,*b){ tmp=*a; *a=*b; *b=tmp; } void maxHeapify(int i){ int l,r,largest; l=2*i...
a.cc:15:6: error: variable or field 'swap' declared void 15 | void swap(*a,*b){ | ^~~~ a.cc:15:12: error: 'a' was not declared in this scope 15 | void swap(*a,*b){ | ^ a.cc:15:15: error: 'b' was not declared in this scope 15 | void swap(*a,*b){ | ^ a.cc: In funct...
s050896597
p00277
C++
#include<cstring> #include<cstdio> #include<algorithm> using namespace std; struct Team{ int id; int point; int showed; }; int H=0; void swap(int *a,int *b){ int tmp; tmp=*a; *a=*b; *b=tmp; } void maxHeapify(int i,Team* team){ int l,r,largest; l=2*i; r=2*i+1; if(l<=H&&team[l].point>team[i].point)...
a.cc: In function 'void IncreaseKey(int, int, int, Team*)': a.cc:52:15: error: no matching function for call to 'search(int&, int&)' 52 | int t=search(id,n); | ~~~~~~^~~~~~ In file included from /usr/include/c++/14/algorithm:60, from a.cc:3: /usr/include/c++/14/bits/stl_algobase.h:23...
s272069047
p00277
C++
#include <iostream> #include <algorithm> #include <cstring> #include <map> using namespace std; const int MAX_N = 1 << 17; typedef pair<int, int> P; int n, cnt[MAX_N]; P dat[2*MAX_N-1]; void init(int n_){ n = 1; while(n < n_) n *= 2; for(int i=0;i<2*n-1;i++) dat[i] = make_pair(INT_MAX, INT_MAX); } void upda...
a.cc: In function 'void init(int)': a.cc:18:47: error: 'INT_MAX' was not declared in this scope 18 | for(int i=0;i<2*n-1;i++) dat[i] = make_pair(INT_MAX, INT_MAX); | ^~~~~~~ a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by a...
s291651783
p00277
C++
#include<iostream> using namespace std; int top_id(int *x,int N){ int top=x[1]; int id=1; for(int i=2;i<=N;i++){ if(top<x[i]){ top = x[i]; id = i; } } return id; } int main(){ int N,R,L; cin >> N >> R >> L; int top=1; int d,t[2],x; int tim[N+1]; int total[N+1]; t[0] = 0; fo...
a.cc: In function 'int main()': a.cc:37:15: error: invalid types 'int[int]' for array subscript 37 | if(top_t<x[i]){ | ^ a.cc:38:16: error: invalid types 'int[int]' for array subscript 38 | top_t = x[i]; | ^
s225309513
p00277
C++
#include<iostream> using namespace std; int top_id(int *x,int N){ int top=x[1]; int id=1; for(int i=2;i<=N;i++){ if(top<x[i]){ top = x[i]; id = i; } } return id; } int main(){ int N,R,L; cin >> N >> R >> L; int top=1; int d,t,x; int oldt=0; int tim[N+1]; int total[N+1]; t[0...
a.cc: In function 'int main()': a.cc:22:4: error: invalid types 'int[int]' for array subscript 22 | t[0] = 0; | ^ a.cc:32:26: error: expected ';' before '}' token 32 | top = top_id(total,N) | ^ | ; 33 | } | ~ ...
s381882769
p00277
C++
#include <cstdio> #include <utility> #include <queue> #include <algorithm> using namespace std; int main(){ typedef pair<int,int> pii; priority_queue<pii> pq; int n, r, l, d, t, x, u = 0; scanf("%d%d%d", &n, &r, &l); vector<int> s(n + 1), c(n + 1); for(int i = 1; i <= n; ++i){ pq.push(pii(0, ~i)); } for(int ...
a.cc: In function 'int main()': a.cc:24:40: error: binding reference of type 'pii&' {aka 'std::pair<int, int>&'} to 'const __gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'const std::pair<int, int>'} discards qualifiers 24 | pii &p = pq....
s539123053
p00277
C++
#include <iostream> #include <algorithm> #include <string> #include <vector> #include <map> #include <sstream> #include <functional> #include <numeric> #include <cmath> #include <cstring> #include <queue> using namespace std; typedef long long LL; typedef pair<LL, int> P; const LL INF = LONG_MAX / 2LL; const int MAX...
a.cc:17:16: error: 'LONG_MAX' was not declared in this scope 17 | const LL INF = LONG_MAX / 2LL; | ^~~~~~~~ a.cc:12:1: note: 'LONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 11 | #include <queue> +++ |+#include <climits> 12 |
s088838446
p00277
C++
//AOJ0099とほぼ同じ。座標圧縮がいらない。 //1位の見つけ方→1位が得点(順位そのまま),1位以外が得点(1位と得点したチームを比べる),1位以外が減点(順位そのまま),1位が減点(O(N)で1位を探す) //欠点:最悪計算量O(N^2) #include<iostream> #define rep(j,n) for(j = 0;j < n;j++) using namespace std; int N,R,L; //チーム数 <= 10^5,レコード数 <= 10^6,競技時間 int n[1000000],t[1000000],x[1000000]; int score[100000]; int time[100...
a.cc:13:16: error: 'int time [100000]' redeclared as different kind of entity 13 | int time[100000]; | ^ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/...
s317062974
p00277
C++
#include <cstdio> int P[100000],T[100000]; int main() { int N,R,L,PT=0,n1=0; scanf("%d %d %d",&N,&R,&L); for(int i=0;i<R;i++) { int d,t,x; scanf("%d %d %d",&d,&t,&x); d--; P[d]+=x; if(x>0) { if(P[d]>p1||(P[d]==P[n1]&&n1>d)) { T[n1]+=t-PT+1; ...
a.cc: In function 'int main()': a.cc:11:21: error: 'p1' was not declared in this scope; did you mean 'n1'? 11 | if(P[d]>p1||(P[d]==P[n1]&&n1>d)) { | ^~ | n1
s275464608
p00277
C++
#include<iostream> #include<math.h> using namespace std ; int num[2][262144] = {} ; // 0 point , 1 num int ranking[100001] = {} ; int n , r , l ; int d , t , x ; int minus = -1001 ; int btd , bt , sum1=-1 , sum2=0 ; void count( int p ){ if( num[0][p*2] >= num[0][p*2+1] ){ num[0][p] = num[0][p*2] ; num[1][p] = ...
a.cc: In function 'int main()': a.cc:38:21: error: reference to 'minus' is ambiguous 38 | if( minus < t ) minus = t ; | ^~~~~ In file included from /usr/include/c++/14/string:49, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/i...
s414068538
p00278
C++
#include <iostream> #include <vector> #include <map> #include <algorithm> #include <string> using namespace std; typedef map<int,int> mapi; typedef pair<int,int> pr; vector<pr> data; vector<int> leader; int n,q; int study(int lo,int hi,int needs){ int f=lo,s=hi; while(f<=s){ int mid=(f+s)/2; if(data[mid].first>=nee...
a.cc: In function 'int study(int, int, int)': a.cc:16:12: error: reference to 'data' is ambiguous 16 | if(data[mid].first>=needs) | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include...
s311379367
p00278
C++
#include <iostream> #include <vector> #include <map> #include <algorithm> #include <string> #include <cmath> using namespace std; typedef map<int,int> mapi; typedef pair<int,int> pr; vector<pr> data; vector<int> leader; int n,q; int study(int lo,int hi,int needs){ int f=lo,s=hi; while(f<=s){ int mid=(f+s)/2; if(dat...
a.cc: In function 'int study(int, int, int)': a.cc:17:12: error: reference to 'data' is ambiguous 17 | if(data[mid].first>=needs) | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include...
s078003509
p00278
C++
#include <cstdio> #include <string> #include <algorithm> #include <vector> using namespace std; #define MAX_N 1000000 int N; int input[MAX_N + 1], s[MAX_N + 1]; vector<int> score; bool C(int r, int x){ int inc = 0; vector<int>::iterator it = score.begin(); for(int i = 1; i <= N; i++){ //p = 0; while(it != sco...
a.cc: In function 'int main()': a.cc:46:20: error: 'strcmp' was not declared in this scope 46 | if(strcmp(str, "ADD") == 0){ | ^~~~~~ a.cc:5:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <vector> ...
s753863616
p00278
C++
#include <cstdio> #include <string> #include <algorithm> #include <vector> using namespace std; #define MAX_N 1000000 int N; int input[MAX_N + 1], s[MAX_N + 1]; vector<int> score; bool C(int r, int x){ int inc = 0; vector<int>::iterator it = score.begin(); for(int i = 1; i <= N; i++){ //p = 0; while(it != sco...
a.cc: In function 'int main()': a.cc:46:20: error: 'strcmp' was not declared in this scope 46 | if(strcmp(str, "ADD") == 0){ | ^~~~~~ a.cc:5:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <vector> ...
s759840711
p00278
C++
#include <cstdio> #include <string> #include <algorithm> #include <vector> using namespace std; #define MAX_N 1000000 int N; int input[MAX_N + 1], s[MAX_N + 1]; vector<int> score; bool C(int r, int x){ int inc = 0; vector<int>::iterator it = score.begin(); for(int i = 1; i <= N; i++){ //p = 0; while(it != sco...
a.cc: In function 'int main()': a.cc:46:20: error: 'strcmp' was not declared in this scope 46 | if(strcmp(str, "ADD") == 0){ | ^~~~~~ a.cc:5:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <vector> ...