submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s178666741
p03698
C++
int s_len; int s_judge = 0; scanf("%s", s); s_len = strlen(s); if (2 <= s_len && s_len <= 26) { for (int i = 0; i < s_len; i++) { for (int j = i + 1; j < s_len; j++) { if (s[i] == s[j]) { printf("no\n"); s_judge = 1; break; } } if (s_judge == 1) { break; } } if(s_judge == 0) { printf("yes\n"); } } }
a.cc:4:14: error: expected constructor, destructor, or type conversion before '(' token 4 | scanf("%s", s); | ^ a.cc:6:9: error: 's_len' does not name a type 6 | s_len = strlen(s); | ^~~~~ a.cc:8:9: error: expected unqualified-id before 'if' 8 | if (2 <= s_len && s_len <= 26) { | ^~ a.cc:25:1: error: expected declaration before '}' token 25 | } | ^
s705793809
p03698
C++
#include<stdio.h> #include<string.h> int main() { char s[26]; int i,n,f=0; gets(s); n=strlen(s); for(i=0;i<n;i++) { if(s[i]==s[i+1]) f++; } if(f>=1) printf("no"); else printf("yes"); }
a.cc: In function 'int main()': a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(s); | ^~~~ | getw
s380463603
p03698
C++
#include <stdio.h> #include <string> #include <iostream> #include <algorithm> #include <vector> using namespace std; int n, a, b; int main(void) { bool ok = true; cin >> s; for (int i = 0; i < s.length(); i++) { int tmp = s[i] - 'a'; if (a[tmp]) { ok = false; break; } a[tmp]++; } if (ok) printf("yes\n"); else printf("no\n"); return false; }
a.cc: In function 'int main()': a.cc:14:16: error: 's' was not declared in this scope 14 | cin >> s; | ^ a.cc:19:22: error: invalid types 'int[int]' for array subscript 19 | if (a[tmp]) | ^ a.cc:24:18: error: invalid types 'int[int]' for array subscript 24 | a[tmp]++; | ^
s934690894
p03698
C++
#include<stdio.h> #include<string.h> int main() { char s[30]; int n,f=0; gets(s); n=strlen(s); for(i=0;i<n;i++) { if(s[i]==s[i+1]) f++; } if(f>=1) printf("no"); else printf("yes"); }
a.cc: In function 'int main()': a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(s); | ^~~~ | getw a.cc:9:13: error: 'i' was not declared in this scope 9 | for(i=0;i<n;i++) | ^
s673651799
p03698
C++
#include<stdio.h> #include<string.h> int main() { char s[30]; int i,n,f=0; gets(s); n=strlen(s); for(i=0;i<n;i++) { if(s[i]==s[i+1]) f++; } if(f>=1) printf("no"); else printf("yes"); }
a.cc: In function 'int main()': a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(s); | ^~~~ | getw
s591294655
p03698
C++
#include<stdio.h> #include<string.h> int main() { char s[100]; int i,n,f=0; gets(s); n=strlen(s); for(i=0;i<n;i++) { if(s[i]==s[i+1]) f++; } if(f>=1) printf("no"); else printf("yes"); }
a.cc: In function 'int main()': a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(s); | ^~~~ | getw
s823044415
p03698
C++
#include<stdio.h> #include<string.h> char s[100]; int S[55]; int main(){ gets(s); int flag; int t = strlen(s); for(int i = 0;i < t;i++){ if(s[i]=='a') S[0]++; if(s[i]=='b') S[1]++; if(s[i]=='c') S[2]++; if(s[i]=='d') S[3]++; if(s[i]=='e') S[4]++; if(s[i]=='f') S[5]++; if(s[i]=='g') S[6]++; if(s[i]=='h') S[7]++; if(s[i]=='i') S[8]++; if(s[i]=='j') S[9]++; if(s[i]=='k') S[10]++; if(s[i]=='l') S[11]++; if(s[i]=='m') S[12]++; if(s[i]=='n') S[13]++; if(s[i]=='o') S[14]++; if(s[i]=='p') S[15]++; if(s[i]=='q') S[16]++; if(s[i]=='r') S[17]++; if(s[i]=='s') S[18]++; if(s[i]=='t') S[19]++; if(s[i]=='u') S[20]++; if(s[i]=='v') S[21]++; if(s[i]=='w') S[22]++; if(s[i]=='x') S[23]++; if(s[i]=='y') S[24]++; if(s[i]=='z') S[25]++; if(s[i]=='A') S[26]++; if(s[i]=='B') S[27]++; if(s[i]=='C') S[28]++; if(s[i]=='D') S[29]++; if(s[i]=='E') S[30]++; if(s[i]=='F') S[31]++; if(s[i]=='G') S[32]++; if(s[i]=='H') S[33]++; if(s[i]=='I') S[34]++; if(s[i]=='J') S[35]++; if(s[i]=='K') S[36]++; if(s[i]=='L') S[37]++; if(s[i]=='M') S[38]++; if(s[i]=='N') S[39]++; if(s[i]=='O') S[40]++; if(s[i]=='P') S[41]++; if(s[i]=='Q') S[42]++; if(s[i]=='R') S[43]++; if(s[i]=='S') S[44]++; if(s[i]=='T') S[45]++; if(s[i]=='U') S[46]++; if(s[i]=='V') S[47]++; if(s[i]=='W') S[48]++; if(s[i]=='X') S[49]++; if(s[i]=='Y') S[50]++; if(s[i]=='Z') S[51]++; } for(int j = 0;j <= 51;j++){ if(S[j]>1){ flag = 1; printf("no\n"); break; } else{ flag = 0; } } if(flag == 0){ printf("yes\n"); } }
a.cc: In function 'int main()': a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(s); | ^~~~ | getw
s315181986
p03698
C++
#include <iostream> #include <string> #include <vector> using namespace std; void main() { string s; cin >> s; for (int target = 0; target < s.size(); target++) { char c = s[target]; for (int watched = 0; watched < s.size(); watched++) { char cc = s[watched]; if (target != watched && c == cc) { cout << "No"; return; } } } cout << "Yes"; }
a.cc:6:1: error: '::main' must return 'int' 6 | void main() { | ^~~~ a.cc: In function 'int main()': a.cc:16:33: error: return-statement with no value, in function returning 'int' [-fpermissive] 16 | return; | ^~~~~~
s759521373
p03698
C++
#include<stdio.h> #include<string.h> #include<algorithm> using namespace std; char s[100]; int S[55]; int main(){ gets(s); int flag; int t = strlen(s); for(int i = 0;i < t;i++){ if(s[i]=='a') S[0]++; if(s[i]=='b') S[1]++; if(s[i]=='c') S[2]++; if(s[i]=='d') S[3]++; if(s[i]=='e') S[4]++; if(s[i]=='f') S[5]++; if(s[i]=='g') S[6]++; if(s[i]=='h') S[7]++; if(s[i]=='i') S[8]++; if(s[i]=='j') S[9]++; if(s[i]=='k') S[10]++; if(s[i]=='l') S[11]++; if(s[i]=='m') S[12]++; if(s[i]=='n') S[13]++; if(s[i]=='o') S[14]++; if(s[i]=='p') S[15]++; if(s[i]=='q') S[16]++; if(s[i]=='r') S[17]++; if(s[i]=='s') S[18]++; if(s[i]=='t') S[19]++; if(s[i]=='u') S[20]++; if(s[i]=='v') S[21]++; if(s[i]=='w') S[22]++; if(s[i]=='x') S[23]++; if(s[i]=='y') S[24]++; if(s[i]=='z') S[25]++; if(s[i]=='A') S[26]++; if(s[i]=='B') S[27]++; if(s[i]=='C') S[28]++; if(s[i]=='D') S[29]++; if(s[i]=='E') S[30]++; if(s[i]=='F') S[31]++; if(s[i]=='G') S[32]++; if(s[i]=='H') S[33]++; if(s[i]=='I') S[34]++; if(s[i]=='J') S[35]++; if(s[i]=='K') S[36]++; if(s[i]=='L') S[37]++; if(s[i]=='M') S[38]++; if(s[i]=='N') S[39]++; if(s[i]=='O') S[40]++; if(s[i]=='P') S[41]++; if(s[i]=='Q') S[42]++; if(s[i]=='R') S[43]++; if(s[i]=='S') S[44]++; if(s[i]=='T') S[45]++; if(s[i]=='U') S[46]++; if(s[i]=='V') S[47]++; if(s[i]=='W') S[48]++; if(s[i]=='X') S[49]++; if(s[i]=='Y') S[50]++; if(s[i]=='Z') S[51]++; } for(int j = 0;j <= 51;j++){ if(S[j]>1){ flag = 1; printf("no\n"); break; } else{ flag = 0; } } if(flag == 0){ printf("yes\n"); } }
a.cc: In function 'int main()': a.cc:8:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 8 | gets(s); | ^~~~ | getw
s532603482
p03698
C++
#include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> using namespace std; char cc[30]; int main() { int p; gets(cc); for (int i=0; i<=strlen(cc)-2; i++) { for (int j=i+1; j<=strlen(cc)-1; j++) { if (cc[i]==cc[j]) { p=21; break; } } if (p==21) break; } if (p==21) cout<<"no"; else cout<<"yes"; }
a.cc: In function 'int main()': a.cc:10:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 10 | gets(cc); | ^~~~ | getw
s990237397
p03698
C++
#include <stdio.h> #include <string.h> int main() { char count[30]; char str[30];; while(gets(str)){ memset(count,0,sizeof(count)); int len=(int)strlen(str); for(int i=0;i<len;i++){ count[str[i]-'A']++; } for(int i=0;i<=57;i++) if(count[i]){ if (count[i] != 1) { printf("no\n"); return 0; } } printf("yes"); } }
a.cc: In function 'int main()': a.cc:7:11: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | while(gets(str)){ | ^~~~ | getw
s103878903
p03698
C++
#include <stdio.h> #include <string.h> int main() { char count[100]; char str[1024]; while(gets(str)){ memset(count,0,sizeof(count)); int len=(int)strlen(str); for(int i=0;i<len;i++){ count[str[i]-'A']++; } for(int i=0;i<=57;i++) if(count[i]){ if (count[i] != 1) { printf("no\n"); return 0; } } printf("yes"); } }
a.cc: In function 'int main()': a.cc:7:11: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | while(gets(str)){ | ^~~~ | getw
s017804068
p03698
C++
#include<stdio.h> #include<string.h> int main() { char s[27];int i,l,j,k=1; gets(s); l=strlen(s); for(i=0;i<l-1;i++) {for(j=i+1;j<l;j++) { if(s[i]==s[j])k=0; } } if(k==1)printf("yes"); else printf("no"); }
a.cc: In function 'int main()': a.cc:6:1: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(s); | ^~~~ | getw
s297022944
p03698
C++
#include<stdio.h> #include<string.h> int main() { char s[27];int i,l,j,k=1; gets(s); l=strlen(s); for(i=0;i<l-1;i++) {for(j=i+1;j<l;j++) { if(s[i]==s[j])k=0; } } if(k=1)printf("yes"); else printf("no"); }
a.cc: In function 'int main()': a.cc:6:1: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(s); | ^~~~ | getw
s330105789
p03698
C++
#include<stdio.h> #include<string.h> int main() { char s[27];int i,l,j,k=1; gets(s); l=strlen(s); for(i=0;i<l-1;i++) {for(j=i+1;j<l;j++) { if(s[i]==s[j])k=0; } } if(k)printf("yes"); else printf("no"); }
a.cc: In function 'int main()': a.cc:6:1: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(s); | ^~~~ | getw
s319343739
p03698
C++
#include<stdio.h> #include<string.h> int main() { char s[27];int i,l,j,k=1; gets(s); l=strlen(s); for(i=0;i<l-1;i++) {for(j=i+1;j<l;j++) { if(s[i]==s[j])k=0; } } if(k)printf("yes"); else printf("no"); }
a.cc: In function 'int main()': a.cc:6:1: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(s); | ^~~~ | getw
s145429708
p03698
C++
#include <stdio.h> #include <string.h> int main () { int n,j,k,i,l; char a[100]; gets(a); n=strlen(a)-1; for(i=0;i<n;i++) for(j=0;j<n-i;j++) {if(a[i]==a[j])printf("yes"); else printf("no");} }
a.cc: In function 'int main()': a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(a); | ^~~~ | getw
s761230323
p03698
C++
#include <stdio.h> #include <string.h> bool cnt[128] = {0}; int main(void) { bool flag = false; char str[32]; gets(str); for (int i = 0; i < 32; i++) { if (str[i] == '\0') break; if (cnt[str[i]]) { flag = true; break; } else cnt[str[i]] = true; } if (flag) printf("no\n"); else printf("yes\n"); return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 10 | gets(str); | ^~~~ | getw
s395341739
p03698
C
#include <stdio.h> int main(){ int i, j, out=0; char s[30]; scanf("%s", s); for(i=0;s[i]!='¥0';i++){ for(j=1;s[j]!='¥0'j++){ if(s[i]==s[j]){ out=1; } } } if(out==1){ printf("no\n"); }else if(out==0){ printf("yes\n"); } return 0; }
main.c: In function 'main': main.c:7:17: warning: multi-character character constant [-Wmultichar] 7 | for(i=0;s[i]!='¥0';i++){ | ^~~~ main.c:8:19: warning: multi-character character constant [-Wmultichar] 8 | for(j=1;s[j]!='¥0'j++){ | ^~~~ main.c:8:23: error: expected ';' before 'j' 8 | for(j=1;s[j]!='¥0'j++){ | ^ | ;
s562714506
p03698
C++
#include<stdio.h> #include<string.h> int main() { char a[26];int i,t=0; gets(a); for(i=0;i<strlen(a);i++) { if(a[i]==a[i+1]) t=1; } if(t==1) printf("no"); else printf("yes"); }
a.cc: In function 'int main()': a.cc:6:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(a); | ^~~~ | getw
s689932584
p03698
C++
#include<stdio.h> #include<string.h> int main() { char a[100];int i,j,t=0; gets(a); for(i=0;i<strlen(a);i++) { if(a[i]==a[i+1]) t=1; } if(t==1) printf("no"); else printf("yes"); }
a.cc: In function 'int main()': a.cc:6:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(a); | ^~~~ | getw
s514043286
p03698
C++
#include<map> #include<cmath> #include<queue> #include<cstdio> #include<string> #include<cstring> #include<iostream> #include<algorithm> using namespace std; char s[30]; map<char,int>q; int main() { gets(s); int len=strlen(s); for(int i=0;i<len;i++) { if(q[s[i]]==0)q[s[i]]=1; else { printf("no"); exit(0); } } printf("yes"); return 0; }
a.cc: In function 'int main()': a.cc:16:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 16 | gets(s); | ^~~~ | getw
s187873093
p03698
C++
#include<stdio.h> #include<string.h> int num[200]; int main(){ char a[50]; while(gets(a)){ memset(num,0,sizeof(num)); int s=strlen(a),i,g; for(i=0;i<s;i++){ g=a[i]-'a'; num[g]++; } int flag=0; for(i=0;i<=26;i++){ if(num[i]>1){ flag=1; break; } } if(flag==0) printf("yes\n"); else printf("no\n"); } return 0; }
a.cc: In function 'int main()': a.cc:6:15: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | while(gets(a)){ | ^~~~ | getw
s006603325
p03698
C++
#include<stdio.h> int main() { char s[27]; int t,t1; gets(s); for(t=0;s[t]!='\0';t++) { for(t1=t+1;s[t1]!='\0';t1++) { if(s[t] == s[t1]) { printf("no\n"); return 0; } } } printf("yes\n"); return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(s); | ^~~~ | getw
s970727049
p03698
C++
// {{{ #include<vector> #include<list> #include<set> #include<map> #include<queue> #include<deque> #include<stack> #include<bitset> #include<algorithm> #include<functional> #include<numeric> #include<utility> #include<sstream> #include<iostream> #include<iomanip> #include<cstdio> #include<cstdlib> #include<cmath> #include<cctype> #include<string> // }}} /* {{{ #include<cstring> #include<ctime> #include<ncurses.h> #include<tuple> }}} */ using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); string s; cin >> s; int counter[27] = {0}; for(int i = 0; i < s.length; ++i) counter[s[i] - 'a']++; int no = false; for(int i = 0; i < sizeof(counter)/sizeof(*counter); ++i) if( counter[i] > 1 ) no = true; cout << no? "no": "yes" << endl; return 0; }
a.cc: In function 'int main()': a.cc:37:24: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 37 | for(int i = 0; i < s.length; ++i) | ~~^~~~~~ | () a.cc:43:27: error: invalid operands of types 'const char [4]' and '<unresolved overloaded function type>' to binary 'operator<<' 43 | cout << no? "no": "yes" << endl; | ~~~~~~^~~~~~~
s792777195
p03698
C++
#include <iostream> #include <string> #include <string.h> using namespace std; int main(){ string str; cin >> str; for(int i = 0; i < str.size(); i++){ if(strstr(str, str[i]) != NULL){ cout << "yes"; }else{ cout << "no"; } } }
a.cc: In function 'int main()': a.cc:9:14: error: no matching function for call to 'strstr(std::string&, __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)' 9 | if(strstr(str, str[i]) != NULL){ | ~~~~~~^~~~~~~~~~~~~ In file included from a.cc:3: /usr/include/string.h:330:14: note: candidate: 'char* strstr(char*, const char*)' 330 | extern char *strstr (char *__haystack, const char *__needle) | ^~~~~~ /usr/include/string.h:330:28: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char*' 330 | extern char *strstr (char *__haystack, const char *__needle) | ~~~~~~^~~~~~~~~~ /usr/include/string.h:332:20: note: candidate: 'const char* strstr(const char*, const char*)' 332 | extern const char *strstr (const char *__haystack, const char *__needle) | ^~~~~~ /usr/include/string.h:332:40: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*' 332 | extern const char *strstr (const char *__haystack, const char *__needle) | ~~~~~~~~~~~~^~~~~~~~~~
s600895659
p03699
C++
#include <bits/stdc++.h> #define ln "\n" #define SORT(X) sort(X.begin(), X.end()) #define SORTi(X) sort(X.begin(), X.end(), greater<ll>()) #define REP(x, a, b) for (auto x = a; x <= b; x++) #define REPi(x, b, a) for (auto x = b; x >= a; x--) #define REPit(x, A) for (auto x = A.begin(); x != A.end(); x++) #define REPr(x, A) for (auto x : A) #define ll long long #define ull unsigned long long #define PB push_back #define EB emplace_back #define UMP unordered_map #define UST unordered_set using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); ll N = 0; cin >> N; ll sum = 0; vector<ll> A(N); REP(i, 0, N - 1) { cin >> A[i]; sum = sum + A[i]; } SORT(A); if (sum % 10 == 0) { REP(i, 0, N-1) { if (A[i] % 10 != 0) { sum = sum - A[i]; cout<<sum; return; } } } if (sum % 10 == 0) cout << 0 << ln; else cout << sum << ln; return 0; }
a.cc: In function 'int main()': a.cc:42:17: error: return-statement with no value, in function returning 'int' [-fpermissive] 42 | return; | ^~~~~~
s642683213
p03699
C++
#include<bits/stdc++.h> #include<atcoder/all> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using namespace atcoder; using ll = long long; using p = pair<int,int>; const long long INF = 1ll << 60; int main() { int N; cin >> N; int haiten[N]; rep(i,N){ cin >> haiten[i]; } ll ans = 0; rep(bit,(1<<N)){ ll sum = 0; rep(i,N){ if (bit & (1<<i)) sum += haiten[i]; } if (sum%10 == 0) sum = 0; ans = max(ans,sum); } cout << ans << endl; return 0; }
a.cc:2:9: fatal error: atcoder/all: No such file or directory 2 | #include<atcoder/all> | ^~~~~~~~~~~~~ compilation terminated.
s061705966
p03699
C++
#include <iostream> #include <vector> #incldue <algorithm> using namespace std; int main(void){ int n; cin>>n; vector<int>data(n); for(int i=0;i<n;i++){ cin>>data.at(i); } sort(data.begin(),data.end()); int ans=0; for(int i=0;i<n;i++){ ans+=data.at(i); } if(ans%10==0){ for(int i=0;i<n;i++){ if(ans-data.at(i)%10!=0){ ans-=data.at(i); break; } } } if(ans%10!=0)cout<<ans<<endl; else cout<<'0'<<endl; return 0; }
a.cc:3:2: error: invalid preprocessing directive #incldue; did you mean #include? 3 | #incldue <algorithm> | ^~~~~~~ | include a.cc: In function 'int main()': a.cc:15:3: error: 'sort' was not declared in this scope; did you mean 'short'? 15 | sort(data.begin(),data.end()); | ^~~~ | short
s335954613
p03699
C++
#include<bits/stdc++.h> #define int long long /* #define double long double */ #define rep(i, n) for(int i = 0; i < (int)n; i++) #define repa(i, s, n) for(int i = s; i < (int)n; i++) #define MOD 1000000007 using namespace std; using ll = long long; typedef vector<int> vi; typedef pair<int, int> P; #define rrep(i,a,b) for(int i=a;i>=b;i--) template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } signed main(){ int n; cin >> n; vi s(n); rep(i, n){ cin >> s[i]; } sort(s.begin(), s.end()); int ans = 0; rep(i, n){ ans += s[i]; /* cout << s[i] << endl; */ } int idx = 0; while(ans % 10 == 0){ ans -= s[idx++]; } cout << max(ans, 0) << endl; }
a.cc: In function 'int main()': a.cc:32:16: error: no matching function for call to 'max(long long int&, int)' 32 | cout << max(ans, 0) << endl; | ~~~^~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:32:16: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 32 | cout << max(ans, 0) << endl; | ~~~^~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:32:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 32 | cout << max(ans, 0) << endl; | ~~~^~~~~~~~
s544624409
p03699
C
//main関数は一番下にあります #include "bits/stdc++.h" #define rep(i, j) for (int i = 0; i < j; i++) #define srep(i, j, k) for (int i = j; i < k; i++) using namespace std; using ll = long long; using vll = vector<ll>; using vi = vector<int>; using vi2 = vector<vi>; using vl2 = vector<vll>; using vb = vector<bool>; using S = string; using vs = vector<string>; using P = pair<int, int>; using pl = pair<ll, int>; using pqp = priority_queue<P, vector<P>, greater<P> >; using pqpl = priority_queue<pl, vector<pl>, greater<pl> >; using vp = vector<P>; using vb = vector<bool>; using ull = unsigned long long; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } const int INF = 1001001001; const ll LINF = 1001002003004005006ll; #define dame { puts("-1"); return 0;} #define yn {puts("Yes");}else{puts("No");} //mint用の定数 (10の9乗 + 7) const int mod = 1000000007; struct mint { ll x; // typedef long long ll; mint(ll x = 0) :x((x% mod + mod) % mod) {} mint operator-() const { return mint(-x); } mint& operator+=(const mint a) { if ((x += a.x) >= mod) x -= mod; return *this; } mint& operator-=(const mint a) { if ((x += mod - a.x) >= mod) x -= mod; return *this; } mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this; } mint operator+(const mint a) const { return mint(*this) += a; } mint operator-(const mint a) const { return mint(*this) -= a; } mint operator*(const mint a) const { return mint(*this) *= a; } mint pow(ll t) const { if (!t) return 1; mint a = pow(t >> 1); a *= a; if (t & 1) a *= *this; return a; } // for prime mod mint inv() const { return pow(mod - 2); } mint& operator/=(const mint a) { return *this *= a.inv(); } mint operator/(const mint a) const { return mint(*this) /= a; } }; istream& operator>>(istream& is, mint& a) { return is >> a.x; } ostream& operator<<(ostream& os, const mint& a) { return os << a.x; } struct combination { vector<mint> fact, ifact; combination(int n) :fact(n + 1), ifact(n + 1) { assert(n < mod); fact[0] = 1; for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i; ifact[n] = fact[n].inv(); for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i; } mint operator()(int n, int k) { if (k < 0 || k > n) return 0; return fact[n] * ifact[k] * ifact[n - k]; } mint p(int n, int k) { return fact[n] * ifact[n - k]; } } c(1000005); struct UF { //自身が親であれば、その集合に属する頂点数に-1を掛けたもの //そうでなければ親のid vector<int> r; UF(int N) { r = vector<int>(N, -1); } int root(int x) { if (r[x] < 0) return x; return r[x] = root(r[x]); } bool same(int x, int y) { return root(x) == root(y); } bool unite(int x, int y) { x = root(x); y = root(y); if (x == y) return false; if (r[x] > r[y]) swap(x, y); r[x] += r[y]; r[y] = x; return true; } int size(int x) { return -r[root(x)]; } }; //エラトステネスの篩 vector<int> sosuu(100001); vector<int> estora(vector<int> num) { int sel = 0; while (sel < num.size()) { int d = num[sel]; for (int i = 0; i < num.size(); i++) { if (num[i] % d == 0 && num[i] != d && d != 1) { num.erase(num.begin() + i); i--; } } sel++; } rep(i, num.size()) { sosuu[num[i]] = 1; } return num; } /*ライブラリ最大公約数*/ //ユーグリッドの互除法 int gcd(int x, int y) { int num[3]; num[0] = (x > y) ? x : y; num[1] = (x <= y) ? x : y; num[2] = num[0] % num[1]; while (num[2]) { num[0] = num[1]; num[1] = num[2]; num[2] = num[0] % num[1]; } return num[1]; } /*素因数分解*/ //自作ライブラリ //iを常に素数にしておかないとうまくできない&&計算量ヤバイ //エストラネスの篩で素数を振るっておく必要性がありそう vector<P> fac(ll n, ll youso) { ll ans = 1; ll kazu = n; vector<P> num(0); for (int i = 2; i <= sqrt(n); i++) { P kari; kari.first = i; int kai = 0; while (1) { if (kazu % i != 0) break; kazu /= i; kari.second++; kai++; } ans *= pow(i, kai / youso); if (kari.second != 0) num.emplace_back(kari); } if (n != 1) num.emplace_back(P(kazu, 1)); return num; /*int ans = 0; if (kazu != 1) ans++; for (int i = 2; i <= sqrt(n); i++) { for (int j = 1; j <= num[i]; j++) { num[i] -= j; ans++; } }*/ return num; } bool IsPrime(int num) { if (num < 2) return false; else if (num == 2) return true; else if (num % 2 == 0) return false; // 偶数はあらかじめ除く double sqrtNum = sqrt(num); for (int i = 3; i <= sqrtNum; i += 2) { if (num % i == 0) { // 素数ではない return false; } } // 素数である return true; } mint pow_kai(int a, int n) {//aのn乗を計算します。 mint x = 1; while (n > 0) {//全てのbitが捨てられるまで。 if (n & 1) {//1番右のbitが1のとき。 x = x * a; } a = a * a; n >>= 1;//bit全体を右に1つシフトして一番右を捨てる。 } return x; } mint chooes(int n, int a) { mint x = 1, y = 1; rep(i, a) { x *= n - i; y *= i + 1; } return x / y; } int main() { int n; cin >> n; vi s(n); rep(i, n) cin >> s[i]; sort(s.begin(), s.end()); int ans = 0; rep(i, n) { ans += s[i]; } if (ans % 10 == 0) { rep(i, n) { if (s[i] % 10 != 0) { ans -= s[i]; break; } } } if (ans % 10 == 0) cout << 0 << endl; else cout << ans << endl; return 0; }
main.c:3:10: fatal error: bits/stdc++.h: No such file or directory 3 | #include "bits/stdc++.h" | ^~~~~~~~~~~~~~~ compilation terminated.
s856289985
p03699
C++
#include <bits/stdc++.h> #define rep(i, n) for(int i = 0; i < (int)(n); ++i) using namespace std; using ll = long long; using P = pair<int,int>; int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); int n; cin >> n; vector<int> s(n); vector<int> not_ten int sum = 0; rep(i,n) { cin >> s[i]; if(s[i] % 10 != 0) not_ten.emplace_back(s[i]); sum += s[i]; } if((int)not_ten.size() == 0) { cout << 0 << endl; return 0; } else { sort(not_ten.begin(), not_ten.end()); sum -= not_ten[0]; } cout << sum << endl; return 0; }
a.cc: In function 'int main()': a.cc:16:5: error: expected initializer before 'int' 16 | int sum = 0; | ^~~ a.cc:19:28: error: 'not_ten' was not declared in this scope 19 | if(s[i] % 10 != 0) not_ten.emplace_back(s[i]); | ^~~~~~~ a.cc:20:9: error: 'sum' was not declared in this scope 20 | sum += s[i]; | ^~~ a.cc:23:13: error: 'not_ten' was not declared in this scope 23 | if((int)not_ten.size() == 0) { | ^~~~~~~ a.cc:29:9: error: 'sum' was not declared in this scope 29 | sum -= not_ten[0]; | ^~~ a.cc:33:13: error: 'sum' was not declared in this scope 33 | cout << sum << endl; | ^~~
s125109055
p03699
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for (int i = (a); i < (int)(b); ++i) #define endl "\n" typedef long long ll; typedef string str; const double pi=3.14159265358979323846; const long long inf = 1LL << 60; int ctoi(const char c) { if ('0' <= c && c <= '9') return (c - '0'); return -1; } vector<int> input(int n) { vector<int> vec(n); for (int i = 0; i < n; i++) { cin >> vec.at(i); } return vec; } vector<vector<int>> matinput(int n, int m) { vector<vector<int>> table(n, vector<int>(m)); for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >> table. at(i).at(j); } } return table; } void matoutput(vector<vector<int>> table) { for (int i = 0; i < int(table.size()); i++) { for (int j = 0; j < int(table.at(0).size()); j++) { cout << table.at(i).at(j) << " "; } cout << endl; } } long long perm(int n, int r) { if (n < r) { cout << "error" << endl; return 0; } long long perm = 1; for (int i = n; i > n - r; i--) { perm *= i; } return perm; } long long comb(int n, int r) { if (n < r) { cout << "error" << endl; return 0; } long long comb = perm(n,r); for (int i = r; i > 0; i--) { comb /= i; } return comb; } long long fact(int n) { long long fact = 1; for (int i = n; i > 0; i--) { fact *= i; } return fact; } int gcd(int a, int b){ if (a % b == 0){ return(b); }else{ return(gcd(b, a % b)); } } int lcm(int a, int b) { return a * b / gcd(a, b); } bool isprime(int n){ if (n < 2) return false; else if (n == 2) return true; else if (n % 2 == 0) return false; for (int i = 3; i <= sqrt(n); i += 2){ if (n % i == 0){ return false; } } return true; } vector<long long> divisors(long long N) { vector<long long> res; for (long long i = 1; i * i <= N; ++i) { if (N % i == 0) { res.push_back(i); // 重複しないならば i の相方である N/i も push if (N/i != i) res.push_back(N/i); } } // 小さい順に並び替える sort(res.begin(), res.end()); return res; /*long long N; cin >> N; vector<long long> res = divisors(N); for (int i = 0; i < res.size(); ++i) { cout << res[i] << " "; } cout << endl;*/ } vector<pair<long long, long long> > prime_factorize(long long N) { vector<pair<long long, long long> > res; for (long long a = 2; a * a <= N; ++a) { if (N % a != 0) continue; long long ex = 0; while (N % a == 0) { ++ex; N /= a; } res.push_back({a, ex}); } if (N != 1) res.push_back({N, 1}); return res; } void Yes(bool f) { if (f) { cout << "Yes" << endl; } else { cout << "No" << endl; } } void YES(bool f) { if (f) { cout << "YES" << endl; } else { cout << "NO" << endl; } } bool leapyear(int y){ //閏年かどうかを判定 if(y%4==0){ if(y%100==0){ if(y%400==0){ return true; }else{ return false; } }else{ return true; } }else{ return false; } } tuple<int,int,int> dayplus(int y, int m,int d){ //次の日を返す //31日まである月 if(m==1||m==3||m==5||m==7||m==8||m==10||m==12){ if(d!=31){ d++; return make_tuple(y,m,d); }else{ d=1; if(m==12){ m=1; y++; return make_tuple(y,m,d); }else{ m++; return make_tuple(y,m,d); } } } //30日まである月 else if(m==4||m==6||m==9||m==11){ if(d!=30){ d++; return make_tuple(y,m,d); }else{ d=1; m++; return make_tuple(y,m,d); } } //2月 else{ //閏年の場合 if(leapyear(y)){ if(d!=29){ d++; return make_tuple(y,m,d); }else{ d=1; m++; return make_tuple(y,m,d); } } //閏年ではない場合 else{ if(d!=28){ d++; return make_tuple(y,m,d); }else{ d=1; m++; return make_tuple(y,m,d); } } } } tuple<int,int,int> monplus(int y,int m,int d){ //月を一つ先に、日を一日にする d=1; if(m==12){ m=1; y++; return make_tuple(y,m,d); }else{ m++; return make_tuple(y,m,d); } } bool in(vector<int> a,int x){ if(find(a.begin(),a.end(),x)!=a.end()){ return true; }else{ return false; } } int count_bool(vector<bool> flag){ int count=0; for(int i=0;i<int(flag.size());i++){ if(flag[i]){ count++; } } return count; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } int main() { int n,s[111],sum=0; cin >> n; bool f[111]; rep(i,0,n){ f[i]=true; cin >> s[i]; sum+=s[i]; } sort(s.begin(),s.end()); rep(i,0,n){ if(s[i]%10==0){ f[i]=false; } } if(sum%10!=0){ cout << sum << endl; }else{ rep(i,0,n){ if(f[i]){ cout << sum-s[i] << endl; return 0; } } } cout << 0 << endl; }
a.cc: In function 'int main()': a.cc:263:10: error: request for member 'begin' in 's', which is of non-class type 'int [111]' 263 | sort(s.begin(),s.end()); | ^~~~~ a.cc:263:20: error: request for member 'end' in 's', which is of non-class type 'int [111]' 263 | sort(s.begin(),s.end()); | ^~~
s189695276
p03699
C++
#include <bits/stdc++.h> #define local #ifdef local #include "dbg-macro/dbg.h" #endif #define ll long long #define pi (acos(-1)) #define rep(i, n) for (unsigned long long i = 0; i < (unsigned long long)(n); ++i) using namespace std; std::vector<unsigned ll> genprimevec(const unsigned ll N); int main() { int n; cin >> n; vector<int> s(n, 0); rep(i, n) { cin >> s[i]; } sort(s.begin(), s.end(), [](int l, int r) { return l > r; }); int sum = accumulate(s.begin(), s.end(), 0); if (sum % 10 != 0) { cout << sum << endl; return 0; } rep(i, s.size()) { if ((sum - s[s.size() - i - 1]) % 10 != 0) { cout << sum - s[s.size() - i - 1] << endl; return 0; } } cout << 0 << endl; return 0; } /*author https://qiita.com/drken/items/0c88a37eec520f82b788*/ ll extgcd(ll a, ll b, ll &x, ll &y) { if (b == 0) { x = 1, y = 0; return a; } ll d = extgcd(b, a % b, y, x); y -= a / b * x; return d; } std::vector<unsigned ll> genprimevec(const unsigned ll N) { std::vector<bool> is_prime(N + 1); for (unsigned ll i = 0; i <= N; i++) { is_prime[i] = true; } std::vector<unsigned ll> P; for (unsigned ll i = 2; i <= N; i++) { if (is_prime[i]) { for (unsigned ll j = 2 * i; j <= N; j += i) { is_prime[j] = false; } P.emplace_back(i); } } return P; }
a.cc:4:10: fatal error: dbg-macro/dbg.h: No such file or directory 4 | #include "dbg-macro/dbg.h" | ^~~~~~~~~~~~~~~~~ compilation terminated.
s543094259
p03699
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, c) for (int i = 0; i < (int)c; i++) int main() { int n; scanf("%d", &n); vector<int> s(n); int sum = 0; rep(i, n) { scanf("%d", &s[i]); sum += s[i]; } if(ans % 10 == 0) { sort(s.begin(), s.end()); rep(i, n) { if (s[i] % 10) { //s[i]が10の倍数でなければ sum -= s[i]; } } } if(sum % 10 == 0) sum = 0; printf("%d\n", sum); return 0; }
a.cc: In function 'int main()': a.cc:14:12: error: 'ans' was not declared in this scope; did you mean 'abs'? 14 | if(ans % 10 == 0) { | ^~~ | abs
s315731682
p03699
C++
#include <bits/stdc++.h> #define F first #define S second using namespace std; using ll = long long; typedef pair<int, int> P; ll Mod = 1000000007; 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) { cout << sum << endl; } else { int mi = -1; for (int i = 0; i < N i++) { if (s[i] % 10 != 0) { mi = i; break; } } if (mi == -1) { cout << 0 << endl; } else { cout << sum - s[mi] << endl; } } return 0; }
a.cc: In function 'int main()': a.cc:22:26: error: expected ';' before 'i' 22 | for (int i = 0; i < N i++) { | ^~ | ;
s891005630
p03699
C++
#include <ext/pb_ds/assoc_container.hpp> #define ll long long #define bp __builtin_popcount #define pb push_back #define loop(i,n) for(int i = 0;i < int(n);i++) #define sz(s) (int)(s.size()) #define all(x) x.begin(), x.end() #define allr(x) x.rbegin(), x.rend() #define setdp memset(dp,-1,sizeof(dp)) #define fr first #define sc second #define NumofDigits(n) ((long long)log10(n)+1) using namespace std; using namespace __gnu_pbds; typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> indexed_set; const int maxn=2e6+5; const double EPS = 1e-9; const int MOD = 1e9+7; /* ll gcd(ll a, ll b) { return !b ? a : gcd(b, a % b); } ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; } ll fastpow(ll b, ll p) {if(!p)return 1;ll ret = fastpow(b, p >> 1);ret *= ret;if(p&1)ret*= b;return ret;} int dx[] = {- 1, 0, 0, 1, 0 }; int dy[] = { 0,- 1, 1, 0, 0 };*/ inline void File() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); #endif } int main() { ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0); int n,sum=0; cin>>n; vector<int>v; for(int i=0; i<n; i++) { int x; cin>>x; if(x%10!=0) v.pb(x); sum+=x; } if(sz(v)&&sum%10==0) return cout<<0<<endl,0; if(sum%10==0) sum-=*min_element(all(v)); cout<<sum<<endl; }
a.cc: In function 'int main()': a.cc:35:34: error: 'cin' was not declared in this scope 35 | ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0); | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include <ext/pb_ds/assoc_container.hpp> +++ |+#include <iostream> 2 | #define ll long long a.cc:35:45: error: 'cout' was not declared in this scope 35 | ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0); | ^~~~ a.cc:35:45: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:48:26: error: 'endl' was not declared in this scope 48 | return cout<<0<<endl,0; | ^~~~ a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 1 | #include <ext/pb_ds/assoc_container.hpp> +++ |+#include <ostream> 2 | #define ll long long a.cc:52:16: error: 'endl' was not declared in this scope 52 | cout<<sum<<endl; | ^~~~ a.cc:52:16: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s807017950
p03699
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; bool F=false; long long M=0; long long L=100; cin>>N; vector<int>vec(N); for(int X=0;X<N;X++){ cin>>vec.at(X); M+=vec.at(X); if(vec.at(X)%10!=0 && L>vec.at(X){ L=vec.at(X); bool F=true; } } if(M%10!=0){ cout<<M<<endl; } else if(F==false){ cout<<0<<endl; } else{ cout<<M-L<<endl; } }
a.cc: In function 'int main()': a.cc:14:38: error: expected ')' before '{' token 14 | if(vec.at(X)%10!=0 && L>vec.at(X){ | ~ ^ | ) a.cc:18:3: error: expected primary-expression before '}' token 18 | } | ^
s825594609
p03699
C++
#include <bits/stdc++.h> using namespace std; int main(void) { int N; cin >> N; vector<int> s(N); vector<vector<int>> dig1s(10, vector<int>(0)); int sum = 0; for(int i = 0; i < N; i++){ cin >> s[i]; sum += s[i]; dig1s[s[i]%10].push_back(s[i]); } bool isSumZero = true; vector<int> diffs(6, 0); for(int i = 1; i < 6; i++){ int diff = 0; if(i != 5){ diff = (int) abs(dig1s[i].size() - dig1s[10-i].size()); } else { diff = dig1s[i].size(); } diffs[i] = diff; if(diff % 2 != 0) isSumZero = false; } vector<int> mins(0); if(isSumZero){ for(int i = 1; i < 6; i++){ if(diffs[i] % 2 == 0 && dig1s[i].size() > 0){ int min_l = *min_element(dig1s[i].begin(), dig1s[i].end()); int min_r = *min_element(dig1s[10-i].begin(), dig1s[10-i].end()); mins.push_back((int) min(min_l, min_r)); } } if(mins.size() > 0){ sum -= *min_element(mins.begin(), mins.end()); } } cout << ((sum % 10 == 0) ? 0 : sum) << endl; return 0; }
a.cc: In function 'int main()': a.cc:23:29: error: call of overloaded 'abs(std::vector<int>::size_type)' is ambiguous 23 | diff = (int) abs(dig1s[i].size() - dig1s[10-i].size()); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42, from a.cc:1: /usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)' 980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; | ^~~ In file included from /usr/include/c++/14/cstdlib:81: /usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)' 137 | abs(__float128 __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)' 85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; } | ^~~ /usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)' 79 | abs(long double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)' 75 | abs(float __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)' 71 | abs(double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)' 61 | abs(long long __x) { return __builtin_llabs (__x); } | ^~~ /usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)' 56 | abs(long __i) { return __builtin_labs(__i); } | ^~~
s025981159
p03699
C++
#include <bits/stdc++.h> using namespace std; int main(void) { int N; cin >> N; vector<int> s(N); vector<vector<int>> dig1s(10, vector<int>(0)); int sum = 0; for(int i = 0; i < N; i++){ cin >> s[i]; sum += s[i]; dig1s[s[i]%10].push_back(s[i]); } bool isSumZero = true; vector<int> diffs(6, 0); for(int i = 1; i < 6; i++){ int diff = 0; if(i != 5){ diff = abs(dig1s[i].size() - dig1s[10-i].size()); } else { diff = dig1s[i].size(); } diffs[i] = diff; if(diff % 2 != 0) isSumZero = false; } vector<int> mins(0); if(isSumZero){ for(int i = 1; i < 6; i++){ if(diffs[i] % 2 == 0 && dig1s[i].size() > 0){ int min_l = *min_element(dig1s[i].begin(), dig1s[i].end()); int min_r = *min_element(dig1s[10-i].begin(), dig1s[10-i].end()); mins.push_back(min(min_l, min_r)); } } if(mins.size() > 0){ sum -= *min_element(mins.begin(), mins.end()); } } cout << ((sum % 10 == 0) ? 0 : sum) << endl; return 0; }
a.cc: In function 'int main()': a.cc:23:23: error: call of overloaded 'abs(std::vector<int>::size_type)' is ambiguous 23 | diff = abs(dig1s[i].size() - dig1s[10-i].size()); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42, from a.cc:1: /usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)' 980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; | ^~~ In file included from /usr/include/c++/14/cstdlib:81: /usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)' 137 | abs(__float128 __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)' 85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; } | ^~~ /usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)' 79 | abs(long double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)' 75 | abs(float __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)' 71 | abs(double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)' 61 | abs(long long __x) { return __builtin_llabs (__x); } | ^~~ /usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)' 56 | abs(long __i) { return __builtin_labs(__i); } | ^~~
s030203526
p03699
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<int> s(n); int ans=0; for(int i=0;i<n;i++){ cin >> s.at(i); ans+=s.at(i); } sort(s.begin(),s.end()); for(int i=0;i<n;i++){ if(ans%10!=0){ cout << ans << endl; break; } if(s.at(i)%10!=0){ ans-=s.at(i); cout << ans << endl; break; } } } if(ans%10==0){ cout << 0 << endl; } return 0; }
a.cc:26:7: error: expected unqualified-id before 'if' 26 | if(ans%10==0){ | ^~ a.cc:30:7: error: expected unqualified-id before 'return' 30 | return 0; | ^~~~~~ a.cc:31:2: error: expected declaration before '}' token 31 | } | ^
s528098974
p03699
C
#include <iostream> #include <string> #include <queue> #include <vector> #include <algorithm> #include <math.h> #include <map> #include <iomanip> #include <queue> #include <numeric> 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()); int i = 0; while (i != N) { if (sum % 10 != 0) { break; } else { if (s[i] % 10 != 0) { sum -= s[i]; break; } else { i++; if (i == N) { sum = 0; break; } } } } cout << sum; return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s965241812
p03699
C++
#include <bits/stdc++.h> #include <math.h> using namespace std; typedef long long ll; typedef vector<int> vint; #define rep(i,n) for (int i = 0; i < (ll)(n); ++i) ll INF = 1LL << 60; ll mod = 1e9 + 7; int main() { int n; cin >> n; vint s(n); int mi = 1000; int ans=0; rep(i,n) { cin >> s[i]; ans+=s[i]; mi = min(mi,s[i]); } if(s%10==0) { cout << ans-mi << endl; } else cout << ans << endl; }
a.cc: In function 'int main()': a.cc:20:13: error: no match for 'operator%' (operand types are 'vint' {aka 'std::vector<int>'} and 'int') 20 | if(s%10==0) { | ~^~~ | | | | | int | vint {aka std::vector<int>} In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166, from a.cc:1: /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:20:14: note: 'vint' {aka 'std::vector<int>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 20 | if(s%10==0) { | ^~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:20:14: note: 'vint' {aka 'std::vector<int>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 20 | if(s%10==0) { | ^~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:20:14: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 20 | if(s%10==0) { | ^~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:20:14: note: 'vint' {aka 'std::vector<int>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 20 | if(s%10==0) { | ^~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:20:14: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 20 | if(s%10==0) { | ^~ /usr/include/c++/14/valarray:1200:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const valarray<_Tp>&, const valarray<_Tp>&)' 1200 | _DEFINE_BINARY_OPERATOR(%, __modulus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1200:1: note: template argument deduction/substitution failed: a.cc:20:14: note: 'vint' {aka 'std::vector<int>'} is not derived from 'const std::valarray<_Tp>' 20 | if(s%10==0) { | ^~ /usr/include/c++/14/valarray:1200:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1200 | _DEFINE_BINARY_OPERATOR(%, __modulus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1200:1: note: template argument deduction/substitution failed: a.cc:20:14: note: 'vint' {aka 'std::vector<int>'} is not derived from 'const std::valarray<_Tp>' 20 | if(s%10==0) { | ^~ /usr/include/c++/14/valarray:1200:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1200 | _DEFINE_BINARY_OPERATOR(%, __modulus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1200:1: note: template argument deduction/substitution failed: a.cc:20:14: note: mismatched types 'const std::valarray<_Tp>' and 'int' 20 | if(s%10==0) { | ^~
s566909003
p03699
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int k=0; int s=100000; for(int i=0;i<n;i++){ int x; cin >> x; k+=x; if(x%10!=0) s=smin(s,x); } if(k%10!=0) cout << k << endl; else cout << k-s << endl; }
a.cc: In function 'int main()': a.cc:13:19: error: 'smin' was not declared in this scope; did you mean 'sin'? 13 | if(x%10!=0) s=smin(s,x); | ^~~~ | sin
s424840677
p03699
C++
#include <iostream> #include <vector> #include <bitset> #include <algorithm> int main(){ int N; std::cin >> N; std::vector<int> s(N); for (int i=0; i<N; ++i){ std::cin >> s.at(i); } int max = 0; for (int i=0; i<(1<<N)-1); i++){ std::bitset<100> b(i); //std::cerr << b << std::endl; std::string bs = b.to_string(); std::reverse(bs.begin(), bs.end()); std::string bss = bs.substr(0, N); //std::cerr << bss << std::endl; int tmp = 0; for (int j=0; j<bss.size(); j++){ if (bss.at(j) == '1'){ tmp = tmp + s.at(j); } } if (tmp % 10 != 0){ max = std::max(tmp, max); } } std::cout << max << std::endl; }
a.cc: In function 'int main()': a.cc:14:28: error: expected ';' before ')' token 14 | for (int i=0; i<(1<<N)-1); i++){ | ^ | ; a.cc:14:31: error: 'i' was not declared in this scope 14 | for (int i=0; i<(1<<N)-1); i++){ | ^
s036730273
p03699
C++
#pragma region template #include <bits/stdc++.h> #define all(a) (a).begin(),(a).end() #define rall(a) (a).rbegin(),(a).rend() #define sz(a) (int)(a).size() #define last(a) (a).at((int)(a).size()-1) #define rep(i,n) for(int i=0,i##_len=(n);i<i##_len;i++) #define brep(i,a,b) for(int i=(a),i##_len=(b);i<=i##_len;i++) #define rrep(i,n) int i=(n);int now=-1;while(i--&&(now++||1)) #define xrep(i,n) for(int i=1,i##_len=(n);i<=i##_len;i++) #define Yes(n) cout<<((n)?YES:NO)<<'\n' #define co(n) cout<<(n)<<'\n' #define Sort(v) sort(all(v)) #define rSort(v) sort(all(v),greater<typeof(v[0])>()) #define Rev(v) reverse(all(v)) #define Unique(v) (v).erase(unique(all(v)),(v).end()) #define eb emplace_back #define fi first #define se second #ifdef ONLINE_JUDGE #define here() #define cprint(vec) #define comment(msg) #define observe(var) #define local(x) #define alter(x,y) y #else #define here() cerr<<__func__<<'/'<<__LINE__<<": passed\n" #define cprint(vec) print_e(vec) #define comment(msg) cerr<<"{ "<<msg<< " }\n" #define observe(var) cerr<<"{ "<<#var<<" : "<<var<<" }\n" #define local(x) x #define alter(x,y) x #endif using namespace std; using ll = long long; using vbl = vector<bool>; using vll = vector<long long>; using ull = unsigned long long; using vint = vector<int>; using vdbl = vector<double>; using vstr = vector<string>; using vvbl = vector<vector<bool>>; using vvll = vector<vector<long long>>; using vvint = vector<vector<int>>; constexpr int INF = 1e9; constexpr ll LINF = 1e18; constexpr double EPS = 1e-9; // --- functions which take 1 argument --- // inline void ignore_ret(int x){x++;} template<class T> inline int sgn(const T& x){return (x>0)-(x<0);} template<class T> inline int digit(T x){int r=1;while((x/=10)>=1)r++;return r;} template<class T> inline double deg_to_rad(const T& a){return a/180.0*M_PI;} template<class T> inline double rad_to_deg(const T& a){return a/M_PI*180.0;} template<class T> inline ll factorial(const T& n){if(n==0)return 1;ll r=1;brep(i,2,n)r*=i;return r;} template<class T> inline map<T,T> factorize(T n){map<T,T>r;for(T i=2;i*i<=n;i++){while(n%i==0){r[i]++;n/=i;}}if(n!=1)r[n]=1;return r;} template<class T> inline vector<T> divisor(const T& n){vector<T>r;for(T i=1;i*i<=n;i++){if(!(n%i)){r.eb(i);if(i*i!=n)r.eb(n/i);}}Sort(r);return r;} // --- functions which take 2 arguments --- // template<class T> inline bool chmax(T& a,const T& b){if(a<b){a=b;return 1;}return 0;} template<class T> inline bool chmin(T& a,const T& b){if(a>b){a=b;return 1;}return 0;} template<class T> inline T nPr(const T& n,const T& k){if(n<k||n<0||k<0)return 0;T r=1;brep(i,n-k+1,n)r*=i;return r;} template<class T> inline T nCr(const T& n,const T& k){if(n<k||n<0||k<0)return 0;T r=1;k=min(k,n-k);brep(i,n-k+1,n)r*=i;return r/factorial(k);} // --- functions which take vector(s) as argument(s) --- // template<class T> inline void print(const vector<T>& v){cout<<"[ ";for(auto& x:v)cout<<x<<' ';cout<<"]\n";} template<class T> inline void print(const vector<vector<T>>& v){for(auto& x:v)print<T>(x);} template<class T> inline void print_d(const vector<T>& v,string d){rep(i,sz(v)-1)cout<<v[i]<<d;cout<<last(v)<<'\n';} template<class T> inline void print_d(const vector<vector<T>>& v,string d){for(auto& x:v)print_d(x,d);} template<class T> inline void print_e(const vector<T>& v){cerr<<"[ ";for(auto& x:v)cerr<<x<<' ';cerr<<"]\n";} template<class T> inline void print_e(const vector<vector<T>>& v){for(auto& x:v)print_e<T>(x);} template<class T> inline bool in(const T& k,const vector<T>& v){return find(all(v),k)!=v.end();} inline bool in(const int& k,const vector<ll>& v){return find(all(v),k)!=v.end();} inline bool in(const ll& k,const vector<int>& v){return find(all(v),k)!=v.end();} inline bool in(const char& k,const string& v){return find(all(v),k)!=v.end();} inline bool in(const char*& k,const vector<string>& v){return find(all(v),k)!=v.end();} template<class T> inline T min(const vector<T>& v){return *min_element(all(v));} template<class T> inline T max(const vector<T>& v){return *max_element(all(v));} template<class T> inline ll sum(const T& v){return accumulate(all(v),0LL);} template<class T> inline T gcd(const vector<T>& v){T r=v[0];brep(i,1,sz(v)-1)r=gcd(r,v[i]);return r;} template<class T> inline T lcm(const vector<T>& v){T r=v[0];brep(i,1,sz(v)-1)r=lcm(r,v[i]);return r;} template<class T> inline double abs(const vector<T>& v){return sqrt(reduce(all(v),0.0,[](T s,T v){return s+=v*v;}));} template<class T> inline T vector_add(const T& u,const T& v){T r(u.size());rep(i,u.size())r[i]=u[i]+v[i];return r;} template<class T> inline T vector_subtract(const T& u,const T& v){T r(u.size());rep(i,u.size())r[i]=u[i]-v[i];return r;} template<class T> inline T vector_multiply(const T& u,const T& v){T r(u.size());rep(i,u.size())r[i]=u[i]*v[i];return r;} template<class T> inline T dot_product(const vector<T>& u,const vector<T>& v){T r=0;rep(i,u.size())r+=u[i]*v[i];return r;} template<class T> inline T cross_product(const T& u,const T& v){T r(3);rep(i,3)r[i]=u[(i+1)%3]*v[(i+2)%3]-u[(i+2)%3]*v[(i+1)%3];return r;} template<class S,class T> inline void sort_by_second(vector<pair<S,T>>& v){sort(all(v),[](auto& L,auto& R){return L.second<R.second;});} // --- functions which take set/map as argument --- // template<class T> inline bool in(const T& k,const set<T>& v){return find(all(v),k)!=v.end();} template<class T> inline bool in(const T& k,const unordered_set<T>& v){return find(all(v),k)!=v.end();} template<class T> inline T min(const set<T>& v){return *min_element(all(v));} template<class T> inline T min(const unordered_set<T>& v){return *min_element(all(v));} template<class T> inline T max(const set<T>& v){return *max_element(all(v));} template<class T> inline T max(const unordered_set<T>& v){return *max_element(all(v));} template<class T> inline T gcd(const set<T>& v){T r=0;for(T x:v)r=(r==0)?x:gcd(r,x);return r;} template<class T> inline T gcd(const unordered_set<T>& v){T r=0;for(T x:v)r=(r==0)?x:gcd(r,x);return r;} template<class T> inline T lcm(const set<T>& v){T r=0;for(T x:v)r=(r==0)?x:lcm(r,x);return r;} template<class T> inline T lcm(const unordered_set<T>& v){T r=0;for(T x:v)r=(r==0)?x:lcm(r,x);return r;} template<class T> inline void print(const set<T>& v){cout<<"[ ";for(T& x:v)cout<<x<<' ';cout<<"]\n";} template<class T> inline void print(const unordered_set<T>& v){cout<<"[ ";for(T& x:v)cout<<x<<' ';cout<<"]\n";} template<class S,class T> inline void print(const map<S,T>& m){cout<<"[ ";for(auto& x:m)cout<<"{ "<<x.fi<<", "<<x.se<<" } ";cout<<"]\n";} template<class S,class T> inline void print(const unordered_map<S,T>& m){cout<<"[ ";for(auto& x:m)cout<<"{ "<<x.fi<<", "<<x.se<<" } ";cout<<"]\n";} #pragma endregion template void solve(ll N, vector<int> s) { int total = sum(s); sort(s); if (total % 10) { cout << total << endl; return; } for (int i = 0; i < N; i++) { if ((total - s[i]) % 10) { cout << total - s[i] << endl; return; } } cout << 0 << endl; } int main() { int N; ignore_ret(scanf("%d",&N)); vector<int> s(N); for(int i = 0 ; i < N ; i++){ ignore_ret(scanf("%d",&s[i])); } solve(N, move(s)); return 0; }
a.cc: In function 'void solve(ll, std::vector<int>)': a.cc:114:7: error: no matching function for call to 'sort(std::vector<int>&)' 114 | sort(s); | ~~~~^~~ 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:2: /usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)' 4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last) | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)' 4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last, | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 1 provided In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)' 292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)' 296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 1 provided
s328610026
p03699
Java
public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int sum = 0; List<Integer> point = new ArrayList<>(); for (int i = 0; i < N; i++) { int p = sc.nextInt(); sum += p; if (p%10 != 0) { point.add(p); } } if (point.size() == 0) { System.out.println(0); } else { Collections.sort(point); System.out.println(sum%10 == 0 ? sum - point.get(0) : sum); } } }
Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:7: error: cannot find symbol List<Integer> point = new ArrayList<>(); ^ symbol: class List location: class Main Main.java:7: error: cannot find symbol List<Integer> point = new ArrayList<>(); ^ symbol: class ArrayList location: class Main Main.java:18: error: cannot find symbol Collections.sort(point); ^ symbol: variable Collections location: class Main 5 errors
s975233677
p03699
C++
#include<algorithm>//sort(all(変数),greater<型名>())で降順に、*max_element(all(変数))で最大値を獲得 #include<bits/stdc++.h> #include<cmath>//切り上げceil(値) #include<deque> #include<iomanip>//setprecision(数字) #include<iostream> #include<list> #include<map> #include<numeric> // xとyのgcdは__gcd(x,y),xとyのlcmは(x*y)/__gcd、accumulate(all(変数),0)で要素の全加算 #include<queue>//priority_queue<型名> 変数 #include<set> #include<stack> #include<string>//変数.substr(どこから,いくつ) #include<vector> #define rep(i,n) for(ll i=0; i<n; i++) #define rrep(i,n) for(ll i=n-1; 0<=i; i--) #define vll vector<ll> #define vi vector<int> #define all(x) (x).begin(),(x).end() #define INF 1e9 using ll = long long; using namespace std; template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } int main(){ int n; cin >> n; vi s(n); rep(i,n) cin >> s[i]; int sum = accumulate(all(s),0); sort(all(s)); for(int i = 0; sum % 10 == 0; i++){ if((sum-s[i])%10!=0) sum -= sum[i]; if(i == n){ sum = 0; break; } } cout << sum; cout << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:33:36: error: invalid types 'int[int]' for array subscript 33 | if((sum-s[i])%10!=0) sum -= sum[i]; | ^
s877820959
p03699
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <utility> #include <set> using namespace std; typedef long long ll; #define rep(i,n) for (int i=0;i < (int)(n);i++) bool dp[2][10001]; int main(){ int n; cin >> n; dp[0][0] = true; dp[1][0] = true; int one = 0; int two = 1; for (int i = 0; i < n;i++){ int tmp; cin >> tmp; for (int j = 0; j < 10001;j++){ if (j+tmp <= 10000 && dp[one][j]) { dp[two][j+tmp] = true; dp[two][j] = true; } swap(one,two); } int ans = 0; for (int i = 0; i < 10001;i++){ if (i%10 != 0 && dp[one][i]) ans = i; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:38:2: error: expected '}' at end of input 38 | } | ^ a.cc:13:11: note: to match this '{' 13 | int main(){ | ^
s678225337
p03699
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ int n; cin >> n; vector<int> s(n); for(int i =0;i < n;i++){ cin >> s[i]; } sort(s.begin(),s.end()); int ans = 0; for(int i =0;i < n;i++){ ans += s[i]; } int count =0; while(ans%10 == 0){ while(s[count] % 10 == 0){ count++; if(count == n){ ans = 0;  break; } } if(count != n){ ans -= s[count]; } } cout << ans << endl; }
a.cc:23:15: error: extended character   is not valid in an identifier 23 |  break; | ^ a.cc: In function 'int main()': a.cc:23:15: error: '\U00003000break' was not declared in this scope 23 |  break; | ^~~~~~~
s219595967
p03699
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n=sc.nextInt(),max=0,sum=0; int[] s=new int[n]; for(int i=0;i<n;i++){ s[i]=sc.nextInt(); } for(double i=0;i<(1<<(double)n);i++){ for(int j=0;j<n;j++){ if((1&i>>j)==1){ sum+=s[j]; } } if(sum%10==0){ sum=0; } max=Math.max(max,sum); sum=0; } System.out.println(max); } }
Main.java:12: error: bad operand types for binary operator '<<' for(double i=0;i<(1<<(double)n);i++){ ^ first type: int second type: double Main.java:14: error: bad operand types for binary operator '>>' if((1&i>>j)==1){ ^ first type: double second type: int 2 errors
s868538682
p03699
C
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<int> s(n); for(int i=0; i<n; ++i)cin>>s[i]; sort(s.begin(),s.end()); int sum = accumulate(s.begin(),s.end(),0); if(sum%10) { cout << sum << endl; return 0; } for (int i=0; i<n; ++i) { if(s[i]%10){ cout << sum-s[i] << endl; return 0; } } cout << 0 << endl; return 0; }
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s298468000
p03699
C
#include <stdio.h> #define max(a, b) ((a)<(b) ? (b) : (a)) #define swap(type, x, y) do{ type t = x; x = y; y = t; }while(0) int ans = 0; void quick(int array[], int left, int right){ int pl = left, pr = right, x = array[(left + right) / 2]; do{ while(array[pl] < x) pl++; while(array[pr] > x) pr--; if(pl <= pr){ swap(int, array[pl], array[pr]); pl++, pr--; } }while(pl <= pr); if(pl < right) quick(array, pl, right); if(pr > left) quick(array, left, pr); } int main(){ int n; scanf("%d", &n);h int s[103] = {0}; int not[104] = {0}; for(int i=1; i<=n; i++){ scanf("%d", &s[i]); ans += s[i]; if(s[i] % 10) not[++not[0]] = s[i]; } quick(not, 1, not[0]); if(ans % 10 == 0) ans -= not[1]; printf("%d\n", ans); return 0; }
main.c: In function 'main': main.c:21:27: error: 'h' undeclared (first use in this function) 21 | int n; scanf("%d", &n);h | ^ main.c:21:27: note: each undeclared identifier is reported only once for each function it appears in main.c:21:28: error: expected ';' before 'int' 21 | int n; scanf("%d", &n);h | ^ | ; 22 | int s[103] = {0}; | ~~~ main.c:25:18: error: 's' undeclared (first use in this function) 25 | scanf("%d", &s[i]); | ^
s481679907
p03699
C
#include <stdio.h> #define max(a, b) ((a)<(b) ? (b) : (a)) #define swap(type, x, y) do{ type t = x; x = y; y = t; }while(0) int ans = 0; void quick(int array, int left, int right){ int pl = left, pr = right, x = array[(left + right) / 2]; do{ while(array[pl] < x) pl++; while(array[pr] > x) pr--; if(pl <= pr){ swap(int, array[pl], array[pr]); pl++, pr--; } }while(pl <= pr); if(pl < right) quick(array, pl, right); if(pr > left) quick(array, left, pr); } int main(){ int n; scanf("%d", &n); int s[103] = {0}; int not[104] = {0}; for(int i=1; i<=n; i++){ scanf("%d", &s[i]); ans += s[i]; if(s[i] % 10) not[++not[0]] = s[i]; } quick(not, 1, not[0]); if(ans % 10 == 0) ans -= not[1]; printf("%d\n", ans); return 0; }
main.c: In function 'quick': main.c:7:39: error: subscripted value is neither array nor pointer nor vector 7 | int pl = left, pr = right, x = array[(left + right) / 2]; | ^ main.c:9:16: error: subscripted value is neither array nor pointer nor vector 9 | while(array[pl] < x) pl++; | ^ main.c:10:16: error: subscripted value is neither array nor pointer nor vector 10 | while(array[pr] > x) pr--; | ^ main.c:12:22: error: subscripted value is neither array nor pointer nor vector 12 | swap(int, array[pl], array[pr]); | ^ main.c:3:39: note: in definition of macro 'swap' 3 | #define swap(type, x, y) do{ type t = x; x = y; y = t; }while(0) | ^ main.c:12:22: error: subscripted value is neither array nor pointer nor vector 12 | swap(int, array[pl], array[pr]); | ^ main.c:3:42: note: in definition of macro 'swap' 3 | #define swap(type, x, y) do{ type t = x; x = y; y = t; }while(0) | ^ main.c:12:33: error: subscripted value is neither array nor pointer nor vector 12 | swap(int, array[pl], array[pr]); | ^ main.c:3:46: note: in definition of macro 'swap' 3 | #define swap(type, x, y) do{ type t = x; x = y; y = t; }while(0) | ^ main.c:12:33: error: subscripted value is neither array nor pointer nor vector 12 | swap(int, array[pl], array[pr]); | ^ main.c:3:49: note: in definition of macro 'swap' 3 | #define swap(type, x, y) do{ type t = x; x = y; y = t; }while(0) | ^ main.c: In function 'main': main.c:30:9: error: passing argument 1 of 'quick' makes integer from pointer without a cast [-Wint-conversion] 30 | quick(not, 1, not[0]); | ^~~ | | | int * main.c:6:16: note: expected 'int' but argument is of type 'int *' 6 | void quick(int array, int left, int right){ | ~~~~^~~~~
s448646130
p03699
C
#include <stdio.h> #define max(a, b) ((a)<(b) ? (b) : (a)) int ans = 0; void quick(int array, int left, int right){ int pl = left, pr = right, x = array[(left + right) / 2]; do{ while(array[pl] < x) pl++; while(array[pr] > x) pr--; if(pl <= pr){ swap(int, array[pl], array[pr]); pl++, pr--; } }while(pl <= pr); if(pl < right) quick(array, pl, right); if(pr > left) quick(array, left, pr); } int main(){ int n; scanf("%d", &n); int s[103] = {0}; int not[104] = {0}; for(int i=1; i<=n; i++){ scanf("%d", &s[i]); ans += s[i]; if(s[i] % 10) not[++not[0]] = s[i]; } quick(not, 1, not[0]); if(ans % 10 == 0) ans -= not[1]; printf("%d\n", ans); return 0; }
main.c: In function 'quick': main.c:7:39: error: subscripted value is neither array nor pointer nor vector 7 | int pl = left, pr = right, x = array[(left + right) / 2]; | ^ main.c:9:16: error: subscripted value is neither array nor pointer nor vector 9 | while(array[pl] < x) pl++; | ^ main.c:10:16: error: subscripted value is neither array nor pointer nor vector 10 | while(array[pr] > x) pr--; | ^ main.c:12:7: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration] 12 | swap(int, array[pl], array[pr]); | ^~~~ main.c:12:12: error: expected expression before 'int' 12 | swap(int, array[pl], array[pr]); | ^~~ main.c: In function 'main': main.c:30:9: error: passing argument 1 of 'quick' makes integer from pointer without a cast [-Wint-conversion] 30 | quick(not, 1, not[0]); | ^~~ | | | int * main.c:6:16: note: expected 'int' but argument is of type 'int *' 6 | void quick(int array, int left, int right){ | ~~~~^~~~~
s795704566
p03699
C++
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (int)(n); i++) #define REP(i,n) for (int i = 1; i < (int)(n); i++) #define all(x) x.begin(),x.end() #define rall(x) x.rbegin(),x.rend() #define vout(x) rep(i,x.size()) cout << x[i] << " " template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;} template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;} using namespace std; using vint = vector<int>; using vvint = vector<vector<int>>; using ll = long long; using vll = vector<ll>; using vvll = vector<vector<ll>>; using P = pair<ll,int>; const int inf = 1e9; const ll inf_l = 1e18; const int MAX = 1e5; const int mod = 1e9+7; int main() { int n; cin >> n; vint s; int sum = 0; rep(i,n) { int x; cin >> x; if (x % 10 != 0) s.push_back(x); sum += x; } sort(all(s)); if (sum % 10 != 0) { cout << sum << endl; return 0; } else { if (s.size() != 0) { cout << sum - s[0] << endl; return 0; } else { cout << 0 << endl; return 0; } }
a.cc: In function 'int main()': a.cc:42:6: error: expected '}' at end of input 42 | } | ^ a.cc:21:12: note: to match this '{' 21 | int main() { | ^
s687391012
p03699
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin>>N; int ans=0; vector<int> s(N,0); int mini=100; for (int i=0;i<N;i++){ cin>>s[i]; ans+=s[i]; if (s[i]%10!=0){ mini=min(mini,s[i]); } } if (ans%10==0){ ans-=mini; if (mini==100)ans=0; } cout << ans endl; return 0; }
a.cc: In function 'int main()': a.cc:21:16: error: expected ';' before 'endl' 21 | cout << ans endl; | ^~~~~ | ;
s121921910
p03699
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<int> a(n); for (int i=0;i<n;++i) cin >> a[i]; sort(a.begin(),a.end()); int ans=0; for (int i=0;i<n;++i){ ans+=a[i]; } if (ans%10!=0) cout << ans << endl; else { if (a[i]!=0){ ans-=a[0]; } cout << ans << endl; } }
a.cc: In function 'int main()': a.cc:18:11: error: 'i' was not declared in this scope 18 | if (a[i]!=0){ | ^
s243041990
p03699
C++
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int sum=0; int ara[n+5]; for(int i=0;i<n;i++)cin>>ara[i],sum+=ara[i]; if(sum%10==0) { sort(ara,ara+n); bool f=true; for(int i=0;i<n;i++) { if((sum-ara[i])%10) { sum-=ara[i]; cout<<sum<<endl; f=false; break } } if(f)cout<<0<<endl; } else cout<<sum<<endl; }
a.cc: In function 'int main()': a.cc:21:14: error: expected ';' before '}' token 21 | break | ^ | ; 22 | } | ~
s267407250
p03699
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; vector<pair<int,int>S(N); int sum=0; for(int i=0;i<N;i++){ cin>>S.at(i).first; if(S.at(i).first%10==0){ S.at(i).second=1; } else{ S.at(i).second=0; } sum=sum+S.at(i).first; } if(sum%10!=0){ cout<<sum<<endl; } else{ vector<int>SS; for(int i=0;i<N;i++){ if(S.at(i).second==0){ SS.push_back(S.at(i).first); } } if(SS.size()==0){ cout<<0<<endl; } else{ sort(SS.begin(),SS.end()); cout<<sum-SS.at(0)<<endl; } } }
a.cc: In function 'int main()': a.cc:6:26: error: template argument 1 is invalid 6 | vector<pair<int,int>S(N); | ^ a.cc:6:26: error: template argument 2 is invalid a.cc:9:10: error: 'S' was not declared in this scope 9 | cin>>S.at(i).first; | ^ a.cc:24:10: error: 'S' was not declared in this scope 24 | if(S.at(i).second==0){ | ^
s333718061
p03699
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> scores(n); int sum = 0; rep(i, n) { cin >> scores[i]; sum += scores[i]; } sort(scores.begin(), scores.end()); if (sum % 10 == 0) { for (auto it = scores.begin(); it != scores.end(); it++) { if (*it % 10 != 10) { sum -= *it; break; } } } if (sum % 10 == 0) { cout << 0 << endl; } else { cout << sum << endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:7: error: 'i' was not declared in this scope 9 | rep(i, n) { | ^ a.cc:9:3: error: 'rep' was not declared in this scope 9 | rep(i, n) { | ^~~
s155432693
p03699
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; const ll MOD=1000000007; int main() { int n,sum=0; cin >> n; vector<int> s(n); for(int i=0;i<n;i++){ cin >> s[i]; } sort(s.begin(),s.end()); for(int i=0;i<n;i++){ sum +=s[i]; } if(sum%10==0){ for(int i=0;i<n;i++){ sum -=s[i]; if(sum%10!=0) break; else sum +=s[i]; } if(i==n-1) sum=0; } cout << sum << endl; }
a.cc: In function 'int main()': a.cc:26:8: error: 'i' was not declared in this scope 26 | if(i==n-1) | ^
s404415702
p03699
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; const ll MOD=1000000007; int main() { int n,sum=0; cin >> n; vector<int> s(n); for(int i=0;i<n;++){ cin >> s[i]; } sort(s.begin(),s.end()); for(int i=0;i<s;i++){ sum +=s[i]; } if(sum%10==0){ for(int i=0;i<n;i++){ sum -=s[i]; if(sum%10!=0) break; else sum +=s[i]; } } cout << sum << endl; }
a.cc: In function 'int main()': a.cc:11:21: error: expected primary-expression before ')' token 11 | for(int i=0;i<n;++){ | ^ a.cc:15:16: error: no match for 'operator<' (operand types are 'int' and 'std::vector<int>') 15 | for(int i=0;i<s;i++){ | ~^~ | | | | | std::vector<int> | int In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: a.cc:15:17: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 15 | for(int i=0;i<s;i++){ | ^ /usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: a.cc:15:17: note: mismatched types 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' and 'int' 15 | for(int i=0;i<s;i++){ | ^ /usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: a.cc:15:17: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 15 | for(int i=0;i<s;i++){ | ^ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: a.cc:15:17: note: 'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | for(int i=0;i<s;i++){ | ^ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: a.cc:15:17: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 15 | for(int i=0;i<s;i++){ | ^ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: a.cc:15:17: note: 'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | for(int i=0;i<s;i++){ | ^ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: a.cc:15:17: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 15 | for(int i=0;i<s;i++){ | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:15:17: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' 15 | for(int i=0;i<s;i++){ | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:15:17: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 15 | for(int i=0;i<s;i++){ | ^ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:15:17: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 15 | for(int i=0;i<s;i++){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:15:17: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 15 | for(int i=0;i<s;i++){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:15:17: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 15 | for(int i=0;i<s;i++){ | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:15:17: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 15 | for(int i=0;i<s;i++){ | ^ /usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:15:17: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 15 | for(int i=0;i<s;i++){ | ^ /usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:15:17: note: 'std::vector<int>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 15 | for(int i=0;i<s;i++){ | ^ /usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed: a.cc:15:17: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 15 | for(int i=0;i<s;i++){ | ^ /usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed: a.cc:15:17
s644574570
p03699
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n;cin>>n; int an[n]; rep(i,n)cin>>an[i]; int s=0;rep(i,n) s+= an[i]; sort(an, an+n); rep(i,n) { if (s%10!=0) break; if (an[i]%10!=0) { s-=an[i]; break } } cout << s; }
a.cc: In function 'int main()': a.cc:14:12: error: expected ';' before '}' token 14 | break | ^ | ; 15 | } | ~
s834246156
p03699
C++
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; int main(){ int n; cin>>n; queue<int> s,f,t; rep(i,n){ int tmp; cin>>tmp; if(tmp%10==0)t.push(tmp); else if(tmp%5==0)f.push(tmp); else s.push(tmp); } cout<<s.size()<<"s"<<f.size()<<"f"<<t.size()<<endl; sort(s.begin(),s.end()); sort(t.begin(),t.end()); sort(f.begin(),f.end()); int ans = 0; int ssum = 0; cout<<s.size()<<endl; for(auto i:s)ssum+=i; if(ssum%10==0)ssum-=s.at(0);//!5 int tsum = 0; for(auto i:t)tsum+=i; int fsum = 0; for(auto i:f)fsum+=i; if(fsum%10==0)fsum-=f.at(0); ans=ssum+tsum+fsum; cout<<ssum<<endl; cout<<tsum<<endl; cout<<fsum<<endl; if(ans%10==0)cout<<0<<endl; else cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:20:10: error: 'class std::queue<int>' has no member named 'begin' 20 | sort(s.begin(),s.end()); | ^~~~~ a.cc:20:20: error: 'class std::queue<int>' has no member named 'end' 20 | sort(s.begin(),s.end()); | ^~~ a.cc:21:10: error: 'class std::queue<int>' has no member named 'begin' 21 | sort(t.begin(),t.end()); | ^~~~~ a.cc:21:20: error: 'class std::queue<int>' has no member named 'end' 21 | sort(t.begin(),t.end()); | ^~~ a.cc:22:10: error: 'class std::queue<int>' has no member named 'begin' 22 | sort(f.begin(),f.end()); | ^~~~~ a.cc:22:20: error: 'class std::queue<int>' has no member named 'end' 22 | sort(f.begin(),f.end()); | ^~~ a.cc:27:14: error: no matching function for call to 'begin(std::queue<int>&)' 27 | for(auto i:s)ssum+=i; | ^ In file included from /usr/include/c++/14/bits/algorithmfwd.h:39, from /usr/include/c++/14/bits/stl_algo.h:59, 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/initializer_list:88:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)' 88 | begin(initializer_list<_Tp> __ils) noexcept | ^~~~~ /usr/include/c++/14/initializer_list:88:5: note: template argument deduction/substitution failed: a.cc:27:14: note: 'std::queue<int>' is not derived from 'std::initializer_list<_Tp>' 27 | for(auto i:s)ssum+=i; | ^ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/range_access.h:52:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)' 52 | begin(_Container& __cont) -> decltype(__cont.begin()) | ^~~~~ /usr/include/c++/14/bits/range_access.h:52:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/range_access.h: In substitution of 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&) [with _Container = std::queue<int>]': a.cc:27:14: required from here 27 | for(auto i:s)ssum+=i; | ^ /usr/include/c++/14/bits/range_access.h:52:50: error: 'class std::queue<int>' has no member named 'begin' 52 | begin(_Container& __cont) -> decltype(__cont.begin()) | ~~~~~~~^~~~~ /usr/include/c++/14/bits/range_access.h:63:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&)' 63 | begin(const _Container& __cont) -> decltype(__cont.begin()) | ^~~~~ /usr/include/c++/14/bits/range_access.h:63:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/range_access.h: In substitution of 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&) [with _Container = std::queue<int>]': a.cc:27:14: required from here 27 | for(auto i:s)ssum+=i; | ^ /usr/include/c++/14/bits/range_access.h:63:56: error: 'const class std::queue<int>' has no member named 'begin' 63 | begin(const _Container& __cont) -> decltype(__cont.begin()) | ~~~~~~~^~~~~ /usr/include/c++/14/bits/range_access.h:95:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::begin(_Tp (&)[_Nm])' 95 | begin(_Tp (&__arr)[_Nm]) noexcept | ^~~~~ /usr/include/c++/14/bits/range_access.h:95:5: note: template argument deduction/substitution failed: a.cc:27:14: note: mismatched types '_Tp [_Nm]' and 'std::queue<int>' 27 | for(auto i:s)ssum+=i; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/valarray:1227:5: note: candidate: 'template<class _Tp> _Tp* std::begin(valarray<_Tp>&)' 1227 | begin(valarray<_Tp>& __va) noexcept | ^~~~~ /usr/include/c++/14/valarray:1227:5: note: template argument deduction/substitution failed: a.cc:27:14: note: 'std::queue<int>' is not derived from 'std::valarray<_Tp>' 27 | for(auto i:s)ssum+=i; | ^ /usr/include/c++/14/valarray:1238:5: note: candidate: 'template<class _Tp> const _Tp* std::begin(const valarray<_Tp>&)' 1238 | begin(const valarray<_Tp>& __va) noexcept | ^~~~~ /usr/include/c++/14/valarray:1238:5: note: template argument deduction/substitution failed: a.cc:27:14: note: 'std::queue<int>' is not derived from 'const std::valarray<_Tp>' 27 | for(auto i:s)ssum+=i; | ^ a.cc:27:14: error: no matching function for call to 'end(std::queue<int>&)' /usr/include/c++/14/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)' 99 | end(initializer_list<_Tp> __ils) noexcept | ^~~ /usr/include/c++/14/initializer_list:99:5: note: template argument deduction/substitution failed: a.cc:27:14: note: 'std::queue<int>' is not derived from 'std::initializer_list<_Tp>' 27 | for(auto i:s)ssum+=i; | ^ /usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)' 74 | end(_Container& __cont) -> decltype(__cont.end()) | ^~~ /usr/include/c++/14/bits/range_access.h:74:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/range_access.h: In substitution of 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&) [with _Container = std::queue<int>]': a.cc:27:14: required from here 27 | for(auto i:s)ssum+=i; | ^ /usr/include/c++/14/bits/range_access.h:74:48: error: 'class std::queue<int>' has no member named 'end' 74 | end(_Container& __cont) -> decltype(__cont.end()) | ~~~~~~~^~~ /usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)' 85 | end(const _Container& __cont) -> decltype(__cont.end()) | ^~~ /usr/include/c++/14/bits/range_access.h:85:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/range_access.h: In substitution of 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&) [with _Container = std::queue<int>]': a.cc:27:14: required from here 27 | for(auto i:s)ssum+=i; | ^ /usr/include/c++/14/bits/range_access.h:85:54: error: 'const class std::queue<int>' has no member named 'end' 85 | end(const _Container& __cont) -> decltype(__cont.end()) | ~~~~~~~^~~ /usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])' 106 | end(_Tp (&__arr)[_Nm]) noexcept | ^~~ /usr/include/c++/14/bits/range_access.h:106:5: note: template argument deduction/substitution failed: a.cc:27:14: note: mismatched types '_Tp [_Nm]' and 'std::queue<int>' 27 | for(auto i:s)ssum+=i; | ^ /usr/include/c++/14/valarray:1249:5: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)' 1249 | end(valarray<_Tp>& __va) noexcept | ^~~ /usr/include/c++/14/valarray:1249:5: note: template argument deduction/substitution failed: a.cc:27:14: note: 'std::queue<int>' is not derived from 'std::valarray<_Tp>' 27 | for(auto i:s)ssum+=i; | ^ /usr/include/c++/14/valarray:1265:5: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)' 1265 | end(const valarray<_Tp>& __va) noexcept | ^~~ /usr/include/c++/14/valarray:1265:5: note: template argument deduction/substitution failed: a.cc:27:14: note: 'std::queue<int>' is not derived from 'const std::valarray<_Tp>' 27 | for(auto i:s)ssum+=i; | ^ a.cc:28:25: error: 'class std::queue<int>' has no member named 'at' 28 | if(ssum%10==0)ssum-=s.at(0);//!5 | ^~ a.cc:31:14: error: no matching function for call to 'begin(std::queue<int>&)' 31 | for(auto i:t)tsum+=i; | ^ /usr/include/c++/14/initializer_list:88:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)' 88 | begin(initializer_list<_Tp> __ils) noexcept | ^~~~~ /usr/include/c++/14/initializer_list:88:5: note: template argument deduction/substitution failed: a.cc:31:14: note: 'std::queue<int>' is not derived from 'std::initializer_list<_Tp>' 31 | for(auto i:t)tsum+=i; | ^ /usr/include/c++/14/bits/range_access.h:52:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)' 52 | begin(_Container& __cont) -> decltype(__cont.begin()) | ^~~~~ /usr/include/c++/14/bits/range_access.h:52:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/range_access.h: In substitution of 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&) [with _Container = std::queue<int>]': a.cc:31:14: required from here 31 | for(auto i:t)tsum+=i; | ^ /usr/include/c++/14/bits/range_access.h:52:50: error: 'class std::queue<int>' has no member named 'begin' 52 | begin(_Container& __cont) -> decltype(__cont.begin()) | ~~~~~~~^~~~~ /usr/include/c++/14/bits/range_access.h:63:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&)' 63 | begin(const _Container& __cont) -> decltype(__cont.begin()) |
s169790671
p03699
C++
#include<iostream> #include<string> using namespace std; #define rep(i, n) for(int i = 0; i < n; i++) int main(){ int n; cin >> n; int s[n]; rep(i, n) cin >> s[i]; sort(s, s + n); int ans = 0; rep(i, n) ans += s[i]; if(ans % 10 != 0){ cout << ans << endl; return 0; }else{ rep(i, n){ if(s[i] % 10 != 0){ cout << ans - s[i] << endl; return 0; } } cout << 0 << endl; } }
a.cc: In function 'int main()': a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(s, s + n); | ^~~~ | short
s180922121
p03699
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,MAX=100,S=0;cin>>N;int s[N]; for(int i=0;i<N;i++){ cin>>s[i];S+=s[i]; if(s[i]%10!=0)MAX=min(MAX,s[i]); } if(S%10!=0)cout<<S<<endl; else if(MAX!=100)cout<<S-MAX<<end; else cout<<"0"<<endl; }
a.cc: In function 'int main()': a.cc:10:31: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 10 | else if(MAX!=100)cout<<S-MAX<<end; | ~~~~~~~~~~~^~~~~ In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std
s309604139
p03699
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); Integer n = scan.nextInt(); int[] a = new int[n]; for(int i = 0 ; i < n ; i++){ a[i] = sc.nextInt(); } int sum = 0; for(int i = 0 ; i < n ; i++){ sum += a[i]; } Arrays.sort(a); if(sum % 10 == 0) { for(int i = 0 ; i < n ; i++) { if((sum - a[i]) % 10 == 0){ continue; } System.out.println(sum - a[i]); return; } } else { System.out.println(sum); return; } System.out.println(0); } }
Main.java:9: error: cannot find symbol a[i] = sc.nextInt(); ^ symbol: variable sc location: class Main 1 error
s298592645
p03699
Java
import kotlin.collections.unsigned.UArraysKt; import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.Scanner; import java.util.stream.Collectors; import java.util.stream.IntStream; public class Main { public static void main(final String[] args) { final Scanner scanner = new Scanner(System.in); final int n = scanner.nextInt(); int sum = 0; final List<Integer> list = new ArrayList<>(); for (int i = 0; i < n; i++) { final int s = scanner.nextInt(); sum += s; list.add(s); } list.sort(Comparator.comparingInt(Integer::intValue)); if (sum % 10 != 0) { System.out.println(sum); } else { for (final int value : list) { if (value % 10 != 0) { System.out.println(sum - value); return; } } System.out.println(0); } } }
Main.java:2: error: package kotlin.collections.unsigned does not exist import kotlin.collections.unsigned.UArraysKt; ^ 1 error
s572571099
p03699
C++
#include<iostream> #include<stdio.h> #include<vector> #include<algorithm> #include<set> #include<string> #include<map> #include<string.h> #include<complex> #include<math.h> #include<queue> #include <functional> #include<time.h> #include <stack> using namespace std; #define rep(i,a,n) for(int i=(a);i<(n);i++) #define ll long long #define llint long long int #define sort(s) sort(s.begin(),s.end()) #define reverse(v) reverse(v.begin(), v.end()); #define Yes(ans) if(ans)cout<<"Yes"<<endl; else cout<<"No"<<endl; #define YES(ans) if(ans)cout<<"YES"<<endl; else cout<<"NO"<<endl; #define hei(a) vector<a> #define whei(a) vector<vector<int>> constexpr auto mod = 1000000007; //2のn乗を求めるよ!!! int ni(int n) { if (n == 0)return 1; int x = ni(n / 2); x *= x; if (n % 2 == 1)x *= 2; return x; } //フィボナッチ数列のx番目を求めるよ! int f(int x, vector<int> s) { if (x == 0)return 0; if (x == 1)return 1; if (s[x] != 0)return s[x]; s[x] = f(x - 1, s) + f(x - 2, s); return s[x]; } //aとbの最大公約数を求めるよ! llint gcd(llint a, llint b) { if (a < b)swap(a, b); if (b == 0)return a; return gcd(b, a % b); } // a^n mod を計算する long long modpow(long long a, long long n, long long mod) { long long res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } // mod. m での a の逆元 a^{-1} を計算するよ! long long modinv(long long a, long long m) { long long b = m, u = 1, v = 0; while (b) { long long t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } u %= m; if (u < 0) u += m; return u; } //aCbをmod.mで割った余りを求める ll int c(ll int a, ll int b, ll int m) { ll int ans = 1; for (ll int i = 0; i < b; i++) { ans *= a - i; ans %= m; } for (ll int i = 1; i <= b; i++) { ans *= modinv(i, m); ans %= m; } return ans; } //m進数のn桁を全列挙やで void dfs(int m, int n) { stack<string> st; st.push(""); while (!st.empty()) { string now = st.top(); st.pop(); if (now.size() == n) { cout << now << endl; } else { for (int i = m - 1; i >= 0; i--) { string next = now + to_string(i); st.push(next); } } } } int main() { int n; int sum = 0; cin >> n; hei(int) s(n); rep(i, 0, n) { cin >> s[i]; sum += s[i]; } sort(s); rep(i, 0, n) { if ((sum - s[i]) % 10 != 0&&(sum%10==0))sum -= s[i]; } if (sum % 10 == 0)sum = 0; } cout << sum << endl; return 0; }
a.cc:130:9: error: 'cout' does not name a type 130 | cout << sum << endl; | ^~~~ a.cc:134:9: error: expected unqualified-id before 'return' 134 | return 0; | ^~~~~~ a.cc:135:1: error: expected declaration before '}' token 135 | } | ^
s888956835
p03699
C++
#include<bits/stdc++.h> using namespace std; typedef long long int ll; int main() { int n; cin>>n; int s[n]; ll sum = 0; for(int i = 0; i < n; i++) { cin>>s[i]; sum += s[i]; } if(sum % 10 == 0) { bool all = true; for(int i = 0; i < n; i++) { if(s[i] % 10 != 0) { all = false; break; } } if(all) cout<<0; else { ll res = INT_MIN; for(int i = 0; i < n; i++) { int t = sum - s[i]; if(t % 10 == 0) continue; res = max(t, res); } } } else cout<<sum; return 0; }
a.cc: In function 'int main()': a.cc:37:26: error: no matching function for call to 'max(int&, ll&)' 37 | res = max(t, res); | ~~~^~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:37:26: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'}) 37 | res = max(t, res); | ~~~^~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:37:26: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 37 | res = max(t, res); | ~~~^~~~~~~~
s571106359
p03699
C++
#include <iostream> using namespace std; int main() { int n; cin >> n; int res[10] = {}; for (int i = 0; i < n; ++i) { int nr[10] = {}; int t; cin >> t; nr[t % 10] = res[0] + t; for (int j = 0; j < 10; ++j) { if (j == 0 || res[j]) { nr[(t + j) % 10] = res[j] + t; } } res = nr; } res[0] = 0; int ans(0); for (const int& i: res) ans = max(ans, i); cout << ans; return 0; }
a.cc: In function 'int main()': a.cc:17:9: error: invalid array assignment 17 | res = nr; | ~~~~^~~~
s429273842
p03699
C++
#include <iostream> using namespace std; int main(){ int n, su=0, i; cin >> n; int s[n]; for(i=0; i<n; i++){ cin >> s[i]; su+=s[i]; } sort(s, s+n); if(su%10!=0){ cout << su << endl; return 0; } for(i=0; i<n; i++) if(s[i]%10!=0){ cout << su-s[i] << endl; return 0; } cout << 0 << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(s, s+n); | ^~~~ | short
s255493224
p03699
C++
#include <iostream> using namespace std; int main(){ int n, su=0; cin >> n; int s[n]; for(i=0; i<n; i++){ cin >> s[i]; su+=s[i]; } sort(s, s+n); if(su%10!=0){ cout << su << endl; return 0; } for(i=0; i<n; i++) if(s[i]%10!=0){ cout << su-s[i] << endl; return 0; } cout << 0 << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:7: error: 'i' was not declared in this scope 7 | for(i=0; i<n; i++){ | ^ a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(s, s+n); | ^~~~ | short a.cc:16:7: error: 'i' was not declared in this scope 16 | for(i=0; i<n; i++) | ^
s717729769
p03699
C++
#include <iostream> using namespace std; int main() { int N; cin >> N; int s[110]; bool flag = true; int ans = 0; int minus; for (int i = 0; i < N; i++) { cin >> s[i]; if (s[i] % 10 != 0) flag = false; ans += s[i]; } if (flag) { cout << 0 << endl; return 0; } sort(s, s + N); if (ans % 10 == 0) { for (int i = 0; i < N; i++) { if ((ans - s[i]) % 10 != 0) { ans -= s[i]; break; } } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:22:3: error: 'sort' was not declared in this scope; did you mean 'short'? 22 | sort(s, s + N); | ^~~~ | short
s155916097
p03699
C++
n = int(input()) score = [] for _ in range(n): score.append(int(input())) score.sort() total = sum(score) counter = 0 while total%10 == 0 and counter < len(score): total -= score[counter] counter += 1; print(total)
a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^ a.cc:14:6: error: expected constructor, destructor, or type conversion before '(' token 14 | print(total) | ^
s818836500
p03699
C
#include <stdio.h> int main() { int sum = 0; int N; scanf("%d", &N); int h[N]; for (int i = 0; i < N; i++) { scanf("%d", &S[i]); } for (int i = 0; i < N; i++) { sum += S[i]; } while (sum % 10 == 0 && sum != 0) { int sub = 0; for (int i = 0; i < N; i++) { if (S[i] < S[sub] && S[i] % 10 != 0) { sub = i; } } sum -= S[sub]; } printf("%d\n", sum); return 0; }
main.c: In function 'main': main.c:11:22: error: 'S' undeclared (first use in this function) 11 | scanf("%d", &S[i]); | ^ main.c:11:22: note: each undeclared identifier is reported only once for each function it appears in
s019000010
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.at(i); sum+=S.at(i); } if(sum%10!=0) cout<<sum<<endl,; else{ bool flag=true; sort(S.begin(),S.end()); for(int i=0;i<N;i++){ sum-=S.at(i); if(sum%10!=0){ flag=false; cout<<sum<<endl; break; } } if(flag) cout<<"0"<<endl; } }
a.cc: In function 'int main()': a.cc:12:21: error: expected primary-expression before ';' token 12 | cout<<sum<<endl,; | ^
s641659888
p03699
C++
#include<bits/stdc++.h> using namespace std; using ll=long long; int main(){ int i,j,cnt; int n; cin>>n; int s[n]; for(i=0;i<n;i++)cin>>s[i]; sum=0; for(i=0;i<n;i++)sum+=s[i]; if(sum%10!=0){ cout<<sum; return 0; } int mi=INT_MAX; for(i=0;i<n;i++){ if(s[i]%10!=0){ mi=min(mi,s[i]); } } if(mi==INT_MAX)cout<<0; else cout<<sum-mi; }
a.cc: In function 'int main()': a.cc:11:3: error: 'sum' was not declared in this scope 11 | sum=0; | ^~~
s334385930
p03699
C++
#include <bits/stdc++.h> #include <iostream> #include <algorithm> #define rep(i,n) for (int i = 0;i < (n);++i) #define all(x) (x).begin(),(x).end() using namespace std; typedef long long ll; int main() { int N; cin >> N; vector<int> s(N); rep(i,N) cin>>s[i]; int ans = 0; rep(i,N) ans += s[i]; sort all(s); reverse all(s); int j = 0; while(ans%10==0){ ans = ans - s[j]; j++; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:5:16: error: no matching function for call to 'sort(std::vector<int>&)' 5 | #define all(x) (x).begin(),(x).end() | ^ a.cc:17:9: note: in expansion of macro 'all' 17 | sort all(s); | ^~~ 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:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)' 4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last) | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)' 4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last, | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 1 provided In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)' 292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)' 296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 1 provided a.cc:5:16: error: no matching function for call to 'reverse(std::vector<int>&)' 5 | #define all(x) (x).begin(),(x).end() | ^ a.cc:18:12: note: in expansion of macro 'all' 18 | reverse all(s); | ^~~ /usr/include/c++/14/bits/stl_algo.h:1083:5: note: candidate: 'template<class _BIter> void std::reverse(_BIter, _BIter)' 1083 | reverse(_BidirectionalIterator __first, _BidirectionalIterator __last) | ^~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1083:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate: 'template<class _ExecutionPolicy, class _BidirectionalIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator)' 249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last); | ^~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate expects 3 arguments, 1 provided
s366566555
p03699
C++
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0;i < (n);++i) #define all(x) (x).begin(),(x).end() using namespace std; typedef long long ll; int main() { int N; cin >> N; vector<int> s(N); rep(i,N) cin>>s[i]; int ans = 0; rep(i,N) ans += s[i]; sort all(s); reverse all(s); int j = 0; while(ans%10==0){ ans = ans - s[j]; j++; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:3:16: error: no matching function for call to 'sort(std::vector<int>&)' 3 | #define all(x) (x).begin(),(x).end() | ^ a.cc:15:9: note: in expansion of macro 'all' 15 | sort all(s); | ^~~ 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:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)' 4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last) | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)' 4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last, | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 1 provided In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)' 292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)' 296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 1 provided a.cc:3:16: error: no matching function for call to 'reverse(std::vector<int>&)' 3 | #define all(x) (x).begin(),(x).end() | ^ a.cc:16:12: note: in expansion of macro 'all' 16 | reverse all(s); | ^~~ /usr/include/c++/14/bits/stl_algo.h:1083:5: note: candidate: 'template<class _BIter> void std::reverse(_BIter, _BIter)' 1083 | reverse(_BidirectionalIterator __first, _BidirectionalIterator __last) | ^~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1083:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate: 'template<class _ExecutionPolicy, class _BidirectionalIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator)' 249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last); | ^~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate expects 3 arguments, 1 provided
s831514917
p03699
C++
#include<bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0); cin.tie(0), cout.tie(0) #define ll long long int #define ld long double #define fr first #define se second #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() #define sz(v) (int)v.size() #define sunq(v) sort(all(v));v.resize(distance(v.begin(),unique(all(v)))) #define pb push_back #define mp make_pair #define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr) #define emla(a, val) memset(a, val, sizeof(a)) #define easm(a, b) (a + b - 1) /b #define PI 3.141592653589793238 ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;} ll lcm(ll a,ll b) {return a*b/gcd(a,b);} //bool valid(int i, int j){return i >= 0 && i < n && j >= 0 && j < m;} int n, s; int main() { //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); //clock_t z = clock(); cin >> n; while(n--){ int x; cin >> x; s += x; } if(x%10 == 0)cout << 0 << endl; else cout << s << endl; //debug("Total Time: %.3f\n", (double)(clock() - z) / CLOCKS_PER_SEC); /* *try tricky test cases: -bounds -small input (0, 1) -big input -random tests */ return 0; }
a.cc: In function 'int main()': a.cc:51:6: error: 'x' was not declared in this scope 51 | if(x%10 == 0)cout << 0 << endl; | ^
s569385364
p03699
C
#include<stdio.h> void sort(int n, int S[n]) { int i, j; int tmp; for(i = 0; i < n - 1; i ++){ for(j = n - 1; j > i; j--){ if(S[j - 1] > S[j]){ tmp = S[j - 1]; S[j - 1] = S[j]; S[j] = tmp; } } } } int main() { int n; scanf("%d", &n); int S[n]; int i; int sum = 0; for(i = 0; i < n; i++){ scanf("%d", &S[i]); sum += S[i]; } sort(n, S); i = 0; while(sum % 10 == 0){ if(S[i] % 10 != 0){ sum -= S[i]; } i++; if(i == n){ break; } } printf("%d\n", ); return 0; }
main.c: In function 'main': main.c:46:20: error: expected expression before ')' token 46 | printf("%d\n", ); | ^
s952588384
p03699
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n,s,sm=0,mn=100; cin>>n; for (int i=0;i<n;i++) { cin>>s; sm+=s; if (m%10) mn=min(mn,s); } if (sm%10) cout<<sm<<endl; else if (mn!=100) cout<<sm-mn<<endl; else cout<<0<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:13: error: 'm' was not declared in this scope 11 | if (m%10) | ^
s188716931
p03699
C++
#include<cstdio> #include<algorithm> using namespace std; int dp[101][10001]; int main(void){ int n; int box[100]; int sum; int i,j; int MAX; scanf("%d",&n); sum=0; for(i=0;i<n;i++){ scanf("%d",&box[i]); sum+=box[i]; for(i=0;i<=n;i++){ for(j=0;j<=sum;j++){ dp[i][j]=0; } } for(i=0;i<n;i++){ for(j=0;j<=sum;j++){ //printf("j+box[i]=%d\n",j+box[i]); dp[i+1][j+box[i]]=max(dp[i+1][j+box[i]],dp[i][j]+box[i]); } } MAX=0; for(i=0;i<=sum;i++) if(dp[n][i]%10!=0)MAX=max(MAX,dp[n][i]); printf("%d\n",MAX); return 0; }
a.cc: In function 'int main()': a.cc:31:2: error: expected '}' at end of input 31 | } | ^ a.cc:5:15: note: to match this '{' 5 | int main(void){ | ^
s155188210
p03699
C++
hoge
a.cc:1:1: error: 'hoge' does not name a type 1 | hoge | ^~~~
s176307084
p03699
C++
=#include<iostream> #include<string> #include<cstdio> #include<cstring> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<map> #include<set> #include<complex> #include<bitset> #include<stack> #include<unordered_map> #include<utility> #include<cassert> using namespace std; typedef long long ll; typedef unsigned long long ul; typedef unsigned int ui; typedef long double ld; const ll mod = 1000000007; const ll INF = mod * mod; #define rep(i,n) for(int i=0;i<n;i++) #define per(i,n) for(int i=n-1;i>=0;i--) #define Rep(i,sta,n) for(int i=sta;i<n;i++) #define rep1(i,n) for(int i=1;i<=n;i++) #define per1(i,n) for(int i=n;i>=1;i--) #define Rep1(i,sta,n) for(int i=sta;i<=n;i++) typedef complex<ld> Point; const ld eps = 1e-8; const ld pi = acos(-1.0); typedef pair<int, int> P; typedef pair<ld, ld> LDP; typedef pair<ll, ll> LP; typedef vector<int> vec; typedef vector<string> svec; #define fr first #define sc second #define all(c) c.begin(),c.end() #define pb push_back //#define int long long void solve() { int N; cin >> N; int s[110]; rep(i, N) cin >> s[i]; int dp[110][100100]; memset(dp, 0, sizeof(dp)); dp[0][0] = 1; rep(i, N) { rep(j, 100100) { dp[i + 1][j] += dp[i][j]; if(j - s[i] >= 0) dp[i + 1][j] += dp[i][j - s[i]]; } } int ans = 0; rep(j, 100100) { if(dp[N][j] > 0) { ans = j; } } cout << ans << endl; } signed main() { ios::sync_with_stdio(false); cin.tie(0); //cout << fixed << setprecision(10); //init(); solve(); //cout << "finish" << endl; return 0; }
a.cc:1:2: error: stray '#' in program 1 | =#include<iostream> | ^ a.cc:1:1: error: expected unqualified-id before '=' token 1 | =#include<iostream> | ^ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from a.cc:2: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/char_traits.h:50: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:144:61: error: 'std::size_t' has not been declared 144 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:146:40: error: 'size_t' in namespace 'std' does not name a type 146 | static _GLIBCXX14_CONSTEXPR std::size_t | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:150:34: error: 'std::size_t' has not been declared 150 | find(const char_type* __s, std::size_t __n, const char_type& __a); | ^~~ /usr/include/c++/14/bits/char_traits.h:153:52: error: 'std::size_t' has not been declared 153 | move(char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:156:52: error: 'std::size_t' has not been declared 156 | copy(char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:159:30: error: 'std::size_t' has not been declared 159 | assign(char_type* __s, std::size_t __n, char_type __a); | ^~~ /usr/include/c++/14/bits/char_traits.h:187:59: error: 'std::size_t' has not been declared 187 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n) | ^~~ /usr/include/c++/14/bits/char_traits.h: In static member function 'static constexpr int __gnu_cxx::char_traits<_CharT>::compare(const char_type*, const char_type*, int)': /usr/include/c++/14/bits/char_traits.h:189:17: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 189 | for (std::size_t __i = 0; __i < __n; ++__i) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:189:33: error: '__i' was not declared in this scope; did you mean '__n'? 189 | for (std::size_t __i = 0; __i < __n; ++__i) | ^~~ | __n /usr/include/c++/14/bits/char_traits.h: At global scope: /usr/include/c++/14/bits/char_traits.h:198:31: error: 'size_t' in namespace 'std' d
s353342023
p03699
C++
#include<iostream> #include<string> #include<cstdio> #include<cstring> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<map> #include<set> #include<complex> #include<bitset> #include<stack> #include<unordered_map> #include<utility> #include<cassert> using namespace std; typedef long long ll; typedef unsigned long long ul; typedef unsigned int ui; typedef long double ld; const ll mod = 1000000007; const ll INF = mod * mod; #define rep(i,n) for(int i=0;i<n;i++) #define per(i,n) for(int i=n-1;i>=0;i--) #define Rep(i,sta,n) for(int i=sta;i<n;i++) #define rep1(i,n) for(int i=1;i<=n;i++) #define per1(i,n) for(int i=n;i>=1;i--) #define Rep1(i,sta,n) for(int i=sta;i<=n;i++) typedef complex<ld> Point; const ld eps = 1e-8; const ld pi = acos(-1.0); typedef pair<int, int> P; typedef pair<ld, ld> LDP; typedef pair<ll, ll> LP; typedef vector<int> vec; typedef vector<string> svec; #define fr first #define sc second #define all(c) c.begin(),c.end() #define pb push_back //#define int long long void solve() { int N; cin >> N; vector<int> s(N); int sum = 0; set<int> se; rep(i, N) { cin >> s[i]; sum += s[i]; if(s[i] % 10 != 0)se.insert(s[i]); } if(sum % 10 != 0) { cout << sum << endl; } else { if(se.size() == 0) { cout << 0 << endl; } else { cout << sum - se[0] << endl; } } } signed main() { ios::sync_with_stdio(false); cin.tie(0); //cout << fixed << setprecision(10); //init(); solve(); //cout << "finish" << endl; return 0; }
a.cc: In function 'void solve()': a.cc:65:29: error: no match for 'operator[]' (operand types are 'std::set<int>' and 'int') 65 | cout << sum - se[0] << endl; | ^
s496945653
p03699
C++
#include <vector> #include <algorithm> using namespace std; vector<int> v; int N; int main(){ int sum = 0; cin >> N; v.resize(N); for(int i=0;i<N;i++){ cin >> v[i]; sum += v[i]; } if(sum % 10 != 0){ cout << sum << endl; return sum; } sort(v.begin(),v.end()); for(int i=0;i<N;i++){ if(v[i] % 10 != 0){ cout << sum - v[i] << endl; return 0; } } cout << 0 << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:5: error: 'cin' was not declared in this scope 11 | cin >> N; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include <algorithm> +++ |+#include <iostream> 3 | a.cc:18:9: error: 'cout' was not declared in this scope 18 | cout << sum << endl; | ^~~~ a.cc:18:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:18:24: error: 'endl' was not declared in this scope 18 | cout << sum << endl; | ^~~~ a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 2 | #include <algorithm> +++ |+#include <ostream> 3 | a.cc:24:13: error: 'cout' was not declared in this scope 24 | cout << sum - v[i] << endl; | ^~~~ a.cc:24:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:24:35: error: 'endl' was not declared in this scope 24 | cout << sum - v[i] << endl; | ^~~~ a.cc:24:35: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' a.cc:28:5: error: 'cout' was not declared in this scope 28 | cout << 0 << endl; | ^~~~ a.cc:28:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:28:18: error: 'endl' was not declared in this scope 28 | cout << 0 << endl; | ^~~~ a.cc:28:18: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s185506504
p03699
C++
// Created by liszt on 2019/07/28. #include<bits/stdc++.h> using namespace std; int main(){ int n,sum=0,i; cin>>n; vector<int> s(n),maxim(n); for(i=0;i<n;i++){ cin>>s[i]; sum+=s[i]; } if(sum%10!=0){ cout<<sum<<endl; return 0; } for(i=0;i<n;i++){ maxim.push_back(sum-a[i]); } sort(maxim.begin(),maxim.end()); for(i=n-1;i>=0;i--){ if(maxim[i]%10!=0){ cout<<maxim[i]<<endl; return 0; } } cout<<0<<endl; return 0; }
a.cc: In function 'int main()': a.cc:21:29: error: 'a' was not declared in this scope 21 | maxim.push_back(sum-a[i]); | ^
s322418834
p03699
C++
import sys n = int(input()) s = [int(input()) for i in range(n)] s.sort() ans = sum(s) for i in s: if(ans%10==0): ans -= i else: print(ans) sys.exit() print(ans)
a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s278296886
p03699
C
// うそ #include<stdio.h> #include<stdlib.h> int compare(const void* a, const void*b){ return *(int*)a - *(int*)b; } int main(void){ int n; scanf("%d", &n); int s[n]; int sum = 0; for(int i=0; i<n; i++){ scanf("%d", &s[i]); sum += s[i]; } qsort(score, n, sizeof(int), compare); int ans; int flag = 1; if(sum%10 != 0){ ans = sum; } else{ for(int i=0; i<n; i++){ if((sum-s[i])%10 != 0){ ans = sum-s[i]; flag = 0; break; } } } if(flag){ printf("%d\n", ans); }else{ printf("0\n"); } // int s[n+1]; // s[0] = 0; // for(int i=1; i<n+1; i++){ // s[i] = s[i-1] + score[i-1]; // printf("s[%d]:%d\n", i, s[i]); // } // int ans; // for(int i=n; i>=0; i--){ // if(s[i]%10 != 0){ // ans = s[i]; // break; // } // ans = s[i]; // } return 0; }
main.c: In function 'main': main.c:19:11: error: 'score' undeclared (first use in this function) 19 | qsort(score, n, sizeof(int), compare); | ^~~~~ main.c:19:11: note: each undeclared identifier is reported only once for each function it appears in
s928928440
p03699
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<int>sum(n); int sum1=0; for(int i=0; i<n; ++i){ int a=0; cin >> a; sum1 += a; sum.push_back(sum1); } for(int i=n-1; i>=0; i--){ if(sum[i]%10==0){ continue;} else if(sum[i]%10!==0) {cout << sum[i] << endl; break;} } }
a.cc: In function 'int main()': a.cc:18:24: error: expected primary-expression before '=' token 18 | else if(sum[i]%10!==0) | ^
s547881461
p03699
C++
#include <bits/stdc++.h> #define rep(i, N) for (int i = 0; i < N; i++) using namespace std; int main() { int N; cin >> N; vector<int> s(N); int sum = 0; rep(i, N) { cin >> s[i]; sum += s[i]; } if (sum % 10 != 0) { cout << sum << endl; return 0; } sort(s.begin(), s.end()); else { rep(i, N) { if (s[i] % 10 != 0) { cout << sum - s[i] << endl; return 0; } } } cout << 0 << endl; }
a.cc: In function 'int main()': a.cc:22:5: error: 'else' without a previous 'if' 22 | else | ^~~~
s295233195
p03699
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,s[n],sum=0; cin>>n; for(int i=0;i<n;i++) cin>>s[i]; sum+=s[i]; if(sum%10==0){ int t=INT_MAX; for(int i=0;i<n;i++){ if(a[i]%10!=0)t=min(t,a[i]); } sum-=t; } cout<<max(0,sum)<<endl; }
a.cc: In function 'int main()': a.cc:6:42: error: 'i' was not declared in this scope 6 | for(int i=0;i<n;i++) cin>>s[i]; sum+=s[i]; | ^ a.cc:10:10: error: 'a' was not declared in this scope 10 | if(a[i]%10!=0)t=min(t,a[i]); | ^
s044144533
p03699
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int x = 0; vector<int> a(n); for(int i=0;i<n;i++){ cin >> a.at(i); x += a.at(i); } sort(a.begin(), a.end()); if(x%10 != 0){ cout << x << endl; } else { int j=0; while(a.at(j)%10 == 0 && i<n){ j++; } if(a.at(j)%10 == 0){ a.at(j) = x; } cout << x - a.at(j) << endl; } }
a.cc: In function 'int main()': a.cc:21:30: error: 'i' was not declared in this scope 21 | while(a.at(j)%10 == 0 && i<n){ | ^
s160712751
p03699
C++
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) #define all(x) x.begin(),x.end() #define rall(x) x.rbegin(),x.rend() #define print(s) cout << s << endl #define acc(v) accumulate(v.begin(), v.end(), 0) #define cinv(n,v) rep(i,n) cin >> v[i] using namespace std; const int INF = 1e9; typedef long long ll; typedef vector<int> vint; typedef vector<string> vstr; typedef vector<char> vchar; const ll LINF = 1e18; const ll MOD = 1e9 + 7; // const lint MOD = 998244353; int x_pos[4] = {1,0,-1,0}, y_pos[4] = {0,1,0,-1}; int ctoi(char c) { if (c >= '0' && c <= '9') { return c - '0'; } return 0; } char upper(char c){ return c-0x20; } char lower(char c){ return c+0x20; } int gcd(int x, int y) { if (y == 0) return x; return gcd(y, x%y); } int lcm(int x, int y){ int g = gcd(x,y); return x/g*y; } int facctorialMethod(int k){ int sum = 1; for (int i = 1; i <= k; ++i) { sum = (sum%MOD*i%MOD)%MOD; } return sum; } int main(){ int n; cin >> n; int ans = 0, int m = MOD; rep(i,n){ int a; cin >> a; s += a; if (a%10){ m = min(m,a); } } if (s%10){ cout << s << endl; }else{ if (m == MOD){ cout << 0 << endl; }else{ cout << s - m << endl; } } }
a.cc: In function 'int main()': a.cc:52:22: error: expected unqualified-id before 'int' 52 | int ans = 0, int m = MOD; | ^~~ a.cc:55:17: error: 's' was not declared in this scope 55 | s += a; | ^ a.cc:57:25: error: 'm' was not declared in this scope 57 | m = min(m,a); | ^ a.cc:60:13: error: 's' was not declared in this scope 60 | if (s%10){ | ^ a.cc:63:21: error: 'm' was not declared in this scope 63 | if (m == MOD){ | ^
s137717120
p03699
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(void){ int N; cin >> N; vector<int>num(N,0); for(int i=0;i<N;i++){ cin >> num[i]; } sort(num.begun(),num.end()); int sum = 0; for(int i=0;i<N;i++){ sum += num[i]; } if(sum % 10 != 0) cout << sum << endl; else{ bool all = true; for(int i=0;i<N;i++){ if(num[i] % 10 != 0) all = false; } if(all) cout << 0 << endl; else{ for(int i=0;i<N;i++){ if(num[i] % 10 != 0){ sum -= num[i]; break; } } cout << sum << endl; } } return 0; }
a.cc: In function 'int main()': a.cc:14:12: error: 'class std::vector<int>' has no member named 'begun'; did you mean 'begin'? 14 | sort(num.begun(),num.end()); | ^~~~~ | begin
s800771387
p03699
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long N,u,c,ans; cin>>N; ans=100000000000; c=0; vector<long long>s(N); for(int i=0;i<N;i++){ cin>>s[i]; c+=s[i]; } if(c%10!=0){ cout<<c<<endl; return 0; } else{ for(int i=0;i<N-1;i++){ if(s[i]%10==0){ continue; } else{ cout<c-s[i]<<endl; return 0; } } } cout<<0<<endl; }
a.cc: In function 'int main()': a.cc:24:21: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<' 24 | cout<c-s[i]<<endl; | ~~~~~~^~~~~~
s092412824
p03699
C++
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<iomanip> #include<math.h> #include<complex> #include<queue> #include<deque> #include<stack> #include<map> #include<set> #include<bitset> #include <string.h> using namespace std; #define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i ) #define rep(i,n) REP(i,0,n) typedef long long ll; typedef pair<int,int> pint; typedef pair<ll,int> pli; const int inf=1e9+7; const ll longinf=1LL<<60 ; const ll mod=1e9+7 ; int dp[100100]; int ans; int m[1000]; int a[1000]; int n; bool flag; int ans; void solve(int K){ memset(dp,-1,sizeof(dp)); dp[0]=0; rep(i,n){ rep(j,K+1){ if(dp[j]>=0){ dp[j]=m[i]; }else if(j<a[i] || dp[j-a[i]]<=0){ dp[j]=-1; }else{ dp[j]=dp[j-a[i]]-1; } } } if(dp[K]>=0 && K%10!=0){ ans=max(ans,K); } } int main(){ int sum=0; flag=false; int N; cin >> N; vector<int> s(N); rep(i,N)cin >> s[i]; sort(s.begin(),s.end()); int temp=0; rep(i,N)sum+=s[i]; int cnt=0; while(temp<N){ m[cnt]=upper_bound(s.begin(),s.end(),s[temp])-lower_bound(s.begin(),s.end(),s[temp]); a[cnt]=s[temp]; temp=upper_bound(s.begin(),s.end(),s[temp])-s.begin(); cnt++; } n=cnt; for(int i=sum;i>=0;i--){ solve(i); if(flag || i==0){ cout << i << endl; return 0; } } return 0;}
a.cc:31:5: error: redefinition of 'int ans' 31 | int ans; | ^~~ a.cc:26:5: note: 'int ans' previously declared here 26 | int ans; | ^~~