submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s041798015
p00728
C++
#include<stdio.h> void QSort(int x[ ], int left, int right); void Swap(int x[ ], int i, int j); void QSort(int x[ ], int left, int right) { int i, j; int pivot; i = left; j = right; pivot = x[(left + right) / 2]; while (1) { wh...
a.cc: In function 'int main()': a.cc:58:31: error: expected ';' before 'if' 58 | scanf("%d",&n) | ^ | ; 59 | if(n==0) break; | ~~
s640550731
p00728
C++
#include<stdio.h> void QSort(int x[ ], int left, int right); void Swap(int x[ ], int i, int j); void QSort(int x[ ], int left, int right) { int i, j; int pivot; i = left; j = right; pivot = x[(left + right) / 2]; while (1) { wh...
a.cc: In function 'int main()': a.cc:81:18: error: expected '}' at end of input 81 | return 0; | ^ a.cc:46:1: note: to match this '{' 46 | { | ^
s088908804
p00728
C++
#include <stdio.h> int sumSB(int n,int s[]){ int i,re,min = s[0],max = s[0]; for(i = 0;i < n;i++){ if(min > s[i]){ min = s[i]; } else if(max < s[i]){ max = s[i]; } } return(min + max); } int main(void){ int n,i,sum = 0,score[128],ave; while(1){ scanf("%d",&n); if(n == 0) break; for(i = 0;i...
a.cc: In function 'int main()': a.cc:29:35: error: invalid operands of types 'const char [3]' and 'int' to binary 'operator&' 29 | scanf("%d"&score[i]); | ~~~~^~~~~~~~~ | | | | ...
s286138591
p00728
C++
#include <cstdio> #include <iostream> #include <algorithm> int main(void) { int sum, n, mmin, mmax, in; while(1) { sum = 0; mmax = -1; mmin = 114514810; cin >> n; if(n == 0) break; for(int i=0; i<n; i++) { cin >> in; sum += in; mmax = max(mmax...
a.cc: In function 'int main()': a.cc:10:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 10 | cin >> n; | ^~~ | std::cin In file included from a.cc:2: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ...
s768347491
p00728
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int num = 0; while (cin >> num){ if (num == 0)return; vector<int> vec; int temp; while (cin >> temp){ vec.push_back(temp); } sort(vec.begin(),vec.end()); vec.pop_back(); reverse(vec.begin(), vec.end()); ...
a.cc: In function 'int main()': a.cc:10:30: error: return-statement with no value, in function returning 'int' [-fpermissive] 10 | if (num == 0)return; | ^~~~~~
s581818822
p00728
C++
gag
a.cc:1:1: error: 'gag' does not name a type 1 | gag | ^~~
s196271292
p00728
C++
int main() { while(true){ int number; //?????£??????????????° cin >> number; if(number == 0){exit(0);} int score[number]; int i; for(i=0;i<number;i++){ //??????????????? cin >> score[i]; } int max = 0; //???????????? int maxJ; //?????????????????????????????£?????? int min = 1001; int...
a.cc: In function 'int main()': a.cc:4:17: error: 'cin' was not declared in this scope 4 | cin >> number; | ^~~ a.cc:5:33: error: 'exit' was not declared in this scope 5 | if(number == 0){exit(0);} | ^~~~ a.cc:1:1: note:...
s655521051
p00728
C++
#include <iostream> using namespace std; int n, sum, l, s; int main() { while(cin>>n,n) { cin>>a; sum = a; l = a; s = a; for(int i=1;i<n;i++) { cin>>a; if(a>l)l=a; else if(a<s)s=a; sum+=a; } sum = sum/(n-2); cout<<sum<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:10: error: 'a' was not declared in this scope 9 | cin>>a; | ^
s973296987
p00728
C++
#include<iostream> #include<algorithm> int MIN,MAX,n,sum,a; int main(){ while(true){ cin>>n;if(!n){break;} MIN=10000000; MAX=0;sum=0; for(i=0;i<n;i++){cin>>a;MIN=min(MIN,a);MAX=max(MAX,a);sum+=a;} cout<<sum-MIN-MAX<<endl; } }
a.cc: In function 'int main()': a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin>>n;if(!n){break;} | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked ...
s571417858
p00728
C++
#include<iostream> #include<algorithm> using namespace std; int MIN,MAX,n,sum,a; int main(){ while(true){ cin>>n;if(!n){break;} MIN=10000000; MAX=0;sum=0; for(i=0;i<n;i++){cin>>a;MIN=min(MIN,a);MAX=max(MAX,a);sum+=a;} cout<<sum-MIN-MAX<<endl; } }
a.cc: In function 'int main()': a.cc:10:5: error: 'i' was not declared in this scope 10 | for(i=0;i<n;i++){cin>>a;MIN=min(MIN,a);MAX=max(MAX,a);sum+=a;} | ^
s060715151
p00728
C++
#include<iostream> using namespace std; int main () { while (true){ int n,i; int s = 0; int mi = 0; int ma = 0; cin >> n; if (n == 0) break; ?????? ??????int point[n]; for (i=0,i<n,i++){ cin >> point[i]; if (point[i] < mi) mi << point[i]; if (point[i] ...
a.cc: In function 'int main()': a.cc:15:1: error: expected primary-expression before '?' token 15 | ?????? | ^ a.cc:15:2: error: expected primary-expression before '?' token 15 | ?????? | ^ a.cc:15:3: error: expected primary-expression before '?' token 15 | ?????? | ^ a.cc:15:4: error: exp...
s477598050
p00728
C++
#include<iostream> using namespace std; int main () { while (true){ int n; int i; int s = 0; int mi = 0; int ma = 0; cin >> n; if (n == 0) break; ?????? ??????int point[100]; for (i=0,i<n,i++){ cin >> point[i]; if (point[i] < mi) mi << point[i]; ...
a.cc: In function 'int main()': a.cc:18:1: error: expected primary-expression before '?' token 18 | ?????? | ^ a.cc:18:2: error: expected primary-expression before '?' token 18 | ?????? | ^ a.cc:18:3: error: expected primary-expression before '?' token 18 | ?????? | ^ a.cc:18:4: error: exp...
s709789513
p00728
C++
#include<iostream> using namespace std; int main () { while (true){ int n; int i; int s = 0; int mi = 0; int ma = 0; cin >> n; if (n == 0) break; ?????? ??????int p[100]; for (i=0,i<n,i++){ cin >> p[i]; if (p[i] < mi) mi << p[i]; if (p[i] > ma) ...
a.cc: In function 'int main()': a.cc:18:1: error: expected primary-expression before '?' token 18 | ?????? | ^ a.cc:18:2: error: expected primary-expression before '?' token 18 | ?????? | ^ a.cc:18:3: error: expected primary-expression before '?' token 18 | ?????? | ^ a.cc:18:4: error: exp...
s616197163
p00728
C++
#include<iostream> using namespace std; int main () { while (true){ int n; int i; int s = 0; int mi = 0; int ma = 0; cin >> n; if (n == 0) break; ?????? ??????int p[100]; for (i=0,i<n,i++){ cin >> p[i]; if (p[i] < mi) mi << p[i]; if (p[i] > ma) ...
a.cc: In function 'int main()': a.cc:18:1: error: expected primary-expression before '?' token 18 | ?????? | ^ a.cc:18:2: error: expected primary-expression before '?' token 18 | ?????? | ^ a.cc:18:3: error: expected primary-expression before '?' token 18 | ?????? | ^ a.cc:18:4: error: exp...
s421244669
p00728
C++
#include<iostream> using namespace std; int main () { while (true){ int n; int i; int s = 0; int mi = 0; int ma = 0; cin >> n; if (n == 0) break; ?????? ??????int p[100]; for (i = 0;i < n;i++){ cin >> p[i]; if (p[i] < mi) mi << p[i]; if (p[i] > m...
a.cc: In function 'int main()': a.cc:18:1: error: expected primary-expression before '?' token 18 | ?????? | ^ a.cc:18:2: error: expected primary-expression before '?' token 18 | ?????? | ^ a.cc:18:3: error: expected primary-expression before '?' token 18 | ?????? | ^ a.cc:18:4: error: exp...
s036938215
p00728
C++
#include<iostream> using namespace std; int main () { while (true){ int n; int i; int s = 0; int mi = 0; int ma = 0; cin >> n; if (n == 0) break; ?????? ??????int p[100]; for (i = 0; i < n; i++){ cin >> p[i]; if (p[i] < mi;) mi << p[i]; if (p[i] > ma;)...
a.cc: In function 'int main()': a.cc:17:1: error: expected primary-expression before '?' token 17 | ?????? | ^ a.cc:17:2: error: expected primary-expression before '?' token 17 | ?????? | ^ a.cc:17:3: error: expected primary-expression before '?' token 17 | ?????? | ^ a.cc:17:4: error: exp...
s562932725
p00728
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { while( true ) { long long int n; long long int a = 0; long long int b = 0; int input[100]; cin >> n; if ( n == 0 ) break; for ( long long int i = 0; i < n; i++ ) { cin >> input[i];...
a.cc: In function 'int main()': a.cc:22:22: error: expected ';' before 'if' 22 | a << input[i] | ^ | ; 23 | 24 | if (input[i] > b) | ~~ a.cc:32:14: error: 's' was not declared in this scope 32 | ans += s[i];...
s783496650
p00728
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { while( true ) { long long int n; long long int a = 0; long long int b = 0; int input[100]; cin >> n; if ( n == 0 ) break; for ( long long int i = 0; i < n; i++ ) { cin >> input[i];...
a.cc: In function 'int main()': a.cc:22:21: error: expected ';' before 'if' 22 | a = input[i] | ^ | ; 23 | 24 | if (input[i] > b) | ~~ a.cc:32:14: error: 's' was not declared in this scope 32 | ans += s[i]; ...
s797540954
p00728
C++
#include<iostream> using namespace std; int main(){ while( true ){ int n; int ma = 0; int mi = 1000; int s = 0; cin >> n; if (n == 0){ break; } int a[n]; for(int i = 0; i < n; i++){ cin>>a[i]; if (a[i...
a.cc: In function 'int main()': a.cc:23:26: error: expected ';' before '}' token 23 | mi = a[i] | ^ | ; 24 | } | ~ a.cc:27:26: error: expected ';' before '}' token 27 | ma = ...
s329785810
p00728
C++
#include <iostream> #include <vector> #include <algorithm> #include <functional> using namespace std; struct CONTEST_DATA{ int judgements; vector< int > points; }; int main( void ){ vector< CONTEST_DATA > contests; vector< int > answers; while( true ){ CONTEST_DATA cd; cin >> cd.judgements; if( cd.judge...
a.cc: In function 'int main()': a.cc:36:45: error: unable to deduce 'auto' from 'contests.std::vector<CONTEST_DATA>::operator[](((std::vector<CONTEST_DATA>::size_type)i)).CONTEST_DATA::points.std::vector<int>::begin' 36 | auto p = contests[i].points.begin; a.cc:36:45: note: couldn't deduce template...
s235431369
p00728
C++
#include <iostream> using namespace std; int main(){ int num,temp; while(1){ cin>>num; if(num==0){ break; } int min=10000000,max=0,sum=0; for(int i=0;i<num;i++){ cin>>temp; if(min>temp)min=temp; if(max<temp)max=temp; sum+=temp; } sum=sum-max-min; cout<<sum/(num-2)<<endl; }
a.cc: In function 'int main()': a.cc:21:2: error: expected '}' at end of input 21 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s295761943
p00728
C++
#include <iostream> using namespace std; int main(){ int i = 0; while(cin >> i && !(i == 0)){ int a[i]; int j = 0; for(j=0; j<i; j++){ cin >> a[j]; } cout << endl; ...
a.cc: In function 'int main()': a.cc:36:10: error: expected '}' at end of input 36 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s361402069
p00728
C++
#include <iostream> using namespace std; int main(){ while (cin >> n && n > 0){ int large = 0; int small = 1000; int sum = 0; for (int i=0; i>n; ++i){ cin >> s; sum = sum + s; if (large < s) {large = s}; if (small > s) {small = s}; } int ans = 0; ans = (sum - large - small) / (n - 2); cou...
a.cc: In function 'int main()': a.cc:6:23: error: 'n' was not declared in this scope 6 | while (cin >> n && n > 0){ | ^ a.cc:11:32: error: 's' was not declared in this scope 11 | cin >> s; | ^
s717151119
p00728
C++
#include <iostream> using namespace std; int main(){ while (cin >> n && n > 0){ int large = 0; int small = 1000; int sum = 0; int n, s ; for (int i=0; i>n; ++i){ cin >> s; sum = sum + s; if (large < s) {large = s}; if (small > s) {small = s}; } int ans = 0; ans = (sum - la...
a.cc: In function 'int main()': a.cc:6:23: error: 'n' was not declared in this scope 6 | while (cin >> n && n > 0){ | ^ a.cc:14:50: error: expected ';' before '}' token 14 | if (large < s) {large = s}; | ...
s193444035
p00728
C++
#include <iostream> using namespace std; int main(){ while (cin >> n && n > 0){ int large = 0; int small = 1000; int sum = 0; int n, s ; for (int i=0; i>n; ++i){ cin >> s; sum = sum + s; if (large < s) {large = s}; if (small > s) {small = s}; }; int ans = 0; ans = (sum - l...
a.cc: In function 'int main()': a.cc:6:23: error: 'n' was not declared in this scope 6 | while (cin >> n && n > 0){ | ^ a.cc:14:50: error: expected ';' before '}' token 14 | if (large < s) {large = s}; | ...
s751500159
p00728
C++
#include <iostream> using namespace std; int main(){ int n, s ; while (cin >> n && n > 0){ int large = 0; int small = 1000; int sum = 0; for (int i=0; i>n; ++i){ cin >> s; sum = sum + s; if (large < s) {large = s}; if (small > s) {small = s}; }; int ans = 0; ans = (sum - large - s...
a.cc: In function 'int main()': a.cc:14:50: error: expected ';' before '}' token 14 | if (large < s) {large = s}; | ^ | ; a.cc:15:50: error: expected ';' before '}' token 15 | ...
s992243925
p00728
C++
#include <iostream> using namespace std; int main(){ int n, s ; while (cin >> n && n > 0){ int large = 0; int small = 1000; int sum = 0; for (int i=0; i>n; ++i){ cin >> s; sum = sum + s; if (large < s) {large = s}; if (small > s) {small = s}; } int ans = 0; ans = (sum - large - sm...
a.cc: In function 'int main()': a.cc:14:50: error: expected ';' before '}' token 14 | if (large < s) {large = s}; | ^ | ; a.cc:15:50: error: expected ';' before '}' token 15 | ...
s448644598
p00728
C++
#include <iostream> using namespace std; int main(){ int n, s ; while (cin >> n && n > 0){ int large = 0; int small = 1000; int sum = 0; for (int i=0; i>n; ++i){ cin >> s; sum = sum + s; if (large < s) {large = s} if (small > s) {small = s} } int ans = 0; ans = (sum - large - smal...
a.cc: In function 'int main()': a.cc:14:50: error: expected ';' before '}' token 14 | if (large < s) {large = s} | ^ | ; a.cc:15:50: error: expected ';' before '}' token 15 | ...
s193248328
p00728
C++
#include <iostream> #include <vector> using namespace std; int main(){ int n,i; cin >> n; while(n!=0){ int score[101]; for(i=0;i<n;i++) cin >> score[i]; sort(score,score+n); int sum=0; for(i=1;i<n-1;i++) sum+=score[i]; cout << sum/(n-2) << endl; cin >> n; } return 0; }
a.cc: In function 'int main()': a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(score,score+n); | ^~~~ | short
s624201635
p00728
C++
#include<iostream> #include<algorithm> #include <numeric> using namespace std; int main(){ int n; while (cin >> n, n){ int a[100], sum = 0; for (int i = 0; i < n; i++){ cin >> a[i]; } int sum = accumulate(a, a + n, 0); int Max = *max_element(a, a + n); int Min = *min_element(a, a + n); cout << (sum...
a.cc: In function 'int main()': a.cc:14:21: error: redeclaration of 'int sum' 14 | int sum = accumulate(a, a + n, 0); | ^~~ a.cc:10:29: note: 'int sum' previously declared here 10 | int a[100], sum = 0; | ^~~
s893790176
p00728
C++
#include <iostream> #define el endl #define fd fixed using namespace std; int main() { while (1) { int n; cin >> n; int m = n; if (n == 0) break; int max = INT_MIN; int min = INT_MAX; int ave = 0; while (m--) { int x; cin >> x; ave += x; if (x < min) min = x;...
a.cc: In function 'int main()': a.cc:14:15: error: 'INT_MIN' was not declared in this scope 14 | int max = INT_MIN; | ^~~~~~~ a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include <iostream> +++ |+#include <climi...
s409376011
p00728
C++
#include <iostream> #define el endl #define fd fixed using namespace std; int main() { while (1) { int n; cin >> n; int m = n; if (n == 0) break; int max = INT_MIN; int min = INT_MAX; int ave = 0; while (m--) { int x; cin >> x; ave += x; if (x < min) min = x;...
a.cc: In function 'int main()': a.cc:14:15: error: 'INT_MIN' was not declared in this scope 14 | int max = INT_MIN; | ^~~~~~~ a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include <iostream> +++ |+#include <climi...
s454321105
p00728
C++
//include //------------------------------------------ #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <...
a.cc: In function 'int main()': a.cc:88:17: error: 'INT_MAX' was not declared in this scope 88 | int c = INT_MAX; | ^~~~~~~ a.cc:24:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 23 | #include <ctime> +++ |+#include <cli...
s630238150
p00728
C++
#include<iostream> #include<vector> int main(void) { int score[100]; int sum, avg, i, n,tmp,j, count=0; while(1) { cin>>n; score[count]=n; count++; if(n<=0) { count-=1; break; } } //input for(i=0;i<count; i++){ for(j=i+1; j<count; j++){ if(scor...
a.cc: In function 'int main()': a.cc:12:7: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 12 | cin>>n; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Li...
s954059291
p00728
C++
#include <iostream> using namespace std; int main() {int n,i,a,b,max,min,sum,answer; while(cin >> n, n ) { i =2; cin >> a; max=a; min=a; sum =a; while(i<=n) {cin >> b; if(b>max){max=b;} if(b<min){min=b;} sum = sum+b; i++; } //if(b==0){break;} answer=(sum-max-min)/(n-2); cout << answer << endl; // your code goes here...
a.cc: In function 'int main()': a.cc:24:2: error: expected '}' at end of input 24 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() {int n,i,a,b,max,min,sum,answer; | ^
s280084226
p00728
C++
#include <iostream> #include <string> #include <vector> using namespace std; int main(){ int n; while(n!=0){ cin>>n; if(n==0){ break; } vector<int> score; int hoge; for(int i=0;i<n;i++){ cin>>hoge; score.push_back(hoge); } sort(score.begin(), score.end()); int sum=0; for(int i=1;i<n-1;i+...
a.cc: In function 'int main()': a.cc:19:17: error: 'sort' was not declared in this scope; did you mean 'short'? 19 | sort(score.begin(), score.end()); | ^~~~ | short
s148661717
p00728
C++
int main() { int n; while(1){ cin >> x; if(x == 0) break; int max = -1, mini = 10000, sum = 0, ten = 0, y = 0; for(int i = 0; i < n; i++){ cin >> ten; sum += ten; if(ten > max) max = ten; if(ten < mini) mini = ten; } ...
a.cc: In function 'int main()': a.cc:5:9: error: 'cin' was not declared in this scope 5 | cin >> x; | ^~~ a.cc:5:16: error: 'x' was not declared in this scope 5 | cin >> x; | ^ a.cc:16:9: error: 'cout' was not declared in this scope 16 | cout << y <<...
s857077295
p00728
C++
int main() { int n; while(1){ cin >> x; if(x == 0) break; int max = -1, mini = 10000, sum = 0, ten = 0, y = 0; for(int i = 0; i < x; i++){ cin >> ten; sum += ten; if(ten < mini) mini = ten; if(ten > max) max = ten; } ...
a.cc: In function 'int main()': a.cc:5:9: error: 'cin' was not declared in this scope 5 | cin >> x; | ^~~ a.cc:5:16: error: 'x' was not declared in this scope 5 | cin >> x; | ^ a.cc:17:9: error: 'cout' was not declared in this scope 17 | cout << y <<...
s355242779
p00728
C++
int main() { int n; while(1){ cin >> x; if(x == 0) break; int max = -1, mini = 10000, sum = 0, ten = 0, y = 0; for(int i = 0; i < x; i++){ cin >> ten; sum += ten; if(ten > max) max = ten; if(ten < mini) mini = ten; } ...
a.cc: In function 'int main()': a.cc:5:9: error: 'cin' was not declared in this scope 5 | cin >> x; | ^~~ a.cc:5:16: error: 'x' was not declared in this scope 5 | cin >> x; | ^ a.cc:17:9: error: 'cout' was not declared in this scope 17 | cout << y <<...
s289325661
p00728
C++
int main() { int n; while(1){ cin >> n; if(n == 0) break; int max = -1, min = 10000, sum = 0, score = 0, ans = 0; for(int i = 0; i < n; i++){ cin >> score; sum += score; if(score > max) max = score; if(score < min) min = score; ...
a.cc: In function 'int main()': a.cc:5:9: error: 'cin' was not declared in this scope 5 | cin >> n; | ^~~ a.cc:16:9: error: 'cout' was not declared in this scope 16 | cout << ans << endl; | ^~~~ a.cc:16:24: error: 'endl' was not declared in this scope 16 | c...
s689531556
p00728
C++
#include<iostream> #include<map> #include<vector> #include<algorithm> #include<cmath> #include<climits> #include<ctime> #include<cstring> #include<numeric> using namespace std; int main() { int n; while(1){ cin >> x; if(x == 0) break; int max = -1, mini = 10000, sum = 0, ten = 0, y = ...
a.cc: In function 'int main()': a.cc:18:16: error: 'x' was not declared in this scope 18 | cin >> x; | ^
s188694875
p00728
C++
#include <stdio.h> int main() { int n; while(1){ cin >> n; if(n == 0) break; int max = -1, min = 10000, sum = 0, score = 0, ans = 0; for(int i = 0; i < n; i++){ cin >> score; sum += score; if(score > max) max = score; if(score < min...
a.cc: In function 'int main()': a.cc:6:9: error: 'cin' was not declared in this scope 6 | cin >> n; | ^~~ a.cc:17:9: error: 'cout' was not declared in this scope 17 | cout << ans << endl; | ^~~~ a.cc:17:24: error: 'endl' was not declared in this scope 17 | c...
s579219216
p00728
C++
#include<iostream> using namespace std; int main() { int x; while(1){ cin >> x; if(x == 0) break; int max = -1, mini = 10000, sum = 0, score = 0, y = 0; for(int i = 0; i < x; i++){ cin >> score; sum += score; if(score > max) max = score; ...
a.cc: In function 'int main()': a.cc:18:20: error: 'n' was not declared in this scope 18 | y = sum / (n - 2); | ^
s463114888
p00728
C++
#include<iostream> using namespace std; int main() { int x; while(1){ cin >> x; if(x == 0) break; int max = -1, mini = 10000, sum = 0, score = 0, y = 0; for(int i = 0; i < x; i++){ cin >> score; sum += score; if(score > max) max = score; ...
a.cc: In function 'int main()': a.cc:18:20: error: 'n' was not declared in this scope 18 | y = sum / (n - 2); | ^
s175855756
p00728
C++
#include <iostream> using namespace std; int main(){ bool test = true; int num; while(test) { int ans = 0; cin >> num; if(num != 0) { int a[num]; for(int i = 0;i<num;i++) { cin >> a[i]; } sort(a, a + num); for(int i=1; i<num-1;i++) { ans += a[i]; } cout << ans << endl; } else { return 0; } } }
a.cc: In function 'int main()': a.cc:17:1: error: 'sort' was not declared in this scope; did you mean 'short'? 17 | sort(a, a + num); | ^~~~ | short
s740888775
p00728
C++
#include <iostream> using namespace std; class Score{ private: int shinpan; int score[100]; int max; int min; int ave; public: Score(); //????????????????????¨????????????????????¨??? void Reset(); //???????????°?????\??? void InputShinpan(int n){shinpan = n;} //?????°??????????????°?????¨?????\????????? vo...
a.cc: In constructor 'Score::Score()': a.cc:22:13: error: 'INT_MIN' was not declared in this scope 22 | max=INT_MIN; | ^~~~~~~ a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include <iostream> +++ |+#include <cl...
s181671153
p00728
C++
#include < iostream > #include<algorithm> using namespace std; int main() { int n, s[101]; while (cin >>n &&n> 0) { int mean = 0; for (int i = 0; i < n; i++) cin >> s[i]; sort(s, s + n); for (int i = 1; i < n - 1; i++)mean += s[i]; cout << mean << endl; } return 0; }
a.cc:1:10: fatal error: iostream : No such file or directory 1 | #include < iostream > | ^~~~~~~~~~~~ compilation terminated.
s833580523
p00728
C++
#include<iostream> #include<vector> #include<string> using namespace std; int main(){ int d,e; while(cin>>d>>e,d){ double res=10000000; for(int i=0;i<=d;i++){ int j=d-i; res=min(res,abs(sqrt(double(int(i*i+j*j)))-e)); } cout<<res<<endl; } }
a.cc: In function 'int main()': a.cc:12:41: error: 'sqrt' was not declared in this scope 12 | res=min(res,abs(sqrt(double(int(i*i+j*j)))-e)); | ^~~~
s506900645
p00728
C++
#include <bits/stdc++.h> using namespace std; struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast; typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<vector<int> > vii; typedef queue<int> qi; typedef stack<int> si; typedef deque<int> dqi; #define reps(i, a, b...
a.cc: In function 'int main()': a.cc:52:22: error: expected ')' before ',' token 52 | while (int n = in(), n){ | ~ ^ | ) a.cc:52:22: error: expected primary-expression before ',' token
s910623198
p00728
C++
#include <iostream> #include<algorithm> using namespase std; int main(){ int n; cin>>n; int sum =0; int ma =0; int mi =100000; int cnt =0; for(int i=0;i<n;i++){int s;cin>>s;sum+=s;ma =max(ma,s);mi=min(mi,s);cnt++;} cout<<(sum-mi-ma)/(cnt-2)<<endl }
a.cc:3:7: error: expected nested-name-specifier before 'namespase' 3 | using namespase std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin>>n; | ^~~ | std::cin In file included from a.cc:1: /usr/include/...
s578840635
p00728
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int n; int total; int ave; while(1){ vector<int> v; cin>>n; if(n==0)break; for(int i=0;i<n;i++){ cin>>tmp; v.push_back(tmp); } sort(v.begin(),v.end()); total=0; for(int i=0;i<n;i++){ total+=v[i]...
a.cc: In function 'int main()': a.cc:18:30: error: 'tmp' was not declared in this scope; did you mean 'tm'? 18 | cin>>tmp; | ^~~ | tm
s443198818
p00728
C++
loop do l = gets.to_i exit if l == 0 m = l.times.map{gets.to_i} puts (m.reduce(:+) - m.minmax.reduce(:+)) / (l - 2) end
a.cc:1:1: error: 'loop' does not name a type 1 | loop do | ^~~~ a.cc:5:8: error: expected constructor, destructor, or type conversion before '(' token 5 | puts (m.reduce(:+) - m.minmax.reduce(:+)) / (l - 2) | ^
s223085464
p00728
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(true){ int sum=0,i,max=0,min=1000,ave; int n=sc.nextInt(); if(n==0){ break; } for(i=0;i<n;i++){ int point=sc.nextInt(); if(point<min){ min=point; ...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s624491962
p00728
C++
#include<algorithm> using namespace std; int main(){ int n; while(cin>>n&&n!=0){ cin>>n; int a[]={}; int sum=0; for(int i=0;i<n;i++){ int b; cin>>b; a[i]=b; sum+=b; } sort(a,a+n); sum-=a[0]; sum-=a[n-1]; cout<<sum/(n-2)<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'cin' was not declared in this scope 5 | while(cin>>n&&n!=0){ | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include<algorithm> +++ |+#include <iostream> 2 | ...
s728026780
p00728
C++
# coding: utf-8 import sys if __name__ == '__main__': while 1: n = int(input()) if n == 0: break a = [int(input()) for i in range(n)] print((sum(a) - min(a) - max(a)) // (n-2));
a.cc:1:3: error: invalid preprocessing directive #coding 1 | # coding: utf-8 | ^~~~~~ a.cc:5:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 5 | if __name__ == '__main__': | ^~~~~~~~~~ a.cc:3:1: error: 'import' does not name a type 3 | import...
s810547270
p00728
C++
#include<iostream> using namespace std; int main(){ int n, a[100], s; while(cin >> n,n){ s=0; for(int i = 0;i < n;i ++){ cin >> a[i]; } sort(a,a+n); for(int i = 1;i < n-1;i ++){ s += a[i]; } cout << s/(n-2)<< endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(a,a+n); | ^~~~ | short
s072332456
p00728
C++
#include<iostream> #include<algorithm> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) for(int i=0;i<(n);i++) #define INF INT_MAX/3 #define ALL(a) (a).begin(),(a).end() #define PII pair<int,int> #define PCC pair<char,char> #define PCI pair<char,int> #define PIC pair<int,char> #define M...
a.cc: In function 'int main()': a.cc:6:13: error: 'INT_MAX' was not declared in this scope 6 | #define INF INT_MAX/3 | ^~~~~~~ a.cc:20:27: note: in expansion of macro 'INF' 20 | int Min = INF; | ^~~ a.cc:3:1: note: 'INT_MAX' is defined in header '...
s278481605
p00728
C++
#include<iostream> #include<algorithm> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) for(int i=0;i<(n);i++) #define INF INT_MAX/3 #define ALL(a) (a).begin(),(a).end() #define PII pair<int,int> #define PCC pair<char,char> #define PCI pair<char,int> #define PIC pair<int,char> #define M...
a.cc: In function 'int main()': a.cc:6:13: error: 'INT_MAX' was not declared in this scope 6 | #define INF INT_MAX/3 | ^~~~~~~ a.cc:20:27: note: in expansion of macro 'INF' 20 | int Min = INF; | ^~~ a.cc:3:1: note: 'INT_MAX' is defined in header '...
s067114586
p00728
C++
#include <iostream> #include <string> #include <queue> #include <numeric> using namespace std; int main(){ int n; while(cin >> n, n){ vector<int> score; for(int i=0; i<n; i++){ int s; cin >> s; score.push_back(s); } sort(score.begin(), score.end()); int sum = accumulate(score.begin(), score.end(),0)...
a.cc: In function 'int main()': a.cc:16:17: error: 'sort' was not declared in this scope; did you mean 'short'? 16 | sort(score.begin(), score.end()); | ^~~~ | short
s399983750
p00728
C++
#include <iostream> #include <string> #include <queue> #include <numeric> using namespace std; int main(){ int n; while(cin >> n, n){ vector<int> score; for(int i=0; i<n; i++){ int s; cin >> s; score.push_back(s); } sort(score.begin(), score.end()); int sum = accumulate(score.begin(), score.end(),0)...
a.cc: In function 'int main()': a.cc:16:17: error: 'sort' was not declared in this scope; did you mean 'short'? 16 | sort(score.begin(), score.end()); | ^~~~ | short
s333806839
p00728
C++
int main() { //n: ??????????????° int n, point[100], sum = 0, ave = 0, max = 0, min = 0; while( cin >> n && n != 0){ for(int i = 0; i < n; i++) cin >> point[i]; sort(point, point + n); /* for(int i = 0; i < n; i++) cout << "Point: " << point[i] << " "; cout << endl;*/ for(int i = 1; i < n-1; i+...
a.cc: In function 'int main()': a.cc:5:16: error: 'cin' was not declared in this scope; did you mean 'min'? 5 | while( cin >> n && n != 0){ | ^~~ | min a.cc:10:17: error: 'sort' was not declared in this scope; did you mean 'short'? 10 | sort(point...
s530181047
p00728
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<climits> #include<iostream> #include<algorithm> #include<stack> #include<queue> #include<vector> #include<list> #include<map> #include<set> typedef long long ll; typedef unsigned long long ull; using namespace std; #define pb push_back int dy...
a.cc: In function 'int main()': a.cc:42:26: error: request for member 'Max' in 'b', which is of non-class type 'int [a]' 42 | sum -= b.Max() + b.Min(); | ^~~ a.cc:42:36: error: request for member 'Min' in 'b', which is of non-class type 'int [a]' 42 | ...
s426281777
p00728
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<climits> #include<iostream> #include<algorithm> #include<stack> #include<queue> #include<vector> #include<list> #include<map> #include<set> typedef long long ll; typedef unsigned long long ull; using namespace std; #define pb push_back int dy...
a.cc: In function 'int main()': a.cc:42:31: error: 'mini' was not declared in this scope 42 | int maxi = 0; mini = 1000000000; | ^~~~
s850023517
p00728
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int n; while(cin>>n){ if(n==0){return 0;} int s[n]; for(int i=0;i<n;i++){ cin>>p[i]; } sort(p,p+n); int ans=0; for(int i=1;i<n-1;i++){ ans+=p[i]; } cout<<ans/(n-2)<<endl; } return 0;}
a.cc: In function 'int main()': a.cc:10:12: error: 'p' was not declared in this scope 10 | cin>>p[i]; | ^ a.cc:12:10: error: 'p' was not declared in this scope 12 | sort(p,p+n); | ^
s209322094
p00728
C++
# encodign: utf-8 while true do # ????°??????§???????????? (?????????0??\???1000??\???) max = -1 min = 1001 # ????¨????????????? sum = 0 # n?????? n = gets.to_i break if n == 0 # 0?????¨???????????? # n????????????????????? n.times do v = gets.to_i min = v if v <...
a.cc:1:3: error: invalid preprocessing directive #encodign 1 | # encodign: utf-8 | ^~~~~~~~ a.cc:4:7: error: invalid preprocessing directive #? 4 | # ????°??????§???????????? (?????????0??\???1000??\???) | ^ a.cc:4:11: error: extended character ° is not valid in an identifier 4 | ...
s709683600
p00728
C++
# encodign: utf-8 while true do # ????°??????§???????????? (?????????0??\???1000??\???) max = -1 min = 1001 # ????¨????????????? sum = 0 # n?????? n = gets.to_i break if n == 0 # 0?????¨???????????? # n????????????????????? n.times do v = gets.to_i min = v if v <...
a.cc:1:3: error: invalid preprocessing directive #encodign 1 | # encodign: utf-8 | ^~~~~~~~ a.cc:4:7: error: invalid preprocessing directive #? 4 | # ????°??????§???????????? (?????????0??\???1000??\???) | ^ a.cc:4:11: error: extended character ° is not valid in an identifier 4 | ...
s813734918
p00728
C++
# encoding: utf-8 while true do # ????°??????§???????????? (?????????0??\???1000??\???) max = -1 min = 1001 # ????¨????????????? sum = 0 # n?????? n = gets.to_i break if n == 0 # 0?????¨???????????? # n????????????????????? n.times do v = gets.to_i min = v if v <...
a.cc:1:3: error: invalid preprocessing directive #encoding 1 | # encoding: utf-8 | ^~~~~~~~ a.cc:4:7: error: invalid preprocessing directive #? 4 | # ????°??????§???????????? (?????????0??\???1000??\???) | ^ a.cc:4:11: error: extended character ° is not valid in an identifier 4 | ...
s189233326
p00728
C++
#!/usr/bin/env ruby - # coding: utf-8 while true do # ????°??????§???????????? (?????????0??\???1000??\???) max = -1 min = 1001 # ????¨????????????? sum = 0 # n?????? n = gets.to_i break if n == 0 # 0?????¨???????????? # n????????????????????? n.times do v = gets.to_i ...
a.cc:1:2: error: invalid preprocessing directive #! 1 | #!/usr/bin/env ruby - | ^ a.cc:2:3: error: invalid preprocessing directive #coding 2 | # coding: utf-8 | ^~~~~~ a.cc:5:7: error: invalid preprocessing directive #? 5 | # ????°??????§???????????? (?????????0??\???1000??\???) | ...
s655093038
p00728
C++
#!/usr/bin/ruby # -*- coding: utf-8 -*- while true do # ????°??????§???????????? (?????????0??\???1000??\???) max = -1 min = 1001 # ????¨????????????? sum = 0 # n?????? n = gets.to_i break if n == 0 # 0?????¨???????????? # n????????????????????? n.times do v = gets.to_i ...
a.cc:1:2: error: invalid preprocessing directive #! 1 | #!/usr/bin/ruby | ^ a.cc:2:3: error: invalid preprocessing directive #- 2 | # -*- coding: utf-8 -*- | ^ a.cc:5:7: error: invalid preprocessing directive #? 5 | # ????°??????§???????????? (?????????0??\???1000??\???) | ^ a...
s564059545
p00728
C++
while true do # ????°??????§???????????? (?????????0??\???1000??\???) max = -1 min = 1001 # ????¨????????????? sum = 0 # n?????? n = gets.to_i break if n == 0 # 0?????¨???????????? # n????????????????????? n.times do v = gets.to_i min = v if v < min max = ...
a.cc:2:7: error: invalid preprocessing directive #? 2 | # ????°??????§???????????? (?????????0??\???1000??\???) | ^ a.cc:2:11: error: extended character ° is not valid in an identifier 2 | # ????°??????§???????????? (?????????0??\???1000??\???) | ^ a.cc:2:18: error: extended ...
s121756269
p00728
C++
while true do max = -1 min = 1001 sum = 0 n = gets.to_i n.times do v = gets.to_i min = v if v < min max = v if v > max sum += v end sum -= (min + max) p sum / (n-2) end
a.cc:1:1: error: expected unqualified-id before 'while' 1 | while true do | ^~~~~
s688408580
p00728
C++
while true do max = -1 min = 1001 sum = 0 n = gets.to_i n.times do v = gets.to_i min = v if v < min max = v if v > max sum += v end sum -= (min + max) p sum / (n-2) end
a.cc:3:1: error: expected unqualified-id before 'while' 3 | while true do | ^~~~~
s850314342
p00728
C++
while true do max = -1 min = 1001 sum = 0 n = gets.to_i break if n == 0 n.times do v = gets.to_i min = v if v < min max = v if v > max sum += v end sum -= (min + max) p sum / (n-2) end
a.cc:1:1: error: expected unqualified-id before 'while' 1 | while true do | ^~~~~
s891886778
p00728
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main(){ int a,n; for(;;){ vector<int> num; cin>>n; if(n==0) break; for(int i = 0; i < n; i++){ cin>>a; num.push_back(a); } sort(num.begin(), num.end()); ...
a.cc: In function 'int main()': a.cc:23:18: error: 'class std::vector<int>' has no member named 'length' 23 | sum/=num.length(); | ^~~~~~
s289033436
p00728
C++
#include <iostream> using namespace std; int main(){ cin.tie(0); ios_base::sync_with_stdio(false); for(;;){ int a,n,s=0,max=0,min=INT_MAX; cin>>n; if(n==0) break; for(int i = 0; i < n; i++){ cin>>a; s+=a; if(max<a) max=a; if(mi...
a.cc: In function 'int main()': a.cc:8:31: error: 'INT_MAX' was not declared in this scope 8 | int a,n,s=0,max=0,min=INT_MAX; | ^~~~~~~ a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include <io...
s464033364
p00728
C++
import math import copy def average(points): sum = 0 for i in points: sum += i return sum / len(points) outputs = [] while True: num = int(input()) if num == 0: break points = [] for _ in range(num): point = int(input()) points.append(point) points = ...
a.cc:1:1: error: 'import' does not name a type 1 | import math | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s488936650
p00728
C++
#include<iostream> using namespace std; int main(){ int judge; int maxscore =0; int minscore =0; cin >> judge; if(i != 0){ int score[judge]; for(int i=0; i<judge; i++){ cin >> score[i]; if(score[i] > maxscore){ maxscore = score[i]; } if(score[i] < minscore){ minscore = score[i]; } if(i==0){ minscore =...
a.cc: In function 'int main()': a.cc:8:4: error: 'i' was not declared in this scope 8 | if(i != 0){ | ^
s609001127
p00728
C++
#include<iostream> using namespace std; int main(){ int judge; int maxscore =0; int minscore =0; int totalscore = 0; cin >> judge; if(judge != 0){ int score; for(int i=0; i<judge; i++){ cin >> score; if(score[i] > maxscore){ maxscore = score; } if(score[i] < minscore){ minscore = score; } if(i==0){ ...
a.cc: In function 'int main()': a.cc:13:25: error: invalid types 'int[int]' for array subscript 13 | if(score[i] > maxscore){ | ^ a.cc:16:25: error: invalid types 'int[int]' for array subscript 16 | if(score[i] < minscore){ | ...
s261008544
p00728
C++
#include <iostream> using namespace std; int larger(int x,int y) { int z = 0; if (x > y)z = x; else z = y; return z; } int smaller(int x, int y) { int z = 0; if (x < y)z = x; else z = y; return z; } int main(void) { int s = 1; while (s == 1) { int sinsa, a[100], sum = 0, ave; cin >> sinsa; if (sinsa == ...
a.cc: In function 'int main()': a.cc:40:18: error: expected '}' at end of input 40 | return 0; | ^ a.cc:15:16: note: to match this '{' 15 | int main(void) { | ^
s323637148
p00728
C++
#include<iostream> #include<vector> using namespace std; int main() { int n; while(cin >> n, n){ vector<int> s(n); for(int i = 0; i < n; i++) cin >> s[i]; sort(s.begin(), s.end()); int sum = 0; int i; for(i = 1; i < n - 1; i++) sum += s[i]; cout << sum / (i - 1) << endl; } retur...
a.cc: In function 'int main()': a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(s.begin(), s.end()); | ^~~~ | short
s624884785
p00728
C++
#include <iostream> using namespace std; int main() { int N, n, sum, largest, smallest; sum = 0; largest = 0; smallest = 1000; while(cin >> N; && N>0){ for(int i = 0; i<N; i++) { cin >> n; sum += n; if(smallest > n){ smallest = n;} if(largest < n){ largest = n;} } cout << (sum-smallest-...
a.cc: In function 'int main()': a.cc:9:23: error: expected ')' before ';' token 9 | while(cin >> N; && N>0){ | ~ ^ | ) a.cc:9:29: error: ordered comparison of pointer with integer zero ('void*' and 'int') 9 | while(cin >> N; && N>0){ | ...
s510027124
p00728
C++
#include <iostream> #include <algorithm> using namespace std; int main(void){ int n; while(1){ cin>>n; if(n==0)break; vector<int> s(n); for(int i=0;i<n;i++){ cin>>s[i]; } sort(s.begin(),s.end()); long long ans=0; for(int i=1;i<n-1;i++){...
a.cc: In function 'int main()': a.cc:9:9: error: 'vector' was not declared in this scope 9 | vector<int> s(n); | ^~~~~~ 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> ...
s134007313
p00728
C++
#include<iostream> using namespace std; int N,S,max,min; int main() { while (cin >> N && N>0) { // By while (), adopt the form of std in int sum = 0; max = 0; min = 0; for (int i=0; i<N; i++) { cin >> S; sum += S; // calculate sum if (max < S) max = S; // search max if (min > S) min = S; // searc...
a.cc: In function 'int main()': a.cc:8:17: error: reference to 'max' is ambiguous 8 | max = 0; | ^~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base....
s407410851
p00728
C++
int main() { int a,b[100]; int max=0,min=100,sum=0,result; for(int i=0;i<a;i++){ cin>>b[i]; sum+=b[i]; if(b[i]<min){ min=b[i]; } else if(b[i]>max){ max=b[i]; } } result=sum-min-max; cout<<result; return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'min'? 6 | cin>>b[i]; | ^~~ | min a.cc:16:5: error: 'cout' was not declared in this scope 16 | cout<<result; | ^~~~
s758485026
p00728
C++
while True: n = int(raw_input()) if n == 0: break L = [int(raw_input()) for _ in range(n)] print (sum(L) - max(L) - min(L)) / (n - 2)
a.cc:1:1: error: expected unqualified-id before 'while' 1 | while True: | ^~~~~
s548869156
p00728
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n; while (true) { cin >> n; if (!n) { break; } vector<int> v(n); for (int i = 0; i < n; i++) { cin >> v[i]; } v.sort(v.begin(), v.end()); int sum = 0; for...
a.cc: In function 'int main()': a.cc:16:11: error: 'class std::vector<int>' has no member named 'sort' 16 | v.sort(v.begin(), v.end()); | ^~~~
s553918312
p00728
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
s656656800
p00728
C++
#include <iostream> #include <boost/foreach.hpp> #include <vector> #include <algorithm> using namespace std; int main(void){ int n, tmp; int ans = 0; while(cin >> n && n) { vector<int> in; for(int i=0; i<n; ++i) { cin >> tmp; in.push_back(tmp); } sor...
a.cc:2:10: fatal error: boost/foreach.hpp: No such file or directory 2 | #include <boost/foreach.hpp> | ^~~~~~~~~~~~~~~~~~~ compilation terminated.
s754103039
p00728
C++
import java.util.Arrays; import java.util.Scanner; public class main { public static void main(String args[]){ Scanner scan = new Scanner(System.in); while(true){ int sum=0; int ave=0; int n=scan.nextInt(); if(n==0){ break; } int[] s = new int[n]; for(int i = 0;i < n;i++){ s[i]=scan.ne...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Arrays; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.util.Scanner; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-t...
s098803307
p00728
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
s830902831
p00728
C++
#include <iostream> #include <iomanip> #include <string> #include <sstream> #include <vector> #include <array> #include <unordered_map> #include <algorithm> #include <numeric> #include <set> #include <map> #include <queue> #include <stack> #include <bitset> #include <valarray> #include <utility> #include <tuple> #inclu...
a.cc:24:10: fatal error: boost\range.hpp: No such file or directory 24 | #include <boost\range.hpp> | ^~~~~~~~~~~~~~~~~ compilation terminated.
s348891615
p00728
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
s398896585
p00728
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl; #define REP(i,n) for(int i=0;i<(int)(n);i++) #define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define FORR(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--) #define CHMIN(a,b) (a)...
a.cc: In function 'int main()': a.cc:30:37: error: expected ';' before 'printf' 30 | ans-=(point[0]+point[num-1]) | ^ | ; 31 | printf("%d\n",ans); | ~~~~~~ In file included from...
s900552924
p00728
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl; #define REP(i,n) for(int i=0;i<(int)(n);i++) #define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define FORR(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--) #define CHMIN(a,b) (a)...
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/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAcc...
s180975079
p00728
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main(void){ while(true){ long n; cin >> n; if(n == 0){ break; } vector<long> S; for(int i = 0; i < n;++i){ long s; cin >> s; S.push_back(s); } long mx = *max_element(S.begin()...
a.cc: In function 'int main()': a.cc:21:18: error: 'accumulate' was not declared in this scope 21 | long sum = accumulate(S.begin(), S.end(), 0); | ^~~~~~~~~~
s377384440
p00728
C++
#include<iostream> #include<algorithm> #include<math.h> #include<cstdio> #include<ctype.h> #include<stdio.h> #include<set> #include<vector> #include<map> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<numeric> #include<string> typedef long long ll; using namespace std...
a.cc: In function 'int main()': a.cc:23:8: error: 'i' was not declared in this scope 23 | ll T[i]; | ^ a.cc:26:10: error: 'T' was not declared in this scope 26 | cin>>T[i]; | ^
s805285161
p00728
C++
#include<iostream> #include<algorithm> #include<math.h> #include<set> #include<vector> #include<map> #include<functional> #include<random> #include<string> typedef long long ll; using namespace std; int main(){ ll N; ll s[1100]; ll sum=0; ll t=0; while(t<=20){ s++; cin >> N; for(ll i = 0; i < N; ++i;){ ...
a.cc: In function 'int main()': a.cc:18:3: error: lvalue required as increment operand 18 | s++; | ^ a.cc:20:27: error: expected ')' before ';' token 20 | for(ll i = 0; i < N; ++i;){ | ~ ^ | ) a.cc:20:28: error: expected primary-expression ...
s080104072
p00728
C++
#include<iostream> #include<algorithm> #include<math.h> #include<set> #include<vector> #include<map> #include<functional> #include<random> #include<string> typedef long long ll; using namespace std; int main(){ ll N; ll s[1100]; ll sum=0; ll t=0; while(t<=20){ s++; cin >> N; for(ll i = 0; i < N; ++i;){ ...
a.cc: In function 'int main()': a.cc:18:3: error: lvalue required as increment operand 18 | s++; | ^ a.cc:20:27: error: expected ')' before ';' token 20 | for(ll i = 0; i < N; ++i;){ | ~ ^ | ) a.cc:20:28: error: expected primary-expression ...
s512137580
p00728
C++
#include<iostream> #include<algorithm> #include<math.h> #include<set> #include<vector> #include<map> #include<functional> #include<random> #include<string> typedef long long ll; using namespace std; int main(){ ll N; ll s[1100]; ll sum=0; ll t=0; while(t<=20){ s++; cin >> N; for(ll i = 0; i < N; ++i;){ ...
a.cc: In function 'int main()': a.cc:18:3: error: lvalue required as increment operand 18 | s++; | ^ a.cc:20:27: error: expected ')' before ';' token 20 | for(ll i = 0; i < N; ++i;){ | ~ ^ | ) a.cc:20:28: error: expected primary-expression ...
s287084318
p00728
C++
#include<bits/stdc++h> typedef long long ll; using namespace std; int main(){ ll N; ll s[1100]; ll sum=0; while(N){ cin >>N; for(ll i = 0; i < N; ++i){ cin >> s[i]; } sort(s,s+N); for(ll i = 1; i < N-1; ++i){ sum+=s[i]; } cout<<sum/(N-2)<<endl; cin>>N; } }
a.cc:1:9: fatal error: bits/stdc++h: No such file or directory 1 | #include<bits/stdc++h> | ^~~~~~~~~~~~~~ compilation terminated.