submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s403446232
p03699
C++
#include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<int> s(N); int sum = 0; for (int i = 0; i < N; i++) { cin >> s[i]; sum += s[i]; } sort(s.begin(), s.end()); int ans; if (sum % 10 != 0) { ans = sum; } else...
a.cc: In function 'int main()': a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(s.begin(), s.end()); | ^~~~ | short
s508135623
p03699
C
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main(){ int n,i; cin >> n; int sum=0; vector<int> a(n); for(i=0;i<n;i++){ cin >> a[i]; sum+=a[i]; } sort(a.begin(),a.end()); if(sum%10==0){ for(i=0;a[i]%10==0&&i<n;i++); sum-=a[i]; if(i==n)sum=0; } c...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s794432727
p03699
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,ans=0; cin >> n; vector<int> da(n); for (int i = 0;i < n;i++) { cin >> da[i]; ans += da[i]; } sort(da.begin(), da.end()); int i = 0; while (da[i]%10==0&&i!=n) { i++; } if (i == n) cout << 0 << endl; else cout << ans - da[i] << endl;
a.cc: In function 'int main()': a.cc:19:45: error: expected '}' at end of input 19 | cout << ans - da[i] << endl; | ^ a.cc:3:12: note: to match this '{' 3 | int main() { | ^
s571084102
p03699
C++
include <bits/stdc++.h> using namespace std; int main() { int n,ans=0; cin >> n; vector<int> da(n); for (int i = 0;i < n;i++) { cin >> da[i]; ans += da[i]; } sort(da.begin(), da.end()); int i = 0; while (da[i]%10==0&&i!=n) { i++; } if (i == n) cout << 0 << endl; else cout << ans - da[i] << endl;
a.cc:1:1: error: 'include' does not name a type 1 | include <bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:5:9: error: 'cin' was not declared in this scope 5 | cin >> n; | ^~~ a.cc:6:9: error: 'vector' was not declared in this scope 6 | vector<int> da(n); ...
s752482783
p03699
C++
#include <vector> #include <cstdio> #include <iostream> #include <cmath> #include <string> #include <cstring> #include <algorithm> #include <numeric> #include <cstdlib> #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define REP(i,n) for(int i=0;i<n;i++) #define SORT(...
a.cc: In function 'int main()': a.cc:42:24: error: 'class std::vector<int>' has no member named 'length' 42 | REP(i, not_ten_times.length()) { | ^~~~~~ a.cc:14:32: note: in definition of macro 'REP' 14 | #define REP(i,n) for(int i=0;i<n;i++) | ^
s100694547
p03699
C++
#include <vector> #include <cstdio> #include <iostream> #include <cmath> #include <string> #include <cstring> #include <algorithm> #include <numeric> #include <cstdlib> #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define REP(i,n) for(int i=0;i<n;i++) #define SORT(...
a.cc: In function 'int main()': a.cc:31:6: error: 'tmp' was not declared in this scope; did you mean 'tm'? 31 | if(tmp % 10 == 0) { | ^~~ | tm
s766443161
p03699
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,m10,other,min; cin>>n; vector<int> a(n); n10=other=0; min=10000; for(int i=0;i<n;i++){ cin>>a[i]; if(a[i]%10==0)m10+=a[i]; else{ other+=a[i]; if(a[i]<min)min=a[i]; } } if(other%10==0)other-=min; cout<<m10+oth...
a.cc: In function 'int main()': a.cc:8:3: error: 'n10' was not declared in this scope; did you mean 'm10'? 8 | n10=other=0; | ^~~ | m10
s724484005
p03699
C++
#include <iostream> #include <numeric> #include <string> #include <algorithm> #include <vector> #include <cstdlib> #include <cmath> #include <utility> #include <functional> #define repd(i,a,b); for (int i=(a);i<(b);i++) #define rep(i,n) repd(i,0,n) #define ll long long int using namespace std; int main() { int n;...
a.cc: In function 'int main()': a.cc:44:2: error: expected '}' at end of input 44 | } | ^ a.cc:17:12: note: to match this '{' 17 | int main() { | ^
s430348722
p03699
C++
#include <iostream> #include <numeric> #include <string> #include <algorithm> #include <vector> #include <cstdlib> #include <cmath> #include <utility> #include <functional> #define repd(i,a,b); for (int i=(a);i<(b);i++) #define rep(i,n) repd(i,0,n) #define ll long long int using namespace std; int main() { int n;...
a.cc: In function 'int main()': a.cc:21:11: error: expected initializer before '==' token 21 | bool chk == true; | ^~ a.cc:25:6: error: 'chk' was not declared in this scope 25 | chk = false; | ^~~ a.cc:28:5: error: 'chk' was not declared in this scope 28 | if(chk){ | ...
s579726418
p03699
C++
#include<iostream> #include<algorithm> #include<vector> using namespace std; int main() { int n; cin >> n; int s[n]; int res = 0; bool tf = false; int not10 = 0; for(int i=0;i<n;++i) cin >> s[i]; sort(s,s+n); for(int i=0;i<n;++i) { res += s[i]; if(tf == false && s[i]%10 != 0) { ...
a.cc: In function 'int main()': a.cc:36:23: error: expected '}' at end of input 36 | cout << res << endl; | ^ a.cc:7:1: note: to match this '{' 7 | { | ^
s415420400
p03699
Java
import java.util.Arrays; public class AtCoder { private static java.util.Scanner scanner = new java.util.Scanner(System.in); public static void main(String[] args) { int n = scanner.nextInt(), a[] = new int[n], sum = 0; for (int i = 0; i < n; i++) sum += a[i] = scanner.nextInt(); ...
Main.java:3: error: class AtCoder is public, should be declared in a file named AtCoder.java public class AtCoder { ^ 1 error
s945706501
p03699
C++
#include <iostream> #include <vector> using namespace std; int main(void){ int n; cin >> n; int s[n]; for(int i = 0; i < n; i++) cin >> s[i]; sort(s, s + n); int ans = 0; for(int i = 0; i < n; i++) ans += s[i]; if(ans % 10 != 0) { cout << ans << endl; return 0; } int temp = -1; for(int i ...
a.cc: In function 'int main()': a.cc:10:3: error: 'sort' was not declared in this scope; did you mean 'short'? 10 | sort(s, s + n); | ^~~~ | short
s229448788
p03699
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int s[n]; for(int i=0;i<n;i++){ cin>>s[i];} sort(s,s+n); int max=0; for(int i=0,i<n;i++){ max+=s[i];} int q=99999; if(max%10==0){ for(int j=0;j<n;j++){ if(s[j]%10!=0){ q=j; break;} } if...
a.cc: In function 'int main()': a.cc:16:16: error: expected ';' before '<' token 16 | for(int i=0,i<n;i++){ | ^ | ; a.cc:16:16: error: expected primary-expression before '<' token
s405246372
p03699
C++
#include<iostream> #include<math.h> using namespace std; int main(){ int n; cin >> n; int s[n]; int sum = 0; for(int i=0;i<n;i++){ cin >> s[i]; sum += s[i]; } sort(s,s+n); if(sum%10 == 0){ for(int i=0;i<n;i++){ if(s[i]%10==0)break; else...
a.cc: In function 'int main()': a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 17 | sort(s,s+n); | ^~~~ | sqrt
s703113346
p03699
C++
* 問題をよく読もう! 論理的に考えよう! サンプルを確認しよう! 絶対に諦めるな! 工夫をしろ! 配列は少し多めにとっておく Twitterは終わるまでログアウト! (間違えて解法をツイートしてはいけないから) */ //include #include<iostream> #include<string> #include<algorithm> #include<vector> #include<iomanip> #include<math.h> #include<complex> #include<queue> #include<deque> #include...
a.cc:3:5: error: expected constructor, destructor, or type conversion before '\U00008ad6\U00007406\U00007684\U0000306b\U00008003\U00003048\U00003088\U00003046\U0000ff01' 3 | 論理的に考えよう! | ^~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/io...
s164566041
p03699
C++
//* 問題をよく読もう! 論理的に考えよう! サンプルを確認しよう! 絶対に諦めるな! 工夫をしろ! 配列は少し多めにとっておく Twitterは終わるまでログアウト! (間違えて解法をツイートしてはいけないから) */ //include #include<iostream> #include<string> #include<algorithm> #include<vector> #include<iomanip> #include<math.h> #include<complex> #include<queue> #include<deque> #inclu...
a.cc:2:5: error: '\U0000554f\U0000984c\U00003092\U00003088\U0000304f\U00008aad\U00003082\U00003046\U0000ff01' does not name a type 2 | 問題をよく読もう! | ^~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/includ...
s465780568
p03699
C++
#include <bits/stdc++.h> #define repd(i,a,b) for (int i=(a);i<(b);i++) #define rep(i,n) repd(i,0,n) #define int long long typedef long long ll; using namespace std; const int MOD = 1000000007; const int INF = 1010000000; const double EPS = 1e-10; const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1)...
a.cc: In function 'int main()': a.cc:20:14: error: no matching function for call to 'max(int, long long int)' 20 | cout << max(0, (ans % 10 ? ans : ans - mint)) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/includ...
s927559085
p03699
C++
#include <iostream> using namespace std; typedef long long ll; const int INF = 1000100000; #define rep(i,n) for(int i=0;i<n;++i) int main(){ ll n; cin >>n; int s[n]; int ans=0; rep(i,n){ cin >> s[i]; ans+=s[i]; } sort(s,s+n); if(ans%10!=0)cout << ans << endl; else{ int hiku=0; rep(i,n...
a.cc: In function 'int main()': a.cc:16:3: error: 'sort' was not declared in this scope; did you mean 'short'? 16 | sort(s,s+n); | ^~~~ | short
s535865582
p03699
C++
N=int(input()) s=[int(input()) for i in range(N)] ans=sum(s) s.sort() if ans%10!=0: print(ans) else: for i in range(N): if(ans-s[i])%10!=0: ans-=s[i] break if ans%10==0: print(0) else: print(ans)
a.cc:1:1: error: 'N' does not name a type 1 | N=int(input()) | ^
s963657566
p03699
C++
n=int(input()) s=[int(input()) for i in range(n)] if sum(s)%10!=0: print(sum(s)) else: l=[] for j in range(n): if s[j]%10!=0: l.append(s[j]) if len(l)==0: print(0) else: print(sum(s)-min(l))
a.cc:1:1: error: 'n' does not name a type 1 | n=int(input()) | ^
s439091915
p03699
C++
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().execute(); } public void execute() { Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); int[] score = new int[N]; int grandTotal = 0; for (int i = 0; i < N; i++) { ...
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...
s471836463
p03699
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,array[100],ans=0; vector<int> not10; cin>>n; for(int i=0;i<n;i++){ cin>>array[i]; if(array[i]%10){ not10.push_back(array[i]); } ans+=array[i]; } if(ans%10){ cout<<ans<<enbdl; return 0; } if(not10.size()==0){ ...
a.cc: In function 'int main()': a.cc:16:16: error: 'enbdl' was not declared in this scope 16 | cout<<ans<<enbdl; | ^~~~~
s364790008
p03699
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,sum=0;cin>>n; vector<int> s(n); for(int i=0;i<n;i++){ cin>>s[i]; sum+=s[i]; } sort(s.begin(),s,end()); if(sum%10==0){ for(int i=0;i<n;i++){ sum-=s[i]; if(sum%10!=0) break; sum+=s[i]; } } cout<<sum<<endl; }
a.cc: In function 'int main()': a.cc:10:23: error: no matching function for call to 'end()' 10 | sort(s.begin(),s,end()); | ~~~^~ In file included from /usr/include/c++/14/bits/algorithmfwd.h:39, from /usr/include/c++/14/bits/stl_algo.h:59, from /usr/inclu...
s362309563
p03699
C++
#include<iostream> #include <algorithm> #include<string> #include <bitset> #include <vector> #include <functional> #include <climits> #include <iomanip> #include <utility> #include <stack> using namespace std; using ll = long long; int main() { ll a, b, c = 0, d; cin >> a; ll s[1000]; for (int i = 0; i < a; i++) {...
a.cc: In function 'int main()': a.cc:27:23: error: invalid types 'll {aka long long int}[int]' for array subscript 27 | c += c[i]; | ^
s329923568
p03699
C++
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; int sum = 0; set<int> s; for (int i = 0; i < n; ++i) { int score; cin >> score; s.insert(score); sum += score; } if (sum % 10 != 0) { cout << sum << "\n";...
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::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterato...
s870696647
p03699
C++
#include <iostream> #include <vector> #include <string> #include <sstream> #include <cmath> using namespace std; int main(){ int N; std::vector<int> si; cin >> N; int sum = 0; for(int i=0; i<N; i++){ int temp; cin >> temp; si.push_back(temp); sum += temp; } if(sum%10 != 0){ cout << sum << endl; }...
a.cc: In function 'int main()': a.cc:38:25: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 38 | sort(si.begin(),si.end()); | ^~~~ | sqrt
s577017347
p03699
Java
import java.util.Arrays; import java.util.Scanner; public class Bugged { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] s = new int[n]; int total = 0; for (int i = 0 ; i < n ; i++) { s[i] = sc.nextInt();...
Main.java:4: error: class Bugged is public, should be declared in a file named Bugged.java public class Bugged { ^ 1 error
s425936710
p03699
C++
N = int(raw_input()) ans = 0 for i in range(N): ans += int(raw_input()) if ans % 10 == 0: ans = 0 print ans
a.cc:1:1: error: 'N' does not name a type 1 | N = int(raw_input()) | ^
s834569233
p03699
C++
#include <iostream> #include <bits/stdc++.h> using namespace std; int dp[150][150]; int num[150]; bool cmp(int a,int b) { return a < b; } /* 3 5 10 15 */ int main() { int n; cin >> n; for(int i = 0; i < n; i++) { cin >> num[i]; } sort(num,num+n,cmp); int sum = 0; for(int i = ...
a.cc: In function 'int main()': a.cc:33:25: error: expected primary-expression before '=' token 33 | while(sum%10 = = 0) | ^
s795579272
p03699
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=a;i<b;i++) #define rep(i,b) FOR(i,0,b) #define INF mugen #define dump(x) cerr<<#x<<"="<<x<<endl #define all(a) (a).begin(),(a).end() typedef vector<int> vi; typedef vector<vi> vii; typedef vector<vii> viii; typedef pair<int,int> P; template <cla...
a.cc:18:1: error: expected initializer before 'int' 18 | int s[110]; | ^~~ a.cc: In function 'int main()': a.cc:22:16: error: 's' was not declared in this scope 22 | rep(i,n)cin>>s[i]; | ^ a.cc:24:3: error: 'dp' was not declared in this scope; did you mean 'dup'? 24 | dp[0][0]=1;...
s514141709
p03699
C++
int main(){ int n, i; int m = 0; cin >> n; vector<int> s(n); for( i = 0 ; i < n ; i = i + 1 ){ cin >> s.at(i); m = m + s.at(i); } sort( s.begin...
a.cc: In function 'int main()': a.cc:8:5: error: 'cin' was not declared in this scope 8 | cin >> n; | ^~~ a.cc:10:5: error: 'vector' was not declared in this scope 10 | vector<int> s(n); | ^~~~~~ a.cc:10:12: error: expected primary-expression before 'int' 10 | vector<int> s(n);...
s023800392
p03699
C++
#include<iostream> #include<vector> #include<algorithm> #include<string> #include<cmath> #include<climits> #include<map> #include<set> #include<queue> #include<stack> #include<bitset> #include<iomanip> using namespace std; #define rep(i,j,n) for(int i=(j);i<(n);i++) #define rep2(i,j,n) for(int i=(j);i<=(n);i++) #defin...
In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/includ...
s409018013
p03699
C++
// ------------------------------------ // Date:2018/ 3/25 // Problem:C - Bugged d.cpp // // ------------------------------------ #include <bits/stdc++.h> using namespace std; #define EACH(i,a) for (auto& i : a) #define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i) #define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i) #...
a.cc: In function 'int main()': a.cc:43:18: error: expected ';' before 'i' 43 | for(unsigned ll i = 0ll; i < 1 << N; ++i) { | ^~ | ; a.cc:43:19: error: 'i' was not declared in this scope 43 | for(unsigned ll i = 0ll; i < 1 << N; ++i) { | ^ ...
s810871679
p03699
C++
Copy Copy #include<iostream> #include<algorithm> using namespace std; typedef long long ll; int N; int s[100]; int main(){ cin >> N; for(int i=0; i<N; i++){ cin >> s[i]; } sort(s, s+N); int cum[N]; cum[0] = s[0]; for(int i=1; i<N; i++){ cum[i] = cum[i-1] + s[i]; } ...
a.cc:2:1: error: 'Copy' does not name a type 2 | Copy | ^~~~ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:4: /usr/in...
s740628230
p03699
C++
#include <iostream> using namespace std; int main(){ int N; cin >> N; int s[N],i,ans=0; for(i=0;i<N;i++){ cin >> s[i]; ans+=s[i]; } if(ans%10!=0){ cout << ans << endl; return 0; } sort(s,s+N); for(i=0;i<N;i++)if(s[i]%10 != 0)break; if(i==N){ cout << "0" << endl; return 0; ...
a.cc: In function 'int main()': a.cc:17:3: error: 'sort' was not declared in this scope; did you mean 'short'? 17 | sort(s,s+N); | ^~~~ | short
s115034406
p03699
C++
#include<stdio.h> int main(void) { int n,s[100],i,k,a,x,flg; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&s[i]); a=a+s[i]; } flg=1; if(a%10==0){ flg=0; for(i=0;i<n-1;i++){ for(k=i+1;k<n;k++){ if(s[i]>s[k]){ x=s[i]; s[i]=s[k]; s[k]=x; } } } for(i=0;i<n;i++){ x=a-s[i]; ...
a.cc: In function 'int main()': a.cc:31:29: error: invalid types 'int[int]' for array subscript 31 | if(a[i]%10!=0){ | ^
s372915796
p03699
C
#include <stdio.h> #include <stdlib.h> #include "myfunc.h" int main() { int N, s[100]; scanf("%d", &N); for(int i = 0; i < N; i++){ scanf("%d", &s[i]); } int score = 0; qsort(s, N, sizeof(int), comp_up); for(int i = 0; i < N; i++){ score += s[i]; } if(score % 10 != 0){ printf("%d\n", sco...
main.c:3:10: fatal error: myfunc.h: No such file or directory 3 | #include "myfunc.h" | ^~~~~~~~~~ compilation terminated.
s224989749
p03699
C++
#include <stdio.h> int main() { //変数の宣言と初期化 int n,flg1=0 ; do{ flg1=scanf("%d",&n); }while(1>n||n>100); int t[n]; int score = 0; int x; //iに0を代入、iがnになるまで、iに1を足す for(x=0; x<n ;x++) { //int t[n]; int flg2 = 0; do...
a.cc: In function 'int main()': a.cc:50:12: error: 'y' was not declared in this scope 50 | if(y=n, score % 10 == 0){ | ^
s143272201
p03699
C++
#include <stdio.h> int main() { //変数の宣言と初期化 int n = 0; //n個分のint型配列を用意 scanf("%d",&n); if (n > 100){ return; } int t[n]; int score = 0; int x; //iに0を代入、iがnになるまで、iに1を足す for(x=0; x<n ;x++) { scanf("%d",&t[x]); score = score + t[x]; //printf("score="); //pr...
a.cc: In function 'int main()': a.cc:11:12: error: return-statement with no value, in function returning 'int' [-fpermissive] 11 | return; | ^~~~~~
s082882379
p03699
C++
#include <iostream> using namespace std; int min(int a, int b) { if (a < b)return a; else return b; } int main() { int N; int s[110]; bool check_not10 = false; int all_sum = 0, min_not10 = INT_MAX; cin >> N; for (int i = 1; i <= N; i++) { cin >> s[i]; all_sum += s[i]; if (s[i] % 10 != 0) { min_n...
a.cc: In function 'int main()': a.cc:15:38: error: 'INT_MAX' was not declared in this scope 15 | int all_sum = 0, min_not10 = INT_MAX; | ^~~~~~~ a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1...
s347258497
p03699
C
#include <stdio.h> #include <string.h> int main(){ int Sum=0; int nowMin=10000; int tmp,Num,i; scanf("%d",&Num); for(i=0;i<Num;i++){ scanf("%d",&tmp);//値の取得 if(nowMin>tmp && nowMin%10!=0)nowMin =tmp; Sum+=tmp; } if(nowMin==10000){ nowMin=0; printf("0"); return 0; } if(Sum%10==0){ Sum-=nowMin; } ...
main.c:33:1: error: unterminated comment 33 | /*なるべく小さい下1ケタ0 | ^
s563096991
p03699
Java
import java.util.Scanner; import java.util.Arrays; public class a{ public static void main(String [] args){ int sum=0,k,pos; int array[] = new int[100]; Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i=0;i<n;i++){ array[i] = sc.nextInt(); sum += array[i]; } pos = n-1; for...
Main.java:5: error: class a is public, should be declared in a file named a.java public class a{ ^ 1 error
s612521485
p03699
C
N = int(input()) s = [] for _ in range(N): s.append(int(input())) if sum(s) % 10 != 0: print(sum(s)) else: min_s = 0 sorted_s = sorted(s, reverse=True) for ss in sorted_s: if ss % 10 != 0: min_s = ss if min_s == 0: print(0) else: print(sum(s) - min_s)
main.c:1:1: warning: data definition has no type or storage class 1 | N = int(input()) | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'N' [-Wimplicit-int] main.c:1:5: error: expected expression before 'int' 1 | N = int(input()) | ^~~
s253344211
p03699
C
N = int(input()) s = [] for _ in range(N): s.append(int(input())) if sum(s) % 10 != 0: print(sum(s)) else: min_s = 0 sorted_s = sorted(s, reverse=True) for ss in sorted_s: if ss % 10 != 0: min_s = ss if min_s == 0: print(0) else: print(sum(s) - min_s)
main.c:1:1: warning: data definition has no type or storage class 1 | N = int(input()) | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'N' [-Wimplicit-int] main.c:1:5: error: expected expression before 'int' 1 | N = int(input()) | ^~~
s565409780
p03699
C
N = int(input()) s = [] for _ in range(N): s.append(int(input())) if sum(s) % 10 != 0: print(sum(s)) else: min_s = 0 sorted_s = sorted(s, reverse=True) for ss in sorted_s: if ss % 10 != 0: min_s = ss if min_s == 0: print(0) else: print(sum(s) - min_s)
main.c:1:1: warning: data definition has no type or storage class 1 | N = int(input()) | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'N' [-Wimplicit-int] main.c:1:5: error: expected expression before 'int' 1 | N = int(input()) | ^~~
s976881467
p03699
C++
# -*- coding:utf-8 -*- import sys N = int(input()) Sn = sorted([int(input()) for i in range(N)]) total = sum(Sn) if total % 10 != 0: print(total) sys.exit() else: i = 0 while True: total -= Sn[i] if total % 10 != 0: print(total) sys.exit() print(0)
a.cc:1:3: error: invalid preprocessing directive #- 1 | # -*- coding:utf-8 -*- | ^ a.cc:2:1: error: 'import' does not name a type 2 | import sys | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
s785618077
p03699
Java
import java.util.List; import java.util.ArrayList; import java.util.Scanner; public class C { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int[] point = new int[n]; List<Integer> num = new ArrayList<>(); int sum = 0; for (int i = 0; i < n; i...
Main.java:5: error: class C is public, should be declared in a file named C.java public class C { ^ 1 error
s299642929
p03699
C++
#include <iostream> #include <vector> #include <queue> #include <stack> #include <algorithm> #include <cmath> #include <string> #include <cstring> #include <map> #include <set> #include <bitset> #include <sstream> #include <cstdlib> #include <unordered_map> #include <unordered_set> #include <list> using namespace std; ...
a.cc: In function 'int main()': a.cc:26:25: error: 'INT_MAX' was not declared in this scope 26 | int sum = 0, mini = INT_MAX; | ^~~~~~~ a.cc:17:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 16 | #include <list> +++ ...
s235985142
p03699
C++
#include<iostream> // 入出力 #include<math.h> // 数学の関数 #include<vector> // 配列 #include<string> // 文字列 #include<map> // 連想配列 #include<stack> // スタック #include<queue> // キュー using namespace std; int main() { int n; cin >> n; vector<int> s(n); int value = 0; for (int i = 0; i < n; ++i) { cin >> s[i]; value +=...
a.cc: In function 'int main()': a.cc:25:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 25 | sort(s.begin(), s.end()); | ^~~~ | sqrt
s909264436
p03699
C
#include <stdio.h> #include <string.h> int main(void){ int i,N,sum=0,min=101; int score[100]; scanf("%d",&N); for( i = 0; i < N; i++ ){ scanf("%d",&score[i]); sum += score[i]; if( score[i] < min && score[i] % 10 != 0){ min = s[i]; } } ...
main.c: In function 'main': main.c:15:19: error: 's' undeclared (first use in this function) 15 | min = s[i]; | ^ main.c:15:19: note: each undeclared identifier is reported only once for each function it appears in
s905844854
p03699
C
#include <stdio.h> int main(){ int N,s[100]={},sum,min=100; scanf("%d",&N); for(i=0;i<N;i++){ scanf("%d",&s[i]); sum+= s[i]; if(s[i] % 10 != 0 && min > s[i] )min=s[i]; } if(sum % 10 != 0)printf("%d",sum); else if(sum % 10 == 0 && min % 10 != 0)printf(...
main.c: In function 'main': main.c:9:9: error: 'i' undeclared (first use in this function) 9 | for(i=0;i<N;i++){ | ^ main.c:9:9: note: each undeclared identifier is reported only once for each function it appears in
s628549768
p03699
C++
#include <iostream> #include <vector> #include <algorithm> int main(void){ int N; std::cin >> N; std::vector<int> vec(N); for(int i = 0; i < N; ++i){ std::cin >> vec[i]; } int sum = std::accumulate(vec.begin(), vec.end(), 0); if(sum % 10 == 0){ std::sort(vec.begin(), vec.end()); for(auto i : vec){ if(i % 10 == 0){ c...
a.cc: In function 'int main()': a.cc:13:16: error: 'accumulate' is not a member of 'std' 13 | int sum = std::accumulate(vec.begin(), vec.end(), 0); | ^~~~~~~~~~
s815483812
p03699
C++
#include <iostream> #include <vector> #include <algorithm> int main(void){ int N; std::cin >> N; std::vector<int> vec(N); for(int i = 0; i < N; ++i){ std::cin >> vec[i]; } int sum = std::accumurate(vec.begin(), vec.end(), 0); if(sum % 10 == 0){ std::sort(vec.begin(), vec.end()); for(auto i : vec){ if(i % 10 == 0){ c...
a.cc: In function 'int main()': a.cc:13:16: error: 'accumurate' is not a member of 'std' 13 | int sum = std::accumurate(vec.begin(), vec.end(), 0); | ^~~~~~~~~~
s509444168
p03699
C++
#include <iostream> #include <string> using namespace std; int main(){ int a,b[100],c,min; min=1000; c=0; cin>>a; for(int i=0;i<a;i++){ cin>>b[i]; c=c+b[i]; } if(c%10>0){ cout<<c<<endl; } for(int k=0;k<a;k++){ if(min>a[k] && a[k]%10>0){ min=a[k]; } } if(min==0){ cout<<0<<endl; } cout<<c-min...
a.cc: In function 'int main()': a.cc:18:33: error: invalid types 'int[int]' for array subscript 18 | if(min>a[k] && a[k]%10>0){ | ^ a.cc:18:41: error: invalid types 'int[int]' for array subscript 18 | if(min>a[k] && a[k]%10>0){ ...
s131454356
p03699
C++
#include <iostream> #include <string> using namespace std; int main(){ int a,b[100],c,min; min=0; c=0; cin>>a; for(int i=0;i<a;i++){ cin>>a[i]; c=c+a[i] } if(c%10>0){ cout<<c<<endl; } for(int j=0;j<2;j++){ for(int k=0;k>a;k++){ if(min>a[k] && a[k]%10>0){ min=a[k]; } } } if(min==0){ cout<<0<...
a.cc: In function 'int main()': a.cc:11:23: error: invalid types 'int[int]' for array subscript 11 | cin>>a[i]; | ^ a.cc:12:22: error: invalid types 'int[int]' for array subscript 12 | c=c+a[i] | ^ a.cc:19:33: error: invalid ty...
s432828633
p03699
C
#include<stdio.h> int main(){ int n,m,i,j,N,s[100]; j=0; scanf("%d",&N); for(n=0;n<N;n++){ scanf("%d",&s[n]); } for(m=0;m<N;m++){ i=s[m]%10; j=j+i; } k=j%10; if(k!=0){ printf("%d\n",j); }
main.c: In function 'main': main.c:13:1: error: 'k' undeclared (first use in this function) 13 | k=j%10; | ^ main.c:13:1: note: each undeclared identifier is reported only once for each function it appears in main.c:16:1: error: expected declaration or statement at end of input 16 | } | ^
s384641076
p03699
C++
#include<iostream> using namespace std; int main(){ int n; cin >> n; int s[n]; for(int i=0; i<n; i++) cin >> s[i]; int sum = 0; for(int i=0; i<n; i++) sum += s[i]; sort(s,s+n); if(sum % 10 != 0){ cout << sum << endl; return 0; } for(int i=0; i<n; i++){ if(s[i] % 10 != 0){ ...
a.cc: In function 'int main()': a.cc:16:3: error: 'sort' was not declared in this scope; did you mean 'short'? 16 | sort(s,s+n); | ^~~~ | short
s240062602
p03699
Java
import java.util.*; import java.io.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] marks = new int[n]; int sum = 0; for(int i=0; i<n; i++){ marks[i] = sc.nextInt(); sum += marks[i]; } Arrays.sort(marks); int k = 0;...
Main.java:21: error: ')' expected while(k<marks.length && marks[k]%10 ==0s) k++; ^ Main.java:21: error: ';' expected while(k<marks.length && marks[k]%10 ==0s) k++; ^ 2 errors
s096636274
p03699
C++
#include <iostream> #include <math.h> using namespace std; int main(int argc, const char * argv[]) { short N; cin >> N; short* scores = new short[N]; for (int i = 0; i < N; i++) { cin >> scores[i]; } sort(scores, scores + N); long total = 0; for (int i = 0; i...
a.cc: In function 'int main(int, const char**)': a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 14 | sort(scores, scores + N); | ^~~~ | sqrt
s229666660
p03699
C++
#include<iostream> using namespace std; int main(void) { int n, s[100],tmp,j,S=0,MAX[100],ans; cin >> n; for (int i = 0; i < n; i++) { cin >> s[i]; } for (j = 0; j < n; j++) { for (int i = 0; i < n; i++) { if (s[j] < s[i]) { tmp = s[i]; s[i] = s[j]; s[j] = tmp; } } } for (int...
a.cc: In function 'int main()': a.cc:54:10: error: expected '}' at end of input 54 | } | ^ a.cc:5:16: note: to match this '{' 5 | int main(void) { | ^
s739494321
p03699
C++
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <functional> #include <numeric> #include <limit> int main( void ) { int n; std::cin >> n; std::vector< int > ss; for( size_t i = 0; i < n; ++i ) { int s; std::cin >> s; ss.push_back( s ); ...
a.cc:7:10: fatal error: limit: No such file or directory 7 | #include <limit> | ^~~~~~~ compilation terminated.
s098709538
p03699
C++
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <functional> #include <numeric> #include <limits> int main( void ) { int n; std::cin >> n; std::vector< int > ss; for( size_t i = 0; i < n; ++i ) { int s; std::cin >> s; ss.push_back( s ); ...
a.cc: In function 'int main()': a.cc:29:20: error: 'numelic_limits' is not a member of 'std'; did you mean 'numeric_limits'? 29 | int min = std::numelic_limits<int>::max(); // 番兵 | ^~~~~~~~~~~~~~ | numeric_limits a.cc:29:35: error: expected primary-expression be...
s269111748
p03699
C++
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <functional> int main( void ) { int n; std::cin >> n; std::vector< int > ss; for( size_t i = 0; i < n; ++i ) { int s; std::cin >> s; ss.push_back( s ); } // 結局全てを足したとして、2つのケースしか生じない ...
a.cc: In function 'int main()': a.cc:25:26: error: 'accumulate' is not a member of 'std' 25 | const int sum = std::accumulate( ss.begin(), ss.end(), 0 ); | ^~~~~~~~~~ a.cc:27:20: error: 'numelic_limits' is not a member of 'std' 27 | int min = std::numelic_limits<int>::max();...
s977447565
p03699
C++
#include <iostream> #include <vector> #include <algorithm> #include <string> int main( void ) { int n; std::cin >> n; std::vector< int > ss; for( size_t i = 0; i < n; ++i ) { int s; std::cin >> s; ss.push_back( s ); } // 結局全てを足したとして、2つのケースしか生じない // A: 全合計値は10の倍数では...
a.cc: In function 'int main()': a.cc:24:26: error: 'accumulate' is not a member of 'std' 24 | const int sum = std::accumulate( ss.begin(), ss.end(), 0 ); | ^~~~~~~~~~ a.cc:26:20: error: 'numelic_limits' is not a member of 'std' 26 | int min = std::numelic_limits<int>::max();...
s975498686
p03699
C++
include<iostream> using namespace std; int main(){ int N,a; int min, sum; min = -1; cin>>N; sum = 0; for(int i=0;i<N;i++){ cin>>a; sum += a; if(a%10==0){ continue; } if...
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'min'? 7 | cin>>N; | ^~~ | min a.cc:25:9: error: 'printf' was not declared in this scope ...
s058928924
p03699
C
#include <iostream> #include<bits/stdc++.h> using namespace std; int main() { int n; int sum=0; cin>>n; int a[n]; for(int i=0;i<n;i++){cin>>a[i];sum+=a[i];} if(sum%10!=0){cout<<sum<<endl;return 0;} sort(a,a+n); for(int i=0;i<n;i++){ sum-=a[i]; if(sum%10!=0){ cout<<sum<<endl; return ...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s742261154
p03699
C++
#include <iostream> using namespace std; int map[10001][101]; map[0][0]++; int main(){ int N; cin >>N; int s; for(int i=0;i<N;i++){ cin>>s; for(int j=0;j<10001;j++){ map[j][i+1]=map[j][i]; if(j+s<10001)map[j+s][i+1]=map[j][i]; }} int m=0; for(int i=10000; i>=0;i--){ if(i%10==0)continue; if(map[i][N]==1){ m=i; }} cout <...
a.cc:4:1: error: 'map' does not name a type 4 | map[0][0]++; | ^~~
s718432175
p03699
C
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #include <limits.h> #define inf INT_MAX #define INF 9223372036854775807 #define rep(i,n) for(i=0;i<n;i++) int in(void){ int i;scanf("%d",&i); return i; } long long llin(void){ long long i;scanf("%lld",&i); return i; } void chin(char s[])...
main.c: In function 'main': main.c:43:13: error: invalid operands to binary % (have 'int *' and 'int') 43 | if(s%10!=0){ | ~^ | | | int * main.c:44:23: error: passing argument 1 of 'print' makes integer from pointer without a cast [-Wint-conversion] 44 | ...
s511525418
p03699
C++
#include <iostream> #include <vector> #include <numeric> #include <algorithm> using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<int> v(N), noten; for (int i = 0; i < N; ++i){ cin >> v[i]; } for (int i = 0; i < N; ++i){ if...
a.cc: In function 'int main()': a.cc:26:22: error: no match for 'operator-' (operand types are 'int' and '__gnu_cxx::__normal_iterator<int*, std::vector<int> >') 26 | else cout << sum - min_element(noten.begin(), noten.end()) << endl; | ~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |...
s589985188
p03699
C++
#include <iostream> #include <vector> #include <numeric> #include <algorithm> using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<int> v(N), noten; for (int i = 0; i < N; ++i){ cin >> v[i]; if (v[i] % 10 != 0) noten.push_back(v[i]) ...
a.cc: In function 'int main()': a.cc:16:50: error: expected ';' before '}' token 16 | if (v[i] % 10 != 0) noten.push_back(v[i]) | ^ | ; 17 | } | ~ ...
s445500935
p03699
C++
#include <iostream> #include <vector> #include <numeric> #include <algorithm> using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<int> v(N), noten; for (int i = 0; i < N; ++i){ cin >> v[i]; } for (int i = 0; i< N; ++i){ if ...
a.cc: In function 'int main()': a.cc:19:44: error: expected ';' before '}' token 19 | if (v[i] % 10 != 0) noten[i] = v[i] | ^ | ; 20 | } | ~
s190690152
p03699
C++
#include <iostream> #include <cassert> #include <vector> #include <cmath> #include <ctime> #include <cstdlib> #include <fstream> #include <string> #include <sstream> #include <iterator> #include <map> #include <algorithm> #include <memory> #include <iomanip> #include <limits> #include <typeinfo> #include <stdio.h> #i...
a.cc: In function 'int maxsum3(int*, int, int)': a.cc:35:27: error: no matching function for call to 'max(float, int&)' 35 | return max(0.0f, x[l]); | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/local...
s138906192
p03699
C++
#include <iostream> #include <vector> #include <numeric> using namespace std; int main(){ int N; cin >> N; vector<int> v(N), noten; for (int i = 0; i < N; ++i){ cin >> v[i]; if (v[i] % 10 != 10) noten[i] = v[i]; } sort(noten.begin(), noten.end()); int sum = accumulate(v.be...
a.cc: In function 'int main()': a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'short'? 16 | sort(noten.begin(), noten.end()); | ^~~~ | short
s709795140
p03699
C++
#include <iostream> #include <vector> #include <numeric> using namespace std; int main(){ int N; cin >> N; std::vector<int> v(N), noten(N); for (int i = 0; i < N; ++i){ cin >> v[i]; if (v[i] % 10 != 10) noten[i] = v[i]; } sort(noten.begin(), noten.end()); int sum = accumul...
a.cc: In function 'int main()': a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'short'? 16 | sort(noten.begin(), noten.end()); | ^~~~ | short
s107649465
p03699
C++
#include <iostream> using namespace std; int main() { int N; cin >> N; int S[N-1]; for (int i = 0;i < N;i++){ cin >> S[i]; } sort(S, S + N); int t = 0; for(int c = 0;c < N;c++){ t = t + S[c]; } if(t%10!=0) cout << t <<"\n"; else for(int d = 0;d < N;d++...
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, S + N); | ^~~~ | short
s844138340
p03699
C++
#include <iostream.h> int main(int argc, char *argv[]) { int n; int s[101]; scanf("%d",&n); int i,j,count=0; for(i=0;i<n;i++) { scanf("%d",&s[i]); count+=s[i]; } for( j=0;j<n;j++) { if(count%10==0) { count-=s[j]; if(count==0){ printf("%d",count); } } else { printf("%d",count); ...
a.cc:1:10: fatal error: iostream.h: No such file or directory 1 | #include <iostream.h> | ^~~~~~~~~~~~ compilation terminated.
s413519787
p03699
C
#include <iostream.h> int main(int argc, char *argv[]) { int n; int s[101]; scanf("%d",&n); int i,j,count=0; for(i=0;i<n;i++) { scanf("%d",&s[i]); count+=s[i]; } for( j=0;j<n;j++) { if(count%10==0) { count-=s[j]; if(count==0){ printf("%d",count); } } else { printf("%d",count); ...
main.c:1:10: fatal error: iostream.h: No such file or directory 1 | #include <iostream.h> | ^~~~~~~~~~~~ compilation terminated.
s264984758
p03699
C++
#include<bits/stdc++.h> using namespace std; int a[1000]; int sum; int dp[1000]; int ans[1000]; int main() { int n; scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%d",&a[i]); sum+=a[i]; } sort(a+1,a+1+n); if(sum[i]%10!=0) { printf("%d",sum...
a.cc: In function 'int main()': a.cc:18:12: error: 'i' was not declared in this scope 18 | if(sum[i]%10!=0) | ^
s771170583
p03699
C++
#include <stdio.h> #include <string.h> int main(void) { int N,i,A=0,b=0,j,c=0; scnaf("%d",N); int s[N]; for(i=1;i<=N;i++){ scanf("%d",&s[i-1]); } for(i=1;i<=N;i++){ A+=s[i-1]; } for(j=1;j<=N;j++){ for(i=1;i<=N;i++){ if(s[i-1]>=s[i]){ b=s[i-1]; s[i-1]=s[i]; s[i]=b; } } } if(A%10 != ...
a.cc: In function 'int main()': a.cc:6:9: error: 'scnaf' was not declared in this scope; did you mean 'scanf'? 6 | scnaf("%d",N); | ^~~~~ | scanf
s099797431
p03699
C
#include <stdio.h> int main(void){ int n; int a[100]; int i; int max=0; int min=101; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); if((a[i]%10)!=0)&&(min >a[i])){ min =a[i]; } max=a[i]+max; } if((max%10)!=0) printf("%d",max); else{ max = max -min; printf("%d",max); } return 0; }
main.c: In function 'main': main.c:11:19: error: expected identifier before '(' token 11 | if((a[i]%10)!=0)&&(min >a[i])){ | ^ main.c:11:30: error: expected statement before ')' token 11 | if((a[i]%10)!=0)&&(min >a[i])){ | ^
s154951801
p03699
C++
#include <iostream> #include <algorithm> #include <cstdio> using namespace std; typedef long long ll; int s [101]; int a [1000000000000]; int arrow = 0; int n; int mini = 1000000000; int maxi = 0; void dfs(int sum, int k){ if(k == n) { if(sum % 10 == 0) { a[arrow++] = 0; mini = 0; } else { maxi = max...
/tmp/ccvrzoF5.o: in function `dfs(int, int)': a.cc:(.text+0x10): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccvrzoF5.o a.cc:(.text+0x4d): relocation truncated to fit: R_X86_64_PC32 against symbol `arrow' defined in .bss section in /tmp/ccvrzoF5.o a.cc:(.text+0x56): rel...
s063964890
p03699
C
3 10 10 15
main.c:1:1: error: expected identifier or '(' before numeric constant 1 | 3 | ^
s393724219
p03699
C++
#include <iostream> #include <cstdio> #include <string> #include <vector> using namespace std; int main(int argc, char const *argv[]) { int N; cin>>N; vector<int> s(N); int max=0; int tmp=0; for (size_t i = 0; i < N; i++) { cin>>s[i]; } sort(s.begin(),s.end()); for (size_t i = 0; i < N; i++) { ...
a.cc: In function 'int main(int, const char**)': a.cc:16:3: error: 'sort' was not declared in this scope; did you mean 'short'? 16 | sort(s.begin(),s.end()); | ^~~~ | short
s869630273
p03699
C++
#define fi first #define se second #define mp make_pair #define pb push_back typedef long long ll; typedef pair<int,int> ii; typedef vector<int> vi; int main(){ long int n; cin>>n;long int a[n];long int ans = 0;long int max = 0; for (int i = 0; i < n; i++){ cin>>a[i]; ans += a[i]; } if(ans%10...
a.cc:8:9: error: 'pair' does not name a type 8 | typedef pair<int,int> ii; | ^~~~ a.cc:9:9: error: 'vector' does not name a type 9 | typedef vector<int> vi; | ^~~~~~ a.cc: In function 'int main()': a.cc:12:17: error: 'cin' was not declared in this scope 12 | long int n; cin>>n...
s221842560
p03699
C
#include<stdio.h> #include<stdlib.h> int main(){ int n,s[110],i,sum,temp; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&s[i]); } for(i=0;i<n-1;i++){ for(j=0;j<n-i-1;j++){ if(s[j]>s[j+1]){ temp=s[j]; s[j]=s[j+1]; s[j+1]=temp; temp=s[j]; } } } sum=0; for(i=0;i<n;i++){ sum=sum+s[i]; } i=0; while(sum%10==0){ sum=sum-s[i]; ...
main.c: In function 'main': main.c:10:5: error: 'j' undeclared (first use in this function) 10 | for(j=0;j<n-i-1;j++){ | ^ main.c:10:5: note: each undeclared identifier is reported only once for each function it appears in
s538239344
p03699
Java
public class Main { public static void main(String[] args){ Scanner sc= new Scanner(System.in); int N=sc.nextInt(); int sum=0; int[]arry=new int[N]; for(int i=0;i<N;i++) {arry[i]=sc.nextInt();} for(int i=0;i<N;i++) {sum+=arry[i];} if(sum%10==0) { for(int i=0;i<N;i++) { if ((sum-arry[i])%...
Main.java:3: error: cannot find symbol Scanner sc= new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner sc= new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s295604108
p03699
Java
public class Main { public static void main(String[] args){ Scanner sc= new Scanner(System.in); int N=sc.nextInt(); int sum=0; int[]arry=new int[N]; for(int i=0;i<N;i++) {arry[i]=sc.nextInt();} for(int i=0;i<N;i++) {sum+=arry[i];} if(sum%10==0) { for(int i=0;i<N;i++) { if ((sum-arry[i])%...
Main.java:3: error: cannot find symbol Scanner sc= new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner sc= new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s565475569
p03699
Java
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner stdin = new Scanner(System.in); int k = 0, n = 0; boolean b = true; n = stdin.nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = stdin.nextInt(); k = k + a[i]; ...
Main.java:36: error: reached end of file while parsing } ^ 1 error
s851141665
p03699
Java
import com.sun.tools.hat.internal.util.ArraySorter; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int total = 0; int[] ans = new int[n]; for (int ...
Main.java:1: error: package com.sun.tools.hat.internal.util does not exist import com.sun.tools.hat.internal.util.ArraySorter; ^ 1 error
s190762701
p03699
C++
#include <stdio.h> #include<bits/stdc++.h> int main() { int N; int i; scanf("%d",&N); int a[105]={0}; int sum=0; for(i=1;i<=N;i++){ scanf("%d",&a[i]); sum+=a[i]; } sort(a,a+N); for(i=1;i<=N;i++){ if(sum%10==0) sum-=a[i]; else if(sum%10!=0&&sum>=0) pri...
a.cc: In function 'int main()': a.cc:15:4: error: 'sort' was not declared in this scope; did you mean 'std::sort'? 15 | sort(a,a+N); | ^~~~ | std::sort In file included from /usr/include/c++/14/algorithm:86, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s332919929
p03699
C++
#include<bits/stdc++.h> using namespace std; int main () { int a[200],n; cin>>n; for(int i=0;i<n;i++) cin>>a[i]; sort(a,a+n); int sum=0; for(int i=n-1;i>=0;i--){ if((sum+a[0])%10) sum+=a[i]; } cout<<sum<<endl; return 0; } `
a.cc:21:1: error: stray '`' in program 21 | ` | ^
s790671930
p03699
C++
#include <stdio.h> #include <stdlib.h> int main(void){ int quest; int *dat; int sum = 0; int min = 150; scanf("%d",&quest); dat = malloc(sizeof(int) * quest); int i; for(i = 0; i < quest;i++){ scanf("%d",&dat[i]); sum += dat[i]; if(dat[i] < min && dat[i] % 10 != 0){ min = dat[i]; ...
a.cc: In function 'int main()': a.cc:12:15: error: invalid conversion from 'void*' to 'int*' [-fpermissive] 12 | dat = malloc(sizeof(int) * quest); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~ | | | void*
s625804834
p03699
C++
#include<iostream> using namespace std; void masatoy(int [101],int,int); int sum1 = 0, sum2 = 0; int max = 0, n; int main() { int a[101]={0}; cin >> n; for (int i = 0; i < n; i++) { cin >> a[i]; } masatoy(a, 0, 0); cout << max << endl; } void masatoy(int b[101],int wa,int i) { if (wa % 10 != 0 && wa > max) { ...
a.cc: In function 'int main()': a.cc:13:17: error: reference to 'max' is ambiguous 13 | cout << max << endl; | ^~~ 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_...
s816162102
p03699
C
#include<stdio.h> #include<stdlib.h> #include<bits/stdc++.h> #include<algorithm> using namespace std; int main() { int n,i,j; scanf("%d",&n); int m[n]; for(i=0;i<n;i++) { scanf("%d",&m[i]); } sort(m,m+n); int res=0; for(j=n-1;j>=0;j--) { if((res+m[j])%10!=0) { res=res+m[j]; } } printf("%d\n"...
main.c:3:9: fatal error: bits/stdc++.h: No such file or directory 3 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s782556264
p03699
C
#include<stdio.h> #include<algorithm> using namespace std; int num[101]; int main(){ int n,i; while(scanf("%d",&n)!=EOF){ int sum=0,s=0; for(i=0;i<n;i++){ scanf("%d",&num[i]); sum+=num[i]; } sort(num,num+n); while(sum%10==0){ sum-=num[s++]; if(s==n) break; } printf("%d\n",sum); } retur...
main.c:2:9: fatal error: algorithm: No such file or directory 2 | #include<algorithm> | ^~~~~~~~~~~ compilation terminated.
s876216478
p03699
C++
#include <stdio.h> #include <stdlib.h> int main(void) { int n; scanf("%d", &n); int s, sum = 0, min = 100; for (int i = 0; i < n; ++i){ scanf("%d", &s); sum += s; if (s % 10 && min > s ) min = s; } if (sum % 10) printf("%d\n", sum); else{ ...
a.cc:20:24: error: stray '\' in program 20 | printf("%d"\n, sum - min); | ^ a.cc: In function 'int main()': a.cc:20:24: error: expected ')' before 'n' 20 | printf("%d"\n, sum - min); | ~ ^~ | )
s018668939
p03699
C
#include <stdio.h> int main(){ int n, i, sum, s[150]; scanf("%d", &n); for (i=0;i<n;i++) { scanf("%d", &s[i]); sum+=s[i]; } i=0; while(1){ if(sum%10!=0||sum==0){ break; }else{ sum-=s[i]; i++; } printf("%d\n", sum); return 0; }
main.c: In function 'main': main.c:22:1: error: expected declaration or statement at end of input 22 | } | ^
s238982747
p03699
C++
#include <stdio.h> int bezero(int n) { if(n%10==0)return 0; return n; } int max(int N,int s[N]) { int sum=0; int max=-114514; for(int i=0;i<N;i++) sum+=s[i]; if(bezero(sum)!=0)return sum; for(int i=0;i<N;i++) { int x=bezero(sum-s[i]); if(max<x) max=x; } return max; } int main(void) { int N; scan...
a.cc:9:22: error: use of parameter outside function body before ']' token 9 | int max(int N,int s[N]) | ^ a.cc: In function 'int max(...)': a.cc:13:23: error: 'N' was not declared in this scope 13 | for(int i=0;i<N;i++) | ^ a.cc:14:22: error: 's' was...
s887187699
p03699
C++
/*input 3 10 20 30 */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define MOD 1000000007 #define MODSET(d) if ((d) >= MOD) d %= MOD; #define MODNEGSET(d) if ((d) < 0) d = ((d % MOD) + MOD) % MOD; #define MODADDSET(d) if ((d) >= MOD) d -= MOD; #define MODADDWH...
a.cc: In function 'int main()': a.cc:460:5: error: redeclaration of 'int n' 460 | int n=100; | ^ a.cc:226:13: note: 'int n' previously declared here 226 | int n; | ^ a.cc:461:43: error: a function-definition is not allowed here before '{' token 461 | int inc_exe(int idx=0,int d...
s081396466
p03699
C
#include <stdio.h> int main(){ int n, i, sum, s[150]; scanf("%d", %n); for (i=0;i<n;i++) { scanf("%d", s[i]); sum+=s[i]; } i=0; while(1){ if(sum%10!=0){ break; }else{ sum-=s[i]; i++; } } printf("%d\n", sum); return 0; }
main.c: In function 'main': main.c:5:15: error: expected expression before '%' token 5 | scanf("%d", %n); | ^