submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s775209194
p00121
C++
#include <iostream> #include <vector> #include <string> #include <queue> #define INF 10000000 using namespace std; typedef pair<int,int> P; void swap(char *a,char *b){ char temp = *a; *a = *b; *b = temp; } int main(){ string input = ""; char temp; for(int i=0;i<8;i++){ cin >> temp; input.push_back(temp); } vector<string> que; queue<int> dist; que.push_back(input); dist.push(0); while(que.size()){ string q = que[0]; que.erase(que.begin()); if(q=="01234567"){ break; } int d = dist.front(); dist.pop(); for(int i=0;i<3;i++){ string next = q; swap(&next[i],&next[i+1]); if(find(que.begin(),que.end(),next)==que.end()){ que.push_back(next); dist.push(d+1); } next = q; swap(&next[i+4],&next[i+5]); if(find(que.begin(),que.end(),next)==que.end()){ que.push_back(next); dist.push(d+1); } } for(int i=0;i<4;i++){ string next = q; swap(&next[i],&next[i+4]); vector<string>::iterator pos; if(find(que.begin(),que.end(),next)==que.end()){ que.push_back(next); dist.push(d+1); } } } cout << dist.front() << endl; }
a.cc: In function 'int main()': a.cc:38:14: error: no matching function for call to 'find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, std::string&)' 38 | if(find(que.begin(),que.end(),next)==que.end()){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:38:14: note: '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' is not derived from 'std::istreambuf_iterator<_CharT>' 38 | if(find(que.begin(),que.end(),next)==que.end()){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:45:14: error: no matching function for call to 'find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, std::string&)' 45 | if(find(que.begin(),que.end(),next)==que.end()){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:45:14: note: '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' is not derived from 'std::istreambuf_iterator<_CharT>' 45 | if(find(que.begin(),que.end(),next)==que.end()){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:54:14: error: no matching function for call to 'find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, std::string&)' 54 | if(find(que.begin(),que.end(),next)==que.end()){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:54:14: note: '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' is not derived from 'std::istreambuf_iterator<_CharT>' 54 | if(find(que.begin(),que.end(),next)==que.end()){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
s885764310
p00121
C++
#include <iostream> #include <vector> #include <string> #include <queue> #include <map> #define INF 10000000 using namespace std; typedef pair<int,int> P; void swap(char *a,char *b){ char temp = *a; *a = *b; *b = temp; } int main(){ int dx[] = {+1,-1,+4,-4}; string start = "01234567"; queue<string> que; map<string,int> d; que.push(start); d[start] = 0; while(que.size()){ string q = que.front(); que.pop(); int x = q.find("0"); for(int i=0;i<4;i++){ int next = x + dx[i]; if( next>=0 && next<=7 && !(x==3&&next==4) && !(x==4&&next==3) ){ string nextq = q; swap(&nextq[x],&nextq[next]); if(d.find(nextq)==d.end()){ que.push(nextq); d[nextq] = d[q] + 1; } } } } while(1){ string input = ""; char temp; for(int i=0;i<8;i++){ if(cin >> temp){ input.push_back(temp); }else{ return 0; } } cout << d[input] << endl; } } }
a.cc:56:1: error: expected declaration before '}' token 56 | } | ^
s773738479
p00122
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #define REP(i,k,n) for(int i=k;i<n;i++) #define rep(i,n) for(int i=0;i<n;i++) #define pb push_back #define mp make_pair using namespace std; int dx[12] = {-1, 0, 1, 2, 2, 2, 1, 0,-1,-2,-2,-2}; int dy[12] = { 2, 2, 2, 1, 0,-1,-2,-2,-2,-1, 0,-1}; vector<pair<int,int> > v; bool ans = false; void dfs(int n,int i,int y,int x) { if(i == n) { ans = true; return; } else { bool flag = true; int f[10][10]; memset(f,0,sizeof(f)); REP(k,-1,2) { REP(l,-1,2) { int py = v[i].first + k; int px = v[i].second + l; if(0 <= py && py < 10 && 0 <= px && px < 10) { f[py][px] = 1; } } } rep(j,12) { int nx = x + dx[j]; int ny = y + dy[j]; if(0 <= ny && ny < 10 && 0<= nx && nx < 10) { if(f[ny][nx] == 1) { flag = true; dfs(n,i+1,ny,nx); } } } if(flag) return; } } int main() { while(true) { int x,y; cin >> x >> y; if(x == 0 && y == 0) break; v.clear(); ans = false; int n,sp_x,sp_y; cin >> n; rep(i,n) { cin >> sp_x >> sp_y; v.pb(mp(sp_y,sp_x)); } dfs(n,0,y,x); if(ans) cout << "OK" << endl; else cout << "NA" << endl; } return 0; }
a.cc: In function 'void dfs(int, int, int, int)': a.cc:29:17: error: 'memset' was not declared in this scope 29 | memset(f,0,sizeof(f)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <algorithm> +++ |+#include <cstring> 5 |
s028877653
p00122
C++
import std.stdio; import std.algorithm; import std.string; import std.range; import std.array; import std.conv; import std.complex; import std.math; import std.ascii; import std.bigint; import std.container; bool next(bool[][] m, int x, int y){ auto s = new bool[][](10+4, 10+4); foreach(i; -1..2){ foreach(j; -1..2){ s[x+i][y+j] = true; } } foreach(i; 0..10+4){ s[i][0] = false; s[i][1] = false; s[i][12] = false; s[i][13] = false; s[0][i] = false; s[1][i] = false; s[12][i] = false; s[13][i] = false; } auto t = new bool[][](14,14); foreach(i; 2..12) { foreach(j; 2..12) { if(m[i][j]){ t[i+2][j-1] = true; t[i+2][j] = true; t[i+2][j+1] = true; t[i-2][j-1] = true; t[i-2][j] = true; t[i-2][j+1] = true; t[i-1][j+2] = true; t[i][j+2] = true; t[i+1][j+2] = true; t[i-1][j-2] = true; t[i][j-2] = true; t[i+1][j-2] = true; } } } bool ret; foreach(i; 2..12) { foreach(j; 2..12) { m[i][j] = t[i][j] && s[i][j]; ret |= m[i][j]; } } return ret; } void main() { auto xy = map!(to!int)(readln().strip().split()); while(xy[0]|xy[1]){ auto m = new bool[][](10+4,10+4); m[xy[0]+2][xy[1]+2] = true; int n = to!int(readln().strip()); auto s = map!(to!int)(readln().strip().split()); bool f = true; foreach(i; 0..n){ f &= next(m, s[i*2]+2, s[i*2+1]+2); } writeln(f?"OK":"NA"); xy = map!(to!int)(readln().strip().split()); } }
a.cc:15:21: error: too many decimal points in number 15 | foreach(i; -1..2){ | ^~~~ a.cc:16:29: error: too many decimal points in number 16 | foreach(j; -1..2){ | ^~~~ a.cc:20:20: error: too many decimal points in number 20 | foreach(i; 0..10+4){ | ^~~~~ a.cc:31:20: error: too many decimal points in number 31 | foreach(i; 2..12) { | ^~~~~ a.cc:32:28: error: too many decimal points in number 32 | foreach(j; 2..12) { | ^~~~~ a.cc:50:20: error: too many decimal points in number 50 | foreach(i; 2..12) { | ^~~~~ a.cc:51:28: error: too many decimal points in number 51 | foreach(j; 2..12) { | ^~~~~ a.cc:67:28: error: too many decimal points in number 67 | foreach(i; 0..n){ | ^~~~ a.cc:1:1: error: 'import' does not name a type 1 | import std.stdio; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import std.algorithm; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import std.string; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: 'import' does not name a type 4 | import std.range; | ^~~~~~ a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:1: error: 'import' does not name a type 5 | import std.array; | ^~~~~~ a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:6:1: error: 'import' does not name a type 6 | import std.conv; | ^~~~~~ a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:7:1: error: 'import' does not name a type 7 | import std.complex; | ^~~~~~ a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:8:1: error: 'import' does not name a type 8 | import std.math; | ^~~~~~ a.cc:8:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:9:1: error: 'import' does not name a type 9 | import std.ascii; | ^~~~~~ a.cc:9:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:10:1: error: 'import' does not name a type 10 | import std.bigint; | ^~~~~~ a.cc:10:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:11:1: error: 'import' does not name a type 11 | import std.container; | ^~~~~~ a.cc:11:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:13:18: error: multidimensional array must have bounds for all dimensions except the first 13 | bool next(bool[][] m, int x, int y){ | ^ a.cc:13:20: error: expected ',' or '...' before 'm' 13 | bool next(bool[][] m, int x, int y){ | ^ a.cc: In function 'bool next(...)': a.cc:14:29: error: expected primary-expression before ']' token 14 | auto s = new bool[][](10+4, 10+4); | ^ a.cc:15:17: error: 'i' was not declared in this scope 15 | foreach(i; -1..2){ | ^ a.cc:20:18: error: expected ')' before ';' token 20 | foreach(i; 0..10+4){ | ~ ^ | ) a.cc:30:29: error: expected primary-expression before ']' token 30 | auto t = new bool[][](14,14); | ^ a.cc:31:18: error: expected ')' before ';' token 31 | foreach(i; 2..12) { | ~ ^ | ) a.cc:50:18: error: expected ')' before ';' token 50 | foreach(i; 2..12) { | ~ ^ | ) a.cc: At global scope: a.cc:59:1: error: '::main' must return 'int' 59 | void main() { | ^~~~ a.cc: In function 'int main()': a.cc:60:19: error: 'map' was not declared in this scope 60 | auto xy = map!(to!int)(readln().strip().split()); | ^~~ a.cc:62:37: error: expected primary-expression before ']' token 62 | auto m = new bool[][](10+4,10+4); | ^ a.cc:64:25: error: 'to' was not declared in this scope 64 | int n = to!int(readln().strip()); | ^~ a.cc:65:29: error: expected ',' or ';' before '!' token 65 | auto s = map!(to!int)(readln().strip().split()); | ^ a.cc:67:25: error: 'i' was not declared in this scope 67 | foreach(i; 0..n){ | ^ a.cc:70:17: error: 'writeln' was not declared in this scope 70 | writeln(f?"OK":"NA"); | ^~~~~~~
s547913386
p00122
C++
#include<bits/stdc++.h> #define mk make_pair using namespace std; int dx[]={2,2,2,1,1,0,0,-1,-1,-2,-2,-2}; int dy[]={1,0,-1,2,-2,2,-2,2,-2,1,0,-1}; int n,px,py,x,y; int main(){ while(cin>>px>>py,px+py){ cin>>n; vector<pair<int,int> >v; v.push_back(mk(px,py)); if(n==0)cout<<"NA"<<endl; else{ for(int o=0;o<n;o++){ set<pair<int,int> >se; vector<pair<int,int> >t; cin>>x>>y; for(int i=0;i<v.size();i++){ int sx=v[i].first,sy=v[i].second; for(int j=0;j<12;j++){ int gx=dx[j]+sx,gy=dy[j]+sy; if(abs(gx-x)<=1&&abs(gy-y)<=1&&gy>=0&&gx>=0&&gy<10&&gx<10){ if(se.count(mk(gx,gy)))continue; t.push_back(mk(gx,gy)); se.insert(mk(gx,gy)); } } }v=t; } if(dfs(px,py,0))cout<<"OK"<<endl; else cout<<"NA"<<endl;} } }
a.cc: In function 'int main()': a.cc:30:8: error: 'dfs' was not declared in this scope; did you mean 'ffs'? 30 | if(dfs(px,py,0))cout<<"OK"<<endl; | ^~~ | ffs
s098645361
p00122
C++
#include <iostream> #include <vector> #include <algorithm> #include <cstdio> #include <queue> using namespace std; typedef pair<int, int> P; typedef pair<int, P> S; const int dx[] = {-2, -2, -2, -1, 0, 1, 2, 2, 2, 1, 0, -1}; const int dy[] = {-1, 0, 1, 2, 2, 2, 1, 0, -1, -2 , -2, -2 }; bool check(int x, int y) { return (x >= 0 && x < 10 && y >= 0 && y < 10); } int main() { int sx, sy, n; int field[10][10]; while(cin >> sx >> sy && sx && sy) { cin >> n; vector<P> v(n); memset(field, 0, 10 * 10); for(int k = 0; k < n; k++) { int x, y; cin >> x >> y; for(int i = -1; i <= 1; i++) for(int j = -1; j <= 1; j++) if(check(x + j, y + i)) field[y + i][x + j] += 1 << k; } queue<S> que; que.push(S(0, P(sx, sy))); bool ok = false; while(!que.empty()) { S s = que.front(); que.pop(); P p = s.second; int c = s.first, x = p.first, y = p.second; if(c == n - 1) { ok = true; break; } for(int i = 0; i < 12; i++) { int xx = x + dx[i], yy = y + dy[i]; if(!check(xx, yy)) continue; if(field[yy][xx] & c == c) que.push(S(c + 1, P(xx, yy))); } } cout << ((ok) ? "OK" : "NA") << endl; } }
a.cc: In function 'int main()': a.cc:26:9: error: 'memset' was not declared in this scope 26 | memset(field, 0, 10 * 10); | ^~~~~~ a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include <queue> +++ |+#include <cstring> 6 |
s972014749
p00122
C++
NA: mlst.clear(); nxt.clear(); for(i=0;i<10;i++){ for(j=0;j<10;j++){ mp[i][j].clear(); } } }while(1); return 0; }
a.cc:1:4: error: found ':' in nested-name-specifier, expected '::' 1 | NA: | ^ | :: a.cc:1:2: error: 'NA' does not name a type 1 | NA: | ^~ a.cc:3:5: error: 'nxt' does not name a type 3 | nxt.clear(); | ^~~ a.cc:4:5: error: expected unqualified-id before 'for' 4 | for(i=0;i<10;i++){ | ^~~ a.cc:4:13: error: 'i' does not name a type 4 | for(i=0;i<10;i++){ | ^ a.cc:4:18: error: 'i' does not name a type 4 | for(i=0;i<10;i++){ | ^ a.cc:10:3: error: expected declaration before '}' token 10 | }while(1); | ^ a.cc:10:4: error: expected unqualified-id before 'while' 10 | }while(1); | ^~~~~ a.cc:11:3: error: expected unqualified-id before 'return' 11 | return 0; | ^~~~~~ a.cc:12:1: error: expected declaration before '}' token 12 | } | ^
s569877037
p00122
C++
return 1; } } return 0;//‚Ç‚¤‚ ‚ª‚¢‚Ä‚àâ–] } int main(){ int posX, posY; while(std::cin >> posX >> posY, posX && posY){ std::cin >> n; for(int i=0;i<n;i++){ int wposX, wposY; std::cin >> wposX >> wposY; wpos[i] = P(wposX, wposY); } if(dfs(posX, posY, 0))puts("OK"); else puts("NA"); } }
a.cc:1:33: error: expected unqualified-id before 'return' 1 | return 1; | ^~~~~~ a.cc:2:17: error: expected declaration before '}' token 2 | } | ^ a.cc:3:9: error: expected declaration before '}' token 3 | } | ^ a.cc:5:9: error: expected unqualified-id before 'return' 5 | return 0;//‚Ç‚¤‚ ‚ª‚¢‚Ä‚àâ–] | ^~~~~~ a.cc:6:1: error: expected declaration before '}' token 6 | } | ^ a.cc: In function 'int main()': a.cc:10:20: error: 'cin' is not a member of 'std' 10 | while(std::cin >> posX >> posY, posX && posY){ | ^~~ a.cc:1:8: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | return 1; a.cc:11:22: error: 'cin' is not a member of 'std' 11 | std::cin >> n; | ^~~ a.cc:11:22: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:11:29: error: 'n' was not declared in this scope 11 | std::cin >> n; | ^ a.cc:14:30: error: 'cin' is not a member of 'std' 14 | std::cin >> wposX >> wposY; | ^~~ a.cc:14:30: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:15:25: error: 'wpos' was not declared in this scope; did you mean 'wposY'? 15 | wpos[i] = P(wposX, wposY); | ^~~~ | wposY a.cc:15:35: error: 'P' was not declared in this scope 15 | wpos[i] = P(wposX, wposY); | ^ a.cc:18:20: error: 'dfs' was not declared in this scope 18 | if(dfs(posX, posY, 0))puts("OK"); | ^~~ a.cc:18:39: error: 'puts' was not declared in this scope 18 | if(dfs(posX, posY, 0))puts("OK"); | ^~~~ a.cc:19:22: error: 'puts' was not declared in this scope 19 | else puts("NA"); | ^~~~
s732530322
p00122
C++
g#include <iostream> #include <cmath> #include <cstring> #include <deque> using namespace std; #define MAX_YX 10 int park[MAX_YX][MAX_YX]; int n; int sy, sx; int dy[] = {-2, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 2}; int dx[] = {-1, 0, 1, -2, 2, -2, 2, -2, 2, -1, 0, 1}; bool dfs(int y, int x, int t) { if (t == n) { if ((park[y][x] >> (n-1)) & 1) return true; else return false; } for (int i = 0; i < 12; i++) { int ny = y + dy[i]; int nx = x + dx[i]; if (0 <= ny && ny < MAX_YX && 0 <= nx && nx < MAX_YX && ((park[ny][nx] >> t) & 1)) { if (dfs(ny, nx, t+1)) return true; } } return false; } int main() { while (cin >> sx >> sy, sx || sy) { cin >> n; memset(park, 0, sizeof(park)); for (int i = 0; i < n; i++) { int spx, spy; cin >> spx >> spy; for (int j = spy-1; j <= spy+1; j++) { for (int k = spx-1; k <= spx+1; k++) { if (0 <= j && j < MAX_YX && 0 <= k && k < MAX_YX) { park[j][k] |= (1 << i); } } } } if (dfs(sy, sx, 0)) { cout << "OK" << endl; } else { cout << "NG" << endl; } } return 0; }
a.cc:1:2: error: stray '#' in program 1 | g#include <iostream> | ^ a.cc:1:1: error: 'g' does not name a type 1 | g#include <iostream> | ^ In file included from /usr/include/c++/14/cmath:45, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std' 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/bits/specfun.h:43, from /usr/include/c++/14/cmath:3906: /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/stdlib.h:32, from /usr/include/c++/14/bits/std_abs.h:38, from /usr/include/c++/14/cmath:49: /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; | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:65: /usr/include/c++/14/bits/stl_iterator_base_types.h:125:67: error: 'ptrdiff_t' does not name a type 125 | template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t, | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:1:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' +++ |+#include <cstddef> 1 | // Types used in iterator implementation -*- C++ -*- /usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: error: 'ptrdiff_t' does not name a type 214 | typedef ptrdiff_t difference_type; | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: error: 'ptrdiff_t' does not name a type 225 | typedef ptrdiff_t difference_type; | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' In file included from /usr/include/c++/14/bits/stl_algobase.h:66: /usr/include/c++/14/bits/stl_iterator_base_funcs.h:112:5: error: 'ptrdiff_t' does not name a type 112 | ptrdiff_t | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:66:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 65 | #include <debug/assertions.h> +++ |+#include <cstddef> 66 | #include <bits/stl_iterator_base_types.h> /usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: error: 'ptrdiff_t' does not name a type 118 | ptrdiff_t | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' In file included from /usr/include/c++/14/bits/stl_iterator.h:67, from
s731853977
p00123
Java
ublic class Main { double[] grade_500 = {35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0}; double[] grade_1000 = {71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0}; String[] grade = {"AAA", "AA", "A", "B", "C", "D", "E"}; public void solve() throws IOException{ while( stdIn.hasNext() ){ double x = stdIn.nextDouble(); double y = stdIn.nextDouble(); int g1 = 7; int g2 = 7; for(int i = 0; i < 7; i++){ if( x < grade_500[i] ){ g1 = i; break; } } for(int i = 0; i < 7; i++){ if( y < grade_1000[i] ){ g2 = i; break; } } int index = Math.max(g1, g2); if( index == 7 ){ writer.println("NA"); } else { writer.println(grade[index]); } writer.flush(); } // writer.flush(); } public static void main (String args[]) throws IOException { new Main().run(); } Scanner stdIn; PrintWriter writer; public void run() throws IOException{ stdIn = null; try{ stdIn = new Scanner(new BufferedReader(new InputStreamReader(System.in))); writer = new PrintWriter(System.out); solve(); stdIn.close(); writer.close(); } catch (Exception e){ e.printStackTrace(); System.exit(1); } } }
Main.java:1: error: class, interface, enum, or record expected ublic class Main { ^ 1 error
s964511372
p00123
C
int main(void) { float a, b; while (scanf("%f %f", &a, &b) != EOF){ if ( a < 35.5 && b < 71){ printf("AAA\n"); } else if ( a < 37.5 && b < 77){ printf("AA\n"); } else if ( a < 40 && b < 83){ printf("A\n"); } else if ( a < 43 && b < 89){ printf("B\n"); } else if ( a < 50 && b < 105){ printf("C\n"); } else if ( a < 55 && b < 114){ printf("D\n"); } else if ( a < 70 && b < 148){ printf("E\n"); } else { printf("NA\n"); } } return (0); }
main.c: In function 'main': main.c:5:16: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 5 | while (scanf("%f %f", &a, &b) != EOF){ | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(void) main.c:5:16: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 5 | while (scanf("%f %f", &a, &b) != EOF){ | ^~~~~ main.c:5:16: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:5:42: error: 'EOF' undeclared (first use in this function) 5 | while (scanf("%f %f", &a, &b) != EOF){ | ^~~ main.c:5:42: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:5:42: note: each undeclared identifier is reported only once for each function it appears in main.c:8:25: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 8 | printf("AAA\n"); | ^~~~~~ main.c:8:25: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:8:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:8:25: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:11:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 11 | printf("AA\n"); | ^~~~~~ main.c:11:25: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:14:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 14 | printf("A\n"); | ^~~~~~ main.c:14:25: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:17:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 17 | printf("B\n"); | ^~~~~~ main.c:17:25: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:20:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 20 | printf("C\n"); | ^~~~~~ main.c:20:25: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:23:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 23 | printf("D\n"); | ^~~~~~ main.c:23:25: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:26:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 26 | printf("E\n"); | ^~~~~~ main.c:26:25: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:29:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 29 | printf("NA\n"); | ^~~~~~ main.c:29:25: note: include '<stdio.h>' or provide a declaration of 'printf'
s400345094
p00123
C
#include<stdioh> int main(void) { double a, b; scanf("%f %f",&a,&b); if(a <= 35.5) if(b <= 71.0) printf("AAA\n"); else if(b <= 77.0) printf("AA\n"); else if(b <= 83.0) printf("A\n"); else if(b <= 89.0) printf("B\n"); else if(b <= 105.0); printf("C\n"); else if(b <= 116.0) printf("D\n") else if(b <= 148.0) printf("E\n"); else printf("NA\n"); else if(a <= 37.5) if(b <= 77.0) printf("AA\n"); else if(b <= 83.0) printf("A\n"); else if(b <= 89.0) printf("B\n"); else if(b <= 105.0); printf("C\n"); else if(b <= 116.0) printf("D\n") else if(b <= 148.0) printf("E\n"); else printf("NA\n"); else if(a <= 40.0) if(b <= 83.0) printf("A\n"); else if(b <= 89.0) printf("B\n"); else if(b <= 105.0); printf("C\n"); else if(b <= 116.0) printf("D\n") else if(b <= 148.0) printf("E\n"); else printf("NA\n"); else if(a <= 43.0) if(b <= 89.0) printf("B\n"); else if(b <= 105.0); printf("C\n"); else if(b <= 116.0) printf("D\n") else if(b <= 148.0) printf("E\n"); else printf("NA\n"); else if(a <= 50.0) if(b <= 105.0); printf("C\n"); else if(b <= 116.0) printf("D\n") else if(b <= 148.0) printf("E\n"); else printf("NA\n"); else if(a <= 55.0) if(b <= 116.0) printf("D\n") else if(b <= 148.0) printf("E\n"); else printf("NA\n"); else if(a <= 70.0) if(b <= 148.0) printf("E\n"); else printf("NA\n"); else printf("NA\n"); return 0; }
main.c:1:9: fatal error: stdioh: No such file or directory 1 | #include<stdioh> | ^~~~~~~~ compilation terminated.
s329474231
p00123
C
#include<stdio.h> int main(void) { double a, b; scanf("%f %f",&a,&b); if(a <= 35.5) if(b <= 71.0) printf("AAA\n"); else if(b <= 77.0) printf("AA\n"); else if(b <= 83.0) printf("A\n"); else if(b <= 89.0) printf("B\n"); else if(b <= 105.0); printf("C\n"); else if(b <= 116.0) printf("D\n") else if(b <= 148.0) printf("E\n"); else printf("NA\n"); else if(a <= 37.5) if(b <= 77.0) printf("AA\n"); else if(b <= 83.0) printf("A\n"); else if(b <= 89.0) printf("B\n"); else if(b <= 105.0); printf("C\n"); else if(b <= 116.0) printf("D\n") else if(b <= 148.0) printf("E\n"); else printf("NA\n"); else if(a <= 40.0) if(b <= 83.0) printf("A\n"); else if(b <= 89.0) printf("B\n"); else if(b <= 105.0); printf("C\n"); else if(b <= 116.0) printf("D\n") else if(b <= 148.0) printf("E\n"); else printf("NA\n"); else if(a <= 43.0) if(b <= 89.0) printf("B\n"); else if(b <= 105.0); printf("C\n"); else if(b <= 116.0) printf("D\n") else if(b <= 148.0) printf("E\n"); else printf("NA\n"); else if(a <= 50.0) if(b <= 105.0); printf("C\n"); else if(b <= 116.0) printf("D\n") else if(b <= 148.0) printf("E\n"); else printf("NA\n"); else if(a <= 55.0) if(b <= 116.0) printf("D\n") else if(b <= 148.0) printf("E\n"); else printf("NA\n"); else if(a <= 70.0) if(b <= 148.0) printf("E\n"); else printf("NA\n"); else printf("NA\n"); return 0; }
main.c: In function 'main': main.c:20:49: error: 'else' without a previous 'if' 20 | else | ^~~~ main.c:22:78: error: expected ';' before 'else' 22 | printf("D\n") | ^ | ; 23 | else | ~~~~ main.c:28:9: error: 'else' without a previous 'if' 28 | else | ^~~~ main.c:41:49: error: 'else' without a previous 'if' 41 | else | ^~~~ main.c:43:78: error: expected ';' before 'else' 43 | printf("D\n") | ^ | ; 44 | else | ~~~~ main.c:49:17: error: 'else' without a previous 'if' 49 | else | ^~~~ main.c:59:49: error: 'else' without a previous 'if' 59 | else | ^~~~ main.c:61:78: error: expected ';' before 'else' 61 | printf("D\n") | ^ | ; 62 | else | ~~~~ main.c:67:25: error: 'else' without a previous 'if' 67 | else | ^~~~ main.c:74:49: error: 'else' without a previous 'if' 74 | else | ^~~~ main.c:76:78: error: expected ';' before 'else' 76 | printf("D\n") | ^ | ; 77 | else | ~~~~ main.c:82:33: error: 'else' without a previous 'if' 82 | else | ^~~~ main.c:86:49: error: 'else' without a previous 'if' 86 | else | ^~~~ main.c:88:78: error: expected ';' before 'else' 88 | printf("D\n") | ^ | ; 89 | else | ~~~~ main.c:94:41: error: 'else' without a previous 'if' 94 | else | ^~~~ main.c:97:78: error: expected ';' before 'else' 97 | printf("D\n") | ^ | ; 98 | else | ~~~~
s887606041
p00123
C
#include <stdio.h> int main() { double t1, t2; double t[7][2] = {{35.5, 71.0}, {37.5, 77.0}, {40.0, 83.0}, {43.0, 89.0}, {50.0, 105.0}, {55.0, 116.0}, {70.0, 148.0}}; int i1, k = -1; char kyu[8][5] = {"AAA", "AA", "A", "B", "C", "D", "E", "NA"}; // ??\?????\?????\??¨???????£??????? scanf("%lf %lf", &t1, &t2); // ????¬¢???????????? for (i1 = 0; i1 < 7 && k < 0; i1++) { if (t1 < t[i1][0] && t2 < t[i1][1]) k = i1; } if (k < 0) k = 7; printf("%s\n", kyu[k]); return 0; }
main.c:17:9: error: expected identifier or '(' before 'if' 17 | if (k < 0) | ^~ main.c:20:16: error: expected declaration specifiers or '...' before string constant 20 | printf("%s\n", kyu[k]); | ^~~~~~ main.c:20:24: error: unknown type name 'kyu' 20 | printf("%s\n", kyu[k]); | ^~~ main.c:22:9: error: expected identifier or '(' before 'return' 22 | return 0; | ^~~~~~ main.c:23:1: error: expected identifier or '(' before '}' token 23 | } | ^
s816754877
p00123
C
/*************************************/ /* ??\?????\?????\?????\??¬???????????±???006???????????????1?????? */ /* coded by Y.Suganuma */ /*************************************/ #include <stdio.h> int main() { double t1, t2; double t[7][2] = {{35.5, 71.0}, {37.5, 77.0}, {40.0, 83.0}, {43.0, 89.0}, {50.0, 105.0}, {55.0, 116.0}, {70.0, 148.0}}; int i1, k = -1; char kyu[8][5] = {"AAA", "AA", "A", "B", "C", "D", "E", "NA"}; // ??\?????\?????\??¨???????£??????? scanf("%lf %lf", &t1, &t2); // ????¬¢???????????? for (i1 = 0; i1 < 7 && k < 0; i1++) { if (t1 < t[i1][0] && t2 < t[i1][1]) k = i1; } if (k < 0) k = 7; printf("%s\n", kyu[k]); return 0; }
main.c:21:9: error: expected identifier or '(' before 'if' 21 | if (k < 0) | ^~ main.c:24:16: error: expected declaration specifiers or '...' before string constant 24 | printf("%s\n", kyu[k]); | ^~~~~~ main.c:24:24: error: unknown type name 'kyu' 24 | printf("%s\n", kyu[k]); | ^~~ main.c:26:9: error: expected identifier or '(' before 'return' 26 | return 0; | ^~~~~~ main.c:27:1: error: expected identifier or '(' before '}' token 27 | } | ^
s194095506
p00123
C
#include<stdio.h> int main(void) { float a,b; int c; while(0<c=scanf("%f %f",&a,&b)){ if(a>=70.00||b>=148.00) { printf("NA\n"); } else if(a<35.50&&b<71.00) { printf("AAA\n"); } else if(a<37.00&&b<77.00) { printf("AA\n"); } else if(a<40.00&&b<83.00) { printf("A\n"); } else if(a<43.00&&b<89.00) { printf("B\n"); } else if(a<50.00&&b<105.00) { printf("C\n"); } else if(a<55.00&&b<116.00) { printf("D\n"); } else { printf("E\n"); } } return 0; }
main.c: In function 'main': main.c:6:18: error: lvalue required as left operand of assignment 6 | while(0<c=scanf("%f %f",&a,&b)){ | ^
s125984913
p00123
C
#include<stdio.h> int main(void) { float a,b; int c; while(0<c=scanf("%f %f",&a,&b)) { if(a<35.50&&b<71.00) { printf("AAA\n"); } else if(a<37.00&&b<77.00) { printf("AA\n"); } else if(a<40.00&&b<83.00) { printf("A\n"); } else if(a<43.00&&b<89.00) { printf("B\n"); } else if(a<50.00&&b<105.00) { printf("C\n"); } else if(a<55.00&&b<116.00) { printf("D\n"); } else if(a<70.00&&b<148.00) { printf("E\n"); } else { printf("E\n"); } } return 0; }
main.c: In function 'main': main.c:6:18: error: lvalue required as left operand of assignment 6 | while(0<c=scanf("%f %f",&a,&b)) | ^
s609624540
p00123
C
include<stdio.h> int main(){ double a,b; int c,d,e; while(scanf("%lf %lf",&a,&b)!=EOF){ if(a<35.50)c=1; else if(a<37.50)c=2; else if(a<40.00)c=3; else if(a<43.00)c=4; else if(a<50.00)c=5; else if(a<55.00)c=6; else if(a<70.00)c=7; else c=0; if(b<71.00)d=1; else if(b<77.00)d=2; else if(b<83.00)d=3; else if(b<89.00)d=4; else if(b<105.00)d=5; else if(b<116.00)d=6; else if(b<148.00)d=7; else d=0; if(c==0||d==0)printf("NA\n"); else{ if(d>c)c=d; if(c==1)printf("AAA\n"); else if(c==2)printf("AA\n"); else printf("%c\n",c+'A'-3); } } return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^
s883089846
p00123
C
include <stdio.h> int main(){ double five=0, ten = 0; for(;;){ scanf("%lf %lf",&five, &ten); if(five < 35.5 && ten < 71.0){ printf("AAA/n"); } else if (five < 37.5 && ten < 77.0){ printf("AA/n"); } else if (five < 40.0 && ten < 83.0){ printf("A/n"); } else if (five < 43.0 && ten < 89.0){ printf("B\n"); } else if (five < 50.0 && ten < 105.0){ printf("C\n"); } else if (five < 55.0 && ten < 116.0){ printf("D\n"); } else if (five < 70.0 && ten < 148.0){ printf("E\n"); } else{ printf("NA\n"); } } return (0); }
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include <stdio.h> | ^
s295407629
p00123
C++
#include<stdio.h> #include<iostream> using namespace std; void TR(double x,double y,int K,int H) { int t; double X; X=x*100;t=(int)X; if(t<3550)K=0; else if(t<3550)K=0; else if(t<3750)K=1; else if(t<4000)K=2; else if(t<4300)K=3; else if(t<5000)K=4; else if(t<5500)K=5; else if(t<7000)K=6; else if(t>=7000)K=7; X=y*100;t=(int)X; if(t<3550)K=0; else if(t<7100)H=0; else if(t<7700)H=1; else if(t<8300)H=2; else if(t<8900)H=3; else if(t<10500)H=4; else if(t<11600)H=5; else if(t<14800)H=6; else if(t>=14800)H=7; } } int main(){ int K=0,H=0; double x,y; while(scanf("%lf %lf",&x,&y)!=EOF) {K=0,H=0; TR(x,y,K,H); if(H<K)H=K; switch(K){ case 0: cout<<"AAA"<<endl;break; case 1: cout<<"AA"<<endl;break; case 2: cout<<"A"<<endl;break; case 3: cout<<"B"<<endl;break; case 4: cout<<"C"<<endl;break; case 5: cout<<"D"<<endl;break; case 6: cout<<"E"<<endl;break; case 7: cout<<"NA"<<endl;break; } } return 0; }
a.cc:32:1: error: expected declaration before '}' token 32 | } | ^
s008521249
p00123
C++
#include<stdio.h> int main(main) { int a,b; scanf("%d %d",&a,&b); if(a<=35.5 && b<=71){ printf("AAA\n"); } else if(a<37.5 && b<77){ printf("AA\n"); } else if(a<40 && b<83){ printf("A\n"); } else if(a<43 && b<89){ printf("B\n"); } else if(a<50 && b<105){ printf("c\n"); } else if(a<55 && b<116){ printf("D\n"); } else if(a<60 && b<148){ printf("E\n"); } else{ printf("NA\n"); } return 0; }
a.cc:2:5: error: cannot declare '::main' to be a global variable 2 | int main(main) | ^~~~ a.cc:3:1: error: expected ',' or ';' before '{' token 3 | { | ^
s399904833
p00123
C++
#include<stdio.h> int main(main) { int a,b; while(scanf("%d %d",&a,&b)!=EOF){ if(a<=35.5 && b<=71){ printf("AAA\n"); } else if(a<37.5 && b<77){ printf("AA\n"); } else if(a<40 && b<83){ printf("A\n"); } else if(a<43 && b<89){ printf("B\n"); } else if(a<50 && b<105){ printf("c\n"); } else if(a<55 && b<116){ printf("D\n"); } else if(a<60 && b<148){ printf("E\n"); } else{ printf("NA\n"); } } return 0; }
a.cc:2:5: error: cannot declare '::main' to be a global variable 2 | int main(main) | ^~~~ a.cc:3:1: error: expected ',' or ';' before '{' token 3 | { | ^
s413325928
p00123
C++
#include<stdio.h> int main(main) { int a,b; while(scanf("%d %d",&a,&b)!=EOF){ if(a<=35.5 && b<=71){ printf("AAA\n"); } else if(a<37.5 && b<77){ printf("AA\n"); } else if(a<40 && b<83){ printf("A\n"); } else if(a<43 && b<89){ printf("B\n"); } else if(a<50 && b<105){ printf("c\n"); } else if(a<55 && b<116){ printf("D\n"); } else if(a<60 && b<148){ printf("E\n"); } else{ printf("NA\n"); } scanf("%d %d",&a,&b); } return 0; }
a.cc:2:5: error: cannot declare '::main' to be a global variable 2 | int main(main) | ^~~~ a.cc:3:1: error: expected ',' or ';' before '{' token 3 | { | ^
s968141586
p00123
C++
#include<stdio.h> int main(main) { double a,b; while(scanf("%lf %lf",&a,&b)!=EOF){ if(a<=35.5 && b<=71){ printf("AAA\n"); } else if(a<37.5 && b<77){ printf("AA\n"); } else if(a<40 && b<83){ printf("A\n"); } else if(a<43 && b<89){ printf("B\n"); } else if(a<50 && b<105){ printf("c\n"); } else if(a<55 && b<116){ printf("D\n"); } else if(a<60 && b<148){ printf("E\n"); } else{ printf("NA\n"); } // scanf("%d %d",&a,&b); } return 0; }
a.cc:2:5: error: cannot declare '::main' to be a global variable 2 | int main(main) | ^~~~ a.cc:3:1: error: expected ',' or ';' before '{' token 3 | { | ^
s717322915
p00123
C++
#include<stdio.h> int main(main) { double a,b; while(scanf("%lf %lf",&a,&b)!=EOF){ if(a<35.5 && b<71){ printf("AAA\n"); } else if(a<37.5 && b<77){ printf("AA\n"); } else if(a<40 && b<83){ printf("A\n"); } else if(a<43 && b<89){ printf("B\n"); } else if(a<50 && b<105){ printf("c\n"); } else if(a<55 && b<116){ printf("D\n"); } else if(a<60 && b<148){ printf("E\n"); } else{ printf("NA\n"); } // scanf("%d %d",&a,&b); } return 0; }
a.cc:2:5: error: cannot declare '::main' to be a global variable 2 | int main(main) | ^~~~ a.cc:3:1: error: expected ',' or ';' before '{' token 3 | { | ^
s908081187
p00123
C++
#include<stdio.h> int main(main) { double a,b; while(scanf("%lf %lf",&a,&b)!=EOF){ if(a<35.5 && b<71){ printf("AAA\n"); } else if(a<37.5 && b<77){ printf("AA\n"); } else if(a<40 && b<83){ printf("A\n"); } else if(a<43 && b<89){ printf("B\n"); } else if(a<50 && b<105){ printf("C\n"); } else if(a<55 && b<116){ printf("D\n"); } else if(a<60 && b<148){ printf("E\n"); } else{ printf("NA\n"); } // scanf("%d %d",&a,&b); } return 0; }
a.cc:2:5: error: cannot declare '::main' to be a global variable 2 | int main(main) | ^~~~ a.cc:3:1: error: expected ',' or ';' before '{' token 3 | { | ^
s630762020
p00123
C++
/*************************************/ /* ??\?????\?????\?????\??¬???????????±???006???????????????1?????? */ /* coded by Y.Suganuma */ /*************************************/ #include <stdio.h> int main() { double t1, t2; double t[7][2] = {{35.5, 71.0}, {37.5, 77.0}, {40.0, 83.0}, {43.0, 89.0}, {50.0, 105.0}, {55.0, 116.0}, {70.0, 148.0}}; int i1, k = -1; char kyu[8][5] = {"AAA", "AA", "A", "B", "C", "D", "E", "NA"}; // ??\?????\?????\??¨???????£??????? scanf("%lf %lf", &t1, &t2); // ????¬¢???????????? for (i1 = 0; i1 < 7 && k < 0; i1++) { if (t1 < t[i1][0] && t2 < t[i1][1]) k = i1; } if (k < 0) k = 7; printf("%s\n", kyu[k]); return 0; }
a.cc:21:9: error: expected unqualified-id before 'if' 21 | if (k < 0) | ^~ a.cc:24:15: error: expected constructor, destructor, or type conversion before '(' token 24 | printf("%s\n", kyu[k]); | ^ a.cc:26:9: error: expected unqualified-id before 'return' 26 | return 0; | ^~~~~~ a.cc:27:1: error: expected declaration before '}' token 27 | } | ^
s923286944
p00123
C++
#include <stdio.h> int main() { double t1, t2; double t[7][2] = {{35.5, 71.0}, {37.5, 77.0}, {40.0, 83.0}, {43.0, 89.0}, {50.0, 105.0}, {55.0, 116.0}, {70.0, 148.0}}; int i1, k = -1; char kyu[8][5] = {"AAA", "AA", "A", "B", "C", "D", "E", "NA"}; // ??\?????\?????\??¨???????£??????? scanf("%lf %lf", &t1, &t2); // ????¬¢???????????? for (i1 = 0; i1 < 7 && k < 0; i1++) { if (t1 < t[i1][0] && t2 < t[i1][1]) k = i1; } if (k < 0) k = 7; printf("%s\n", kyu[k]); return 0; }
a.cc:17:9: error: expected unqualified-id before 'if' 17 | if (k < 0) | ^~ a.cc:20:15: error: expected constructor, destructor, or type conversion before '(' token 20 | printf("%s\n", kyu[k]); | ^ a.cc:22:9: error: expected unqualified-id before 'return' 22 | return 0; | ^~~~~~ a.cc:23:1: error: expected declaration before '}' token 23 | } | ^
s359628875
p00123
C++
#include <stdio.h> int main() { double t1, t2; double t[7][2] = {{35.5, 71.0}, {37.5, 77.0}, {40.0, 83.0}, {43.0, 89.0}, {50.0, 105.0}, {55.0, 116.0}, {70.0, 148.0}}; int i1, k = -1; char kyu[8][5] = {"AAA", "AA", "A", "B", "C", "D", "E", "NA"}; // ??\?????\?????\??¨???????£??????? scanf("%lf %lf", &t1, &t2); // ????¬¢???????????? for (i1 = 0; i1 < 7 && k < 0; i1++) { if (t1 < t[i1][0] && t2 < t[i1][1]) k = i1; } if (k < 0) k = 7; printf("%s\n", kyu[k]); return 0; }
a.cc:17:9: error: expected unqualified-id before 'if' 17 | if (k < 0) | ^~ a.cc:20:15: error: expected constructor, destructor, or type conversion before '(' token 20 | printf("%s\n", kyu[k]); | ^ a.cc:22:9: error: expected unqualified-id before 'return' 22 | return 0; | ^~~~~~ a.cc:23:1: error: expected declaration before '}' token 23 | } | ^
s462353520
p00123
C++
#include <iostream> using namespace std; char c[8][8]; int main(){ while(cin>>a>>b){ for(int i=0;i<64;i++)cin>>c[i/8][i%8]; cout<<90<<endl; for(int i=0;i<8;i++){ for(int j=0;j<8;j++){ cout<<c[7-j][i]; } cout<<endl; } cout<<180<<endl; for(int i=0;i<8;i++){ for(int j=0;j<8;j++){ cout<<c[7-i][7-j]; } cout<<endl; } cout<<270<<endl; for(int i=0;i<8;i++){ for(int j=0;j<8;j++){ cout<<c[j][7-i]; } cout<<endl; } }
a.cc: In function 'int main()': a.cc:5:12: error: 'a' was not declared in this scope 5 | while(cin>>a>>b){ | ^ a.cc:5:15: error: 'b' was not declared in this scope 5 | while(cin>>a>>b){ | ^ a.cc:28:2: error: expected '}' at end of input 28 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s784697375
p00123
C++
#include<stdio.h> int main(void) { float t,t1; while(!(scanf("%f %f",&t,&t1)); if(t<35.50 && t1<71.00){ printf("AAA\n"); } else if(t<37.50 && t1<77.00){ printf("AA\n"); } else if(t<40.00 && t1<83.00){ printf("A\n"); } else if(t<43.00 && t1<89.00){ printf("B\n"); } else if(t<50.00 && t1<95.00){ printf("C\n"); } else if(t<55.00 && t1<116.00){ printf("D\n"); } else if(t<70.00 && t1<148.00){ printf("E\n"); } else{ printf("NA\n"); } return 0; }
a.cc: In function 'int main()': a.cc:5:39: error: expected ')' before ';' token 5 | while(!(scanf("%f %f",&t,&t1)); | ~ ^ | )
s082101485
p00123
C++
#include<stdio.h> int main(void) { float t,t1; while(!(scanf("%f %f",&t,&t1)){ if(t<35.50 && t1<71.00){ printf("AAA\n"); } else if(t<37.50 && t1<77.00){ printf("AA\n"); } else if(t<40.00 && t1<83.00){ printf("A\n"); } else if(t<43.00 && t1<89.00){ printf("B\n"); } else if(t<50.00 && t1<95.00){ printf("C\n"); } else if(t<55.00 && t1<116.00){ printf("D\n"); } else if(t<70.00 && t1<148.00){ printf("E\n"); } else{ printf("NA\n"); } } return 0; }
a.cc: In function 'int main()': a.cc:5:39: error: expected ')' before '{' token 5 | while(!(scanf("%f %f",&t,&t1)){ | ~ ^ | )
s422725647
p00123
C++
#include<stdio.h> int main(void) { float a,b; scanf("%f %f",&a,&b); if(a<35.5 && b<71.0){ printf("AAA\n"); } else if(a<37.5 && b<77.0){ printf("AA\n"); } else if(a<40.0 && b<83.0){ printf("A\n"); } else if(a<43.0 && b<89.0){ printf("B\n"); } else if(a<50.0 && b<105.0){ printf("C\n"); } else if(a<55.0 && b<116.0){ printf("D\n"); } else if(a<70.0 && b<148.0){ printf("E\n"); } else{ printf("NA\n"); } return 0; } #include<stdio.h> int main(void) { float a,b; scanf("%f %f",&a,&b); if(a<35.5 && b<71.0){ printf("AAA\n"); } else if(a<37.5 && b<77.0){ printf("AA\n"); } else if(a<40.0 && b<83.0){ printf("A\n"); } else if(a<43.0 && b<89.0){ printf("B\n"); } else if(a<50.0 && b<105.0){ printf("C\n"); } else if(a<55.0 && b<116.0){ printf("D\n"); } else if(a<70.0 && b<148.0){ printf("E\n"); } else{ printf("NA\n"); } return 0; }
a.cc:34:5: error: redefinition of 'int main()' 34 | int main(void) | ^~~~ a.cc:2:5: note: 'int main()' previously defined here 2 | int main(void) | ^~~~
s551274125
p00123
C++
#include<stdio.h> int main(void) { float a,b; while(scanf("%d %b",&a,&b)!=EOF{ if(a<35.5 && b<71.0){ printf("AAA\n"); } else if(a<37.5 && b<77.0){ printf("AA\n"); } else if(a<40.0 && b<83.0){ printf("A\n"); } else if(a<43.0 && b<89.0){ printf("B\n"); } else if(a<50.0 && b<105.0){ printf("C\n"); } else if(a<55.0 && b<116.0){ printf("D\n"); } else if(a<110.0 && b<148.0){ printf("E\n"); } else{ printf("NA\n"); } } return 0; }
a.cc: In function 'int main()': a.cc:5:40: error: expected ')' before '{' token 5 | while(scanf("%d %b",&a,&b)!=EOF{ | ~ ^
s369784299
p00123
C++
int main(void) { float a,b; while(scanf("%f %f",&a,&b)!=EOF){ if(a<35.5 && b<71.0){ printf("AAA\n"); } else if(a<37.5 && b<77.0){ printf("AA\n"); } else if(a<40.0 && b<83.0){ printf("A\n"); } else if(a<43.0 && b<89.0){ printf("B\n"); } else if(a<50.0 && b<105.0){ printf("c\n"); } else if(a<55.0 && b<116.0){ printf("D\n"); } else if(a<70.0 && b<148.0){ printf("E\n"); } else{ printf("NA\n"); } } return 0; }
a.cc: In function 'int main()': a.cc:4:15: error: 'scanf' was not declared in this scope 4 | while(scanf("%f %f",&a,&b)!=EOF){ | ^~~~~ a.cc:4:37: error: 'EOF' was not declared in this scope 4 | while(scanf("%f %f",&a,&b)!=EOF){ | ^~~ a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | int main(void) a.cc:6:25: error: 'printf' was not declared in this scope 6 | printf("AAA\n"); | ^~~~~~ a.cc:6:25: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' a.cc:9:25: error: 'printf' was not declared in this scope 9 | printf("AA\n"); | ^~~~~~ a.cc:9:25: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' a.cc:12:25: error: 'printf' was not declared in this scope 12 | printf("A\n"); | ^~~~~~ a.cc:12:25: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' a.cc:15:25: error: 'printf' was not declared in this scope 15 | printf("B\n"); | ^~~~~~ a.cc:15:25: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' a.cc:18:25: error: 'printf' was not declared in this scope 18 | printf("c\n"); | ^~~~~~ a.cc:18:25: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' a.cc:21:25: error: 'printf' was not declared in this scope 21 | printf("D\n"); | ^~~~~~ a.cc:21:25: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' a.cc:24:25: error: 'printf' was not declared in this scope 24 | printf("E\n"); | ^~~~~~ a.cc:24:25: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' a.cc:27:25: error: 'printf' was not declared in this scope 27 | printf("NA\n"); | ^~~~~~ a.cc:27:25: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
s499357328
p00123
C++
#include<iostream> #include<string> #include<algorithm> #include<map> #include<vector> #include<cmath> #include<cstdio> #define loop(i,a,b) for(i=a;i<b;i++) #define rep(i,a) loop(i,0,a) #define pb(in,tmp) in.push_back(tmp) #define all(in) in.begin(),in.end() const double PI=acos(-1); using namespace std; int main(){ double a,b; double h[2][8]={ {70,55,50,43,40,37,35,-1}, {148,116,105,89,83,77,71,-1} }; string s[8]={"NA",'E','D','C','B','A',"AA","AAA"}; while(cin>>a>>b){ int i; rep(i,8)if(a>=h[0][i]||b>=h[1][i])break; cout<<s[i]<<endl; } }
a.cc: In function 'int main()': a.cc:20:21: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 20 | string s[8]={"NA",'E','D','C','B','A',"AA","AAA"}; | ^~~ a.cc:20:25: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 20 | string s[8]={"NA",'E','D','C','B','A',"AA","AAA"}; | ^~~ a.cc:20:29: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 20 | string s[8]={"NA",'E','D','C','B','A',"AA","AAA"}; | ^~~ a.cc:20:33: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 20 | string s[8]={"NA",'E','D','C','B','A',"AA","AAA"}; | ^~~ a.cc:20:37: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 20 | string s[8]={"NA",'E','D','C','B','A',"AA","AAA"}; | ^~~
s975556590
p00124
Java
import java.util.*;class Main{public static void main(String[]args){Scanner sc = new Scanner(System.in);int c=0;for(;;){ int???s=sc.nextInt();if(s==0)break;if(c!=0)System.out.println();String tn[] =new String[s];int tp[]=new int[s]; int tpc[]=new int[s];for(int i=0;i<s;i++){ tn[i]=sc.next();tp[i]=(sc.nextInt()*3+sc.nextInt()*0+sc.nextInt());tpc[i]=tp[i];}Arrays.sort(tpc);for(int i=tpc[s-1];i>-1;i--){ for(int j=0;j<s;j++) if(i==tp[j])System.out.println(tn[j]+","+tp[j]);}c++;}}}
Main.java:1: error: not a statement import java.util.*;class Main{public static void main(String[]args){Scanner sc = new Scanner(System.in);int c=0;for(;;){ int???s=sc.nextInt();if(s==0)break;if(c!=0)System.out.println();String tn[] =new String[s];int tp[]=new int[s]; int tpc[]=new int[s];for(int i=0;i<s;i++){ tn[i]=sc.next();tp[i]=(sc.nextInt()*3+sc.nextInt()*0+sc.nextInt());tpc[i]=tp[i];}Arrays.sort(tpc);for(int i=tpc[s-1];i>-1;i--){ for(int j=0;j<s;j++) if(i==tp[j])System.out.println(tn[j]+","+tp[j]);}c++;}}} ^ Main.java:1: error: ';' expected import java.util.*;class Main{public static void main(String[]args){Scanner sc = new Scanner(System.in);int c=0;for(;;){ int???s=sc.nextInt();if(s==0)break;if(c!=0)System.out.println();String tn[] =new String[s];int tp[]=new int[s]; int tpc[]=new int[s];for(int i=0;i<s;i++){ tn[i]=sc.next();tp[i]=(sc.nextInt()*3+sc.nextInt()*0+sc.nextInt());tpc[i]=tp[i];}Arrays.sort(tpc);for(int i=tpc[s-1];i>-1;i--){ for(int j=0;j<s;j++) if(i==tp[j])System.out.println(tn[j]+","+tp[j]);}c++;}}} ^ 2 errors
s593966967
p00124
Java
#include<stdio.h> #include<stdlib.h> typedef struct team{ int p; char n[23]; }TEAM; int comp(const void *p,const void *q){ TEAM *a=(TEAM *)p,*b=(TEAM *)q; return b->p - a->p; } TEAM x[12]; int main(){ int n,p,q,r,i,f=1; while(scanf("%d",&n)!=EOF){ if(n==0)break; if(f==1)f==0; else printf("\n"); for(i=0;i<n;i++){ scanf("%s%d%d%d",x[i].n,&p,&q,&r); x[i].p=p*3+r; } qsort(x,n,sizeof(TEAM),comp); for(i=0;i<n;i++)printf("%s,%d\n",x[i].n,x[i],p); } return 0; }
Main.java:1: error: illegal character: '#' #include<stdio.h> ^ Main.java:1: error: class, interface, enum, or record expected #include<stdio.h> ^ Main.java:2: error: illegal character: '#' #include<stdlib.h> ^ Main.java:5: error: class, interface, enum, or record expected char n[23]; ^ Main.java:6: error: class, interface, enum, or record expected }TEAM; ^ Main.java:7: error: unnamed classes are a preview feature and are disabled by default. int comp(const void *p,const void *q){ ^ (use --enable-preview to enable unnamed classes) Main.java:7: error: illegal start of type int comp(const void *p,const void *q){ ^ Main.java:7: error: class, interface, enum, or record expected int comp(const void *p,const void *q){ ^ Main.java:9: error: class, interface, enum, or record expected return b->p - a->p; ^ Main.java:10: error: class, interface, enum, or record expected } ^ Main.java:16: error: not a statement if(f==1)f==0; ^ Main.java:14: error: illegal start of expression while(scanf("%d",&n)!=EOF){ ^ Main.java:19: error: illegal start of expression scanf("%s%d%d%d",x[i].n,&p,&q,&r); ^ Main.java:19: error: illegal start of expression scanf("%s%d%d%d",x[i].n,&p,&q,&r); ^ Main.java:19: error: illegal start of expression scanf("%s%d%d%d",x[i].n,&p,&q,&r); ^ 15 errors
s982249630
p00124
C
#include<stdio.h> struct TeamScore { char team_name[21]; int win_n; int lose_n; int draw_n; int points; }; int main(void) { int n; int i,j,k=0; while (1) { struct TeamScore data[10], *p, temp; p = data; scanf("%d",&n); if (n == 0)break; if (k++)putchar('\n'); for (i = 0; i < n; i++) { scanf("%s %d %d %d", &data[i].team_name??? &data[i].win_n, &data[i].lose_n, &data[i].draw_n); data[i].points = data[i].win_n * 3 + data[i].draw_n; } for (i = 0; i < n; i++) { for (j = i; j < n; j++) { if ((p + i)->points < (p + j)->points) { temp = *(p + i); *(p + i) = *(p + j); *(p + j) = temp; } } } for (i = 0; i < n; i++) printf("%s,%d\n", (p + i)->team_name, (p + i)->points); } return 0; }
main.c: In function 'main': main.c:20:65: error: expected expression before '?' token 20 | scanf("%s %d %d %d", &data[i].team_name??? &data[i].win_n, | ^
s650350224
p00124
C
#include<stdio.h> struct TeamScore { char team_name[21]; int win_n; int lose_n; int draw_n; int points; }; int main(void) { int n; int i,j,k=0; while (1) { struct TeamScore data[10], *p, temp; p = data; scanf_s("%d",&n); if (n == 0)break; if (k>0)putchar('\n'); for (i = 0; i < n; i++) { scanf("%s %d %d %d", data[i].team_name, &data[i].win_n, &data[i].lose_n, &data[i].draw_n); data[i].points = data[i].win_n * 3 + data[i].draw_n; } for (i = 0; i < n; i++) { for (j = i; j < n; j++) { if ((p + i)->points < (p + j)->points) { temp = *(p + i); *(p + i) = *(p + j); *(p + j) = temp; } } } for (i = 0; i < n; i++) printf("%s,%d\n", (p + i)->team_name, (p + i)->points); k = 1; } return 0; }
main.c: In function 'main': main.c:16:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 16 | scanf_s("%d",&n); | ^~~~~~~ | scanf
s677363147
p00124
C++
=#include <iostream> #include <string> using namespace std; struct Team { string name; int score; }; int main() { int n; bool test = true; while (cin >> n && n != 0) { if (!test) cout << "\n"; Team *team = new Team[n]; int w, l, d; for (int i = 0; i < n; i++) { cin >> team[i].name >> w >> l >> d; team[i].score = w * 3 + d; } for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (team[i].score > team[j].score) swap(team[i], team[j]); } } for (int i = 0; i < n; i++) cout << team[i].name << "," << team[i].score << "\n"; if (test) test = false; } 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'
s908729328
p00124
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int main(void){ int n; bool o = 0 ; while(cin>>n,n){ if(cnt ++ > 0)cout<<endl; string name[n]; int sum[n],point; int rank[n]; for(int i = 0 ; i < n ; i ++){ cin>>name[i]; cin>>point; //win sum[i]=point*3; cin>>point; //lose; cin>>point; //drow sum[i]+=point; rank[i]=i; } for(int i = 0 ; i < n ; i ++) for(int j = 0 ; j < n ; j ++){ if(sum[rank[i]]>sum[rank[j]]){ int t = rank[i]; rank[i] = rank[j]; rank[j] = t; } } if(o)cout<<endl; o = true; for(int i = 0 ; i < n ; i ++) cout<<name[rank[i]]<<","<<sum[rank[i]]<<endl; } }
a.cc: In function 'int main()': a.cc:11:20: error: 'cnt' was not declared in this scope; did you mean 'int'? 11 | if(cnt ++ > 0)cout<<endl; | ^~~ | int
s923696021
p00124
C++
#include <algorithm> #include <vector> #include <functional> #include <utility> #include <string> using namespace std; int main() { vector<pair<int, pair<int, string> > > team; int n, pt[10][3]; string str[10]; while(1){ cin >> n; if(n == 0) break; for(int i = 0; i < n; i++) cin >> str[i] >> pt[i][0] >> pt[i][1] >> pt[i][2]; for(int i = 0; i < n; i++) team.push_back(make_pair(((pt[i][0] * -3) - pt[i][2]), make_pair(i, str[i]))); stable_sort(team.begin(), team.end()); cout << endl; for(int i = 0; i < n; i++) cout << team[i].second.second << "," << -(team[i].first) << endl; team.clear(); } return 0; }
a.cc: In function 'int main()': a.cc:16:17: error: 'cin' was not declared in this scope 16 | cin >> n; | ^~~ a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 5 | #include <string> +++ |+#include <iostream> 6 | a.cc:28:17: error: 'cout' was not declared in this scope 28 | cout << endl; | ^~~~ a.cc:28:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:28:25: error: 'endl' was not declared in this scope 28 | cout << endl; | ^~~~ a.cc:6:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 5 | #include <string> +++ |+#include <ostream> 6 |
s357734136
p00124
C++
#include <iostream> #include <map> #include <vector> using namespace std; struct Country{string name; int wp;}; vector<Country> Allteam; bool comp(const Country& c1, const Country& c2){ return (c1.wp > c2.wp); } int main(void){ int n; while(cin >> n, n){ for(int i = 0; i < n; i++){ string tname; int w, l, d; cin >> tname >> w >> l >> d; Country c = {tname, w * 3 + d}; Allteam.push_back(c); } sort(Allteam.begin(), Allteam.end(), comp); for(int i = 0; i < Allteam.size(); i++){ cout << Allteam[i].name << "," << Allteam[i].wp << endl; } cout << endl; Allteam.clear(); } return 0; }
a.cc: In function 'int main()': a.cc:23:5: error: 'sort' was not declared in this scope; did you mean 'short'? 23 | sort(Allteam.begin(), Allteam.end(), comp); | ^~~~ | short
s949459426
p00124
C++
#include<stdio.h> #include<string> #include<iostream> using namespace std; struct TA{ string name; int po; int rr; }; int main(){ int n; struct TA N[11]; bool ty=true; while(1){ scanf("%d",&n); if(n==0)break; for(int i=0;i<n;i++) if(ty==false)cout<<endl; ty=false; {cin>>N[i].name;int a,b,c; cin>>a>>b>>c; N[i].po=a*3+c*1; N[i].rr=i; } for(int i=0;i<n;i++) for(int j=n-1;j>i;j--) if(N[j].po>N[j-1].po){struct TA T=N[j];N[j]=N[j-1];N[j-1]=T;} for(int i=0;i<n;i++) cout<<N[i].name<<","<<N[i].po<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:17:17: error: 'i' was not declared in this scope 17 | {cin>>N[i].name;int a,b,c; cin>>a>>b>>c; | ^
s860948458
p00124
C++
#include <iostream> using namespace std; class data{ public: char name; int win; int lose; int draw; int score; }; int main(){ int teamamo; while(true){ cin>>teamamo; if(teamamo==0) break; data teamdata[10]; data comp; for(int i=0; i<teamamo; i++) cin>>teamdata[i].name>>teamdata[i].win>>teamdata[i].lose>>teamdata[i].draw; for(int i=0; i<teamamo; i++) teamdata[i].score=teamdata[i].win*3+teamdata[i].draw; for(int i=0; i<teamamo-1; i++){ if(teamdata[i].score<teamdata[i+1]){ char fout; fout=teamdata[i].name; teamdata[i].name=teamdata[i+1].name; teamdata[i+1].name=fout; int gout; gout=teamdata[i].win; teamdata[i].win=teamdata[i+1].win; teamdata[i+1].win=gout; gout=teamdata[i].lose; teamdata[i].lose=teamdata[i+1].lose; teamdata[i+1].lose=gout; gout=teamdata[i].draw; teamdata[i].draw=teamdata[i+1].draw; teamdata[i+1].draw=gout; gout=teamdata[i].score; teamdata[i].score=teamdata[i+1].score; teamdata[i+1].score=gout; } } for(int i=0; i<teamamo; i++) cout<<teamdata[i].name<<','<<teamdata[i].score<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:27:1: error: reference to 'data' is ambiguous 27 | data teamdata[10]; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:4:7: note: 'class data' 4 | class data{ | ^~~~ a.cc:28:1: error: reference to 'data' is ambiguous 28 | data comp; | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:4:7: note: 'class data' 4 | class data{ | ^~~~ a.cc:31:6: error: 'teamdata' was not declared in this scope 31 | cin>>teamdata[i].name>>teamdata[i].win>>teamdata[i].lose>>teamdata[i].draw; | ^~~~~~~~ a.cc:34:1: error: 'teamdata' was not declared in this scope 34 | teamdata[i].score=teamdata[i].win*3+teamdata[i].draw; | ^~~~~~~~ a.cc:38:4: error: 'teamdata' was not declared in this scope 38 | if(teamdata[i].score<teamdata[i+1]){ | ^~~~~~~~ a.cc:68:7: error: 'teamdata' was not declared in this scope 68 | cout<<teamdata[i].name<<','<<teamdata[i].score<<endl; | ^~~~~~~~
s170119609
p00124
C++
#include <iostream> using namespace std; struct data{ char name; int win; int lose; int draw; int score; }; int main(){ int teamamo; while(true){ cin>>teamamo; if(teamamo==0) break; data teamdata[10]; data comp; for(int i=0; i<teamamo; i++) cin>>teamdata[i].name>>teamdata[i].win>>teamdata[i].lose>>teamdata[i].draw; for(int i=0; i<teamamo; i++) teamdata[i].score=teamdata[i].win*3+teamdata[i].draw; for(int i=0; i<teamamo-1; i++){ if(teamdata[i].score<teamdata[i+1]){ char fout; fout=teamdata[i].name; teamdata[i].name=teamdata[i+1].name; teamdata[i+1].name=fout; int gout; gout=teamdata[i].win; teamdata[i].win=teamdata[i+1].win; teamdata[i+1].win=gout; gout=teamdata[i].lose; teamdata[i].lose=teamdata[i+1].lose; teamdata[i+1].lose=gout; gout=teamdata[i].draw; teamdata[i].draw=teamdata[i+1].draw; teamdata[i+1].draw=gout; gout=teamdata[i].score; teamdata[i].score=teamdata[i+1].score; teamdata[i+1].score=gout; } } for(int i=0; i<teamamo; i++) cout<<teamdata[i].name<<','<<teamdata[i].score<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:25:1: error: reference to 'data' is ambiguous 25 | data teamdata[10]; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:4:8: note: 'struct data' 4 | struct data{ | ^~~~ a.cc:26:1: error: reference to 'data' is ambiguous 26 | data comp; | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:4:8: note: 'struct data' 4 | struct data{ | ^~~~ a.cc:29:6: error: 'teamdata' was not declared in this scope 29 | cin>>teamdata[i].name>>teamdata[i].win>>teamdata[i].lose>>teamdata[i].draw; | ^~~~~~~~ a.cc:32:1: error: 'teamdata' was not declared in this scope 32 | teamdata[i].score=teamdata[i].win*3+teamdata[i].draw; | ^~~~~~~~ a.cc:36:4: error: 'teamdata' was not declared in this scope 36 | if(teamdata[i].score<teamdata[i+1]){ | ^~~~~~~~ a.cc:66:7: error: 'teamdata' was not declared in this scope 66 | cout<<teamdata[i].name<<','<<teamdata[i].score<<endl; | ^~~~~~~~
s051539748
p00124
C++
#include <iostream> #include <string.h> using namespace std; struct data{ char name[20]; int win; int lose; int draw; int score; }; int main(){ int teamamo; while (true){ cin >> teamamo; if (teamamo == 0) break; data teamdata[10]; for (int i = 0; i<teamamo; i++) cin >> teamdata[i].name >> teamdata[i].win >> teamdata[i].lose >> teamdata[i].draw; for (int i = 0; i<teamamo; i++) teamdata[i].score = teamdata[i].win * 3 + teamdata[i].draw; for (int j = 0; j < teamamo - 1; j++){ for (int i = 0; i < teamamo - 1; i++){ if (teamdata[i].score < teamdata[i + 1].score){ char fout[20]; strcpy_s(fout, teamdata[i].name); strcpy_s(teamdata[i].name, teamdata[i + 1].name); strcpy_s(teamdata[i + 1].name, fout); int gout; gout = teamdata[i].score; teamdata[i].score = teamdata[i + 1].score; teamdata[i + 1].score = gout; } } } for (int i = 0; i<teamamo; i++) cout << teamdata[i].name << ',' << teamdata[i].score << endl; } return 0; }
a.cc: In function 'int main()': a.cc:26:17: error: reference to 'data' is ambiguous 26 | data teamdata[10]; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:5:8: note: 'struct data' 5 | struct data{ | ^~~~ a.cc:30:32: error: 'teamdata' was not declared in this scope 30 | cin >> teamdata[i].name >> teamdata[i].win >> teamdata[i].lose >> teamdata[i].draw; | ^~~~~~~~ a.cc:33:25: error: 'teamdata' was not declared in this scope 33 | teamdata[i].score = teamdata[i].win * 3 + teamdata[i].draw; | ^~~~~~~~ a.cc:39:37: error: 'teamdata' was not declared in this scope 39 | if (teamdata[i].score < teamdata[i + 1].score){ | ^~~~~~~~ a.cc:42:41: error: 'strcpy_s' was not declared in this scope; did you mean 'strcpy'? 42 | strcpy_s(fout, teamdata[i].name); | ^~~~~~~~ | strcpy a.cc:59:33: error: 'teamdata' was not declared in this scope 59 | cout << teamdata[i].name << ',' << teamdata[i].score << endl; | ^~~~~~~~
s486786252
p00124
C++
#include <iostream> #include <string.h> using namespace std; struct data{ char name[20]; int win; int lose; int draw; int score; }; int main(){ int teamamo; while (true){ cin >> teamamo; if (teamamo == 0) break; data teamdata[10]; for (int i = 0; i<teamamo; i++) cin >> teamdata[i].name >> teamdata[i].win >> teamdata[i].lose >> teamdata[i].draw; for (int i = 0; i<teamamo; i++) teamdata[i].score = teamdata[i].win * 3 + teamdata[i].draw; for (int j = 0; j < teamamo - 1; j++){ for (int i = 0; i < teamamo - 1; i++){ if (teamdata[i].score < teamdata[i + 1].score){ data t = teamdata[i]; teamdata[i] = teamdata[i + 1]; teamdata[i + 1] = t; } } } for (int i = 0; i<teamamo; i++) cout << teamdata[i].name << "," << teamdata[i].score << endl;               cout<<endl; } return 0; }
a.cc:54:1: error: extended character   is not valid in an identifier 54 |       | ^ a.cc:54:1: error: extended character   is not valid in an identifier a.cc:54:1: error: extended character   is not valid in an identifier a.cc:54:1: error: extended character   is not valid in an identifier a.cc:54:1: error: extended character   is not valid in an identifier a.cc:56:1: error: extended character   is not valid in an identifier 56 |         cout<<endl; | ^ a.cc:56:1: error: extended character   is not valid in an identifier a.cc:56:1: error: extended character   is not valid in an identifier a.cc:56:1: error: extended character   is not valid in an identifier a.cc:56:1: error: extended character   is not valid in an identifier a.cc:56:1: error: extended character   is not valid in an identifier a.cc:56:1: error: extended character   is not valid in an identifier a.cc:56:1: error: extended character   is not valid in an identifier a.cc: In function 'int main()': a.cc:26:17: error: reference to 'data' is ambiguous 26 | data teamdata[10]; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:5:8: note: 'struct data' 5 | struct data{ | ^~~~ a.cc:30:32: error: 'teamdata' was not declared in this scope 30 | cin >> teamdata[i].name >> teamdata[i].win >> teamdata[i].lose >> teamdata[i].draw; | ^~~~~~~~ a.cc:33:25: error: 'teamdata' was not declared in this scope 33 | teamdata[i].score = teamdata[i].win * 3 + teamdata[i].draw; | ^~~~~~~~ a.cc:39:37: error: 'teamdata' was not declared in this scope 39 | if (teamdata[i].score < teamdata[i + 1].score){ | ^~~~~~~~ a.cc:41:41: error: reference to 'data' is ambiguous 41 | data t = teamdata[i]; | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:5:8: note: 'struct data' 5 | struct data{ | ^~~~ a.cc:43:59: error: 't' was not declared in this scope 43 | teamdata[i + 1] = t; | ^ a.cc:53:33: error: 'teamdata' was not declared in this scope 53 | cout << teamdata[i].name << "," << teamdata[i].score << endl; | ^~~~~~~~ a.cc:54:1: error: '\U00003000\U00003000\U00003000\U00003000\U00003000' was not declared in this scope 54 |       | ^~~~~~~~~~
s406738371
p00124
C++
#include <iostream> #include <string.h> using namespace std; struct data{ char name[20]; int win; int lose; int draw; int score; }; int main(){ int teamamo; while (true){ cin >> teamamo; if (teamamo == 0) break; data teamdata[10]; for (int i = 0; i<teamamo; i++) cin >> teamdata[i].name >> teamdata[i].win >> teamdata[i].lose >> teamdata[i].draw; for (int i = 0; i<teamamo; i++) teamdata[i].score = teamdata[i].win * 3 + teamdata[i].draw; for (int j = 0; j < teamamo - 1; j++){ for (int i = 0; i < teamamo - 1; i++){ if (teamdata[i].score < teamdata[i + 1].score){ data t = teamdata[i]; teamdata[i] = teamdata[i + 1]; teamdata[i + 1] = t; } } } for (int i = 0; i<teamamo; i++) cout << teamdata[i].name << "," << teamdata[i].score << endl<<endl;                } return 0; }
a.cc:54:1: error: extended character   is not valid in an identifier 54 |       | ^ a.cc:54:1: error: extended character   is not valid in an identifier a.cc:54:1: error: extended character   is not valid in an identifier a.cc:54:1: error: extended character   is not valid in an identifier a.cc:54:1: error: extended character   is not valid in an identifier a.cc:56:1: error: extended character   is not valid in an identifier 56 |          | ^ a.cc:56:1: error: extended character   is not valid in an identifier a.cc:56:1: error: extended character   is not valid in an identifier a.cc:56:1: error: extended character   is not valid in an identifier a.cc:56:1: error: extended character   is not valid in an identifier a.cc:56:1: error: extended character   is not valid in an identifier a.cc:56:1: error: extended character   is not valid in an identifier a.cc:56:1: error: extended character   is not valid in an identifier a.cc: In function 'int main()': a.cc:26:9: error: reference to 'data' is ambiguous 26 | data teamdata[10]; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:5:8: note: 'struct data' 5 | struct data{ | ^~~~ a.cc:30:20: error: 'teamdata' was not declared in this scope 30 | cin >> teamdata[i].name >> teamdata[i].win >> teamdata[i].lose >> teamdata[i].draw; | ^~~~~~~~ a.cc:33:13: error: 'teamdata' was not declared in this scope 33 | teamdata[i].score = teamdata[i].win * 3 + teamdata[i].draw; | ^~~~~~~~ a.cc:39:21: error: 'teamdata' was not declared in this scope 39 | if (teamdata[i].score < teamdata[i + 1].score){ | ^~~~~~~~ a.cc:41:21: error: reference to 'data' is ambiguous 41 | data t = teamdata[i]; | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:5:8: note: 'struct data' 5 | struct data{ | ^~~~ a.cc:43:39: error: 't' was not declared in this scope 43 | teamdata[i + 1] = t; | ^ a.cc:53:21: error: 'teamdata' was not declared in this scope 53 | cout << teamdata[i].name << "," << teamdata[i].score << endl<<endl; | ^~~~~~~~ a.cc:54:1: error: '\U00003000\U00003000\U00003000\U00003000\U00003000' was not declared in this scope 54 |       | ^~~~~~~~~~
s821320072
p00124
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b[9],c[9],d[9],f[9]; string n[9]; while(1){ cin >> a >> endl; for(int i = 0; i < a i++){ cin >> b[i] >> c[i] >> d[i]; } if(a == 0)break; for(int i = 0 ; i < a ; i++){ cin >> n[i] >> b[i] >> c[i] >> d[i]; f[i] = b[i]*3 + c[i]*0 + d[i]*1; n[i] == f[i]; } } sort(f.begin(), f + a.end()); for(int i = 0 ; i < a ; i++){ cout << n[i] << "," << f[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:8:26: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 8 | cin >> a >> endl; | ~~~~~~~~~^~~~~~~ In file included 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/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for argum
s511188690
p00124
C++
#include<stdio.h> #include<string.h> int main() { char coun[11][21]; int score[11],win,lose,draw,max[11]; int i,j,n; for(;;){ max=0; scanf("%d",&n); if(n==0)break; for(i=0;i<n;i++){ scanf("%s",coun[i]); scanf("%d%d%d", &win, &lose, &draw); score[i]=win*3+draw; max[i]=score; } for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(max[i]>max[j]){ max[10]=max[i]; max[i]=max[j]; max[j]=max[10]; } } } for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(max[i]==score[j]){ printf("%s,%d",coun[j],score[i]); score[i]=-1; } } } } return 0; }
a.cc: In function 'int main()': a.cc:11:20: error: incompatible types in assignment of 'int' to 'int [11]' 11 | max=0; | ~~~^~ a.cc:18:32: error: invalid conversion from 'int*' to 'int' [-fpermissive] 18 | max[i]=score; | ^~~~~ | | | int*
s782099906
p00124
C++
#include<stdio.h> #include<string.h> int main() { char coun[11][21]; int score[11],win,lose,draw,max[11]; int i,j,n; for(;;){ scanf("%d",&n); if(n==0)break; for(i=0;i<n;i++){ scanf("%s",coun[i]); scanf("%d%d%d", &win, &lose, &draw); score[i]=win*3+draw; max[i]=score; } for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(max[i]>max[j]){ max[10]=max[i]; max[i]=max[j]; max[j]=max[10]; } } } for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(max[i]==score[j]){ printf("%s,%d",coun[j],score[i]); score[i]=-1; } } } } return 0; }
a.cc: In function 'int main()': a.cc:17:32: error: invalid conversion from 'int*' to 'int' [-fpermissive] 17 | max[i]=score; | ^~~~~ | | | int*
s959071768
p00124
C++
ok
a.cc:1:1: error: 'ok' does not name a type 1 | ok | ^~
s107730920
p00124
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; struct nx { string name; int cost; }; int main() { int n, f=0; while (cin>>n) { if (!n) break; if (f) cout<<endl; nx m[n]; for (int i=0; i<n; i++) { cin>>m[i].name; int a,b,c; cin>>a>>b>>c; m[i].cost=a*3+c*1; } // for (int i=0; i<n; i++) { // for (int j=i+1; j<n; j++) { // if (m[i].cost<m[j].cost) swap(m[i],m[j]); // } // } sort(m,m+n); for (int i=0; i<n; i++) { cout<<m[i].name<<","<<m[i].cost<<endl; } f++; } }
In file included from /usr/include/c++/14/bits/stl_algobase.h:71, from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_less_iter::operator()(_Iterator1, _Iterator2) const [with _Iterator1 = nx*; _Iterator2 = nx*]': /usr/include/c++/14/bits/stl_algo.h:1777:14: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = nx*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1777 | if (__comp(__i, __first)) | ~~~~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = nx*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = nx*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1908 | std::__final_insertion_sort(__first, __last, __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = nx*]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:25:13: required from here 25 | sort(m,m+n); | ~~~~^~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:45:23: error: no match for 'operator<' (operand types are 'nx' and 'nx') 45 | { return *__it1 < *__it2; } | ~~~~~~~^~~~~~~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:1241:5: note: candidate: 'template<class _IteratorL, class _IteratorR, class _Container> bool __gnu_cxx::operator<(const __normal_iterator<_IteratorL, _Container>&, const __normal_iterator<_IteratorR, _Container>&)' 1241 | operator<(const __normal_iterator<_IteratorL, _Container>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1241:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:45:23: note: 'nx' is not derived from 'const __gnu_cxx::__normal_iterator<_IteratorL, _Container>' 45 | { return *__it1 < *__it2; } | ~~~~~~~^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1249:5: note: candidate: 'template<class _Iterator, class _Container> bool __gnu_cxx::operator<(const __normal_iterator<_Iterator, _Container>&, const __normal_iterator<_Iterator, _Container>&)' 1249 | operator<(const __normal_iterator<_Iterator, _Container>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1249:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:45:23: note: 'nx' is not derived from 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>' 45 | { return *__it1 < *__it2; } | ~~~~~~~^~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Val_less_iter::operator()(_Value&, _Iterator) const [with _Value = nx; _Iterator = nx*]': /usr/include/c++/14/bits/stl_algo.h:1757:20: required from 'void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = nx*; _Compare = __gnu_cxx::__ops::_Val_less_iter]' 1757 | while (__comp(__val, __next)) | ~~~~~~^~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1785:36: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = nx*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1785 | std::__unguarded_linear_insert(__i, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ 1786 | __gnu_cxx::__ops::__val_comp_iter(__comp)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = nx*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = nx*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1908 | std::__final_insertion_sort(__first, __last, __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = nx*]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:25:13: required from here 25 | sort(m,m+n); | ~~~~^~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:98:22: error: no match for 'operator<' (operand types are 'nx' and 'nx') 98 | { return __val < *__it; } | ~~~~~~^~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1241:5: note: candidate: 'template<class _IteratorL, class _IteratorR, class _Container> bool __gnu_cxx::operator<(const __normal_iterator<_IteratorL, _Container>&, const __normal_iterator<_IteratorR, _Container>&)' 1241 | operator<(const __normal_iterator<_IteratorL, _Container>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1241:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:98:22: note: 'nx' is not derived from 'const __gnu_cxx::__normal_iterator<_IteratorL, _Container>' 98 | { return __val < *__it; } | ~~~~~~^~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1249:5: note: candidate: 'template<class _Iterator, class _Container> bool __gnu_cxx::operator<(const __normal_iterator<_Iterator, _Container>&, const __normal_iterator<_Iterator, _Container>&)' 1249 | operator<(const __normal_iterator<_Iterator, _Container>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1249:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:98:22: note: 'nx' is not derived from 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>' 98 | { return __val < *__it; } | ~~~~~~^~~~~~~ /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_less_val::operator()(_Iterator, _Value&) const [with _Iterator = nx*; _Value = nx]': /usr/include/c++/14/bits/stl_heap.h:140:48: required from 'void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare&) [with _RandomAccessIterator = nx*; _Distance = long int; _Tp = nx; _Compare = __gnu_cxx::__ops::_Iter_less_val]' 140 | while (__holeIndex > __topIndex && __comp(__first + __parent, __value)) | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:247:23: required from 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = nx*; _Distance = long int; _Tp = nx; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 247 | std::__push_heap(__first, __holeIndex, __topIndex, | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 248 | _GLIBCXX_MOVE(__value), __cmp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:356:22: required from 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = nx*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 356 | std::__adjust_heap(__first, __parent, __len, _GLIBCXX_MOVE(__value), | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 357 | __comp); | ~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1593:23: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = nx*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1593 | std::__make_heap(__first, __middle, __comp); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = nx*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1868 | std::__heap_select(__first, __middle, __last, __comp); | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = nx*; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1884 | std::__partial_sort(__first, __last, __last, __comp); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1905:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAcces
s685498701
p00124
C++
#include <iostream> #include <string> #include <algorithm> #include <map> #include <vector> #include <functional> using namespace std; bool cmp(pair<int,string> a , pair<int,string> b){ return a.first > b.first; } int main(void){ while(1){ int a,n; string s; vector< pair<int,string> > P; int w,d,l; if(c++)cout << endl; cin >> n; if(n==0)break; for(a=0;a<n;a++){ cin >> s >> w >> l >> d; P.push_back(make_pair(w*3+d,s)); } stable_sort(P.begin(),P.end(),cmp); for(a=0;a<n;a++){ cout << P[a].second << "," << P[a].first << endl; } } return 0; }
a.cc: In function 'int main()': a.cc:20:20: error: 'c' was not declared in this scope 20 | if(c++)cout << endl; | ^
s243353236
p00124
C++
using namespace std; #define rep(i,n) for(int i=0;i<n;i++) #define REP(n) rep(i,n) #define all(n) n.begin(),n.end() const int MAXP = 31; int main() { string s; int n, w, l, e; bool sec = false; while(cin >> n && n) { if(sec) cout << endl; vector<string> teams[MAXP]; REP(n) { cin >> s >> w >> l >> e; teams[w * 3 + e].push_back(s); } for(int i = MAXP-1;i!= 0; i--)rep(j,teams[i].size()) cout << teams[i][j] << "," << i << endl; sec = true; } return 0; }
a.cc: In function 'int main()': a.cc:11:5: error: 'string' was not declared in this scope 11 | string s; | ^~~~~~ a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' +++ |+#include <string> 1 | using namespace std; a.cc:14:11: error: 'cin' was not declared in this scope 14 | while(cin >> n && n) | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:16:17: error: 'cout' was not declared in this scope 16 | if(sec) cout << endl; | ^~~~ a.cc:16:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:16:25: error: 'endl' was not declared in this scope 16 | if(sec) cout << endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | using namespace std; a.cc:17:9: error: 'vector' was not declared in this scope 17 | vector<string> teams[MAXP]; | ^~~~~~ a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' +++ |+#include <vector> 1 | using namespace std; a.cc:17:24: error: 'teams' was not declared in this scope 17 | vector<string> teams[MAXP]; | ^~~~~ a.cc:21:20: error: 's' was not declared in this scope 21 | cin >> s >> w >> l >> e; | ^ a.cc:26:13: error: 'cout' was not declared in this scope 26 | cout << teams[i][j] << "," << i << endl; | ^~~~ a.cc:26:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:26:48: error: 'endl' was not declared in this scope 26 | cout << teams[i][j] << "," << i << endl; | ^~~~ a.cc:26:48: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s515959950
p00124
C++
#include <iostream> #include <algorithm> #include <vector> #include <functional> #include <utility> #include <string> using namespace std; int main() { vector<pair<int, pair<int, string> > > team; int n, pt[10][3]; string str[10]; while(1){ cin >> n; if(n == 0) break; for(int i = 0; i < n; i++) cin >> str[i] >> pt[i][0] >> pt[i][1] >> pt[i][2]; for(int i = 0; i < n; i++) team.push_back(make_pair(((pt[i][0] * -3) - pt[i][2]), make_pair(i, str[i]))); cout << endl; sort(team.begin(), team.end()); for(int i = 0; i < n; i++) cout << team[i].second.second << "," << -(team[i].first) << endl; cout << endl team.clear(); } return 0; }
a.cc: In function 'int main()': a.cc:34:29: error: expected ';' before 'team' 34 | cout << endl | ^ | ; 35 | 36 | team.clear(); | ~~~~
s111559077
p00125
Java
import java.util.Scanner; public class Tes { static final int[] md = new int[12]; static { int[] days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int day = 0; for (int i = 1; i < 12; i++) { md[i] = day; day += days[i]; } } public static void main(String[] args) { Scanner in = new Scanner(System.in); while (true) { int y1 = in.nextInt(); int m1 = in.nextInt(); int d1 = in.nextInt(); int y2 = in.nextInt(); int m2 = in.nextInt(); int d2 = in.nextInt(); if (y1 < 0 || y2 < 0 || m1 < 0 || m2 < 0 || d1 < 0 || d2 < 0) { break; } long from = getL(y1, m1, d1); long to = getL(y2, m2, d2); System.out.println(to - from); } } private static long getL(int y, int m, int d) { long result = 365 * y + md[m - 1] + d; if (m > 2 && (y % 400 == 0 || (y % 100 != 0 && y % 4 == 0))) { result++; } result += (y - 1) / 4; result -= (y - 1) / 100; result += (y - 1) / 400; return result; } }
Main.java:3: error: class Tes is public, should be declared in a file named Tes.java public class Tes { ^ 1 error
s520428062
p00125
C
#include<stdio.h> int main(void) { int a[11]={31,28,31,30,31,30,31,31,30,31,30}; int y1,m1,d1,y1,y2,m2,d2; int i,j,n,u,w; while(1){ scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2); if(y1<0||y2<0||m1<0||m2<0||d1<0||d2<0) break; n=0; for(j=y1;j<=y2;j++){ u=0; if(j%4==0){ u=1; if(j%400==0){ u=1; } else if(j%100==0){ u=0; } } if(u==1){ d2=d2+1; } } n-0; for(i=0;i<m1;i++){ n=n+a[i]; } w=0; for(i=0;i<m2;i++){ w=w+a[i]; } u=0; if(y1%4==0){ u=1; if(y1%400==0){ u=1; } else if(y1%100){ u=0; } if(u==1&&m1>3){ d2=d2-1; } } u=0; if(y2%4==0){ u=1; if(y2%400==0){ u=1; } else if(y2%100){ u=0; } if(u==1&&m2<3){ d2=d2-1; } } printf("%d\n",(y2-y1)*365+(w-n)+d2-d1); } return 0; }
main.c: In function 'main': main.c:5:22: error: redeclaration of 'y1' with no linkage 5 | int y1,m1,d1,y1,y2,m2,d2; | ^~ main.c:5:13: note: previous declaration of 'y1' with type 'int' 5 | int y1,m1,d1,y1,y2,m2,d2; | ^~
s255567555
p00125
C
#include<stdio.h> int main(void) { int a[11]={31,28,31,30,31,30,31,31,30,31,30}; int y1,m1,d1,y1,y2,m2,d2; int i,j,n,u,w; while(1){ scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2); if(y1<0||y2<0||m1<0||m2<0||d1<0||d2<0) break; n=0; for(j=y1;j<=y2;j++){ u=0; if(j%4==0){ u=1; if(j%400==0){ u=1; } else if(j%100==0){ u=0; } } if(u==1){ d2=d2+1; } } n-0; for(i=0;i<m1;i++){ n=n+a[i]; } w=0; for(i=0;i<m2;i++){ w=w+a[i]; } u=0; if(y1%4==0){ u=1; if(y1%400==0){ u=1; } else if(y1%100){ u=0; } if(u==1&&m1>3){ d2=d2-1; } } u=0; if(y2%4==0){ u=1; if(y2%400==0){ u=1; } else if(y2%100){ u=0; } if(u==1&&m2<3){ d2=d2-1; } } printf("%d\n",(y2-y1)*365+(w-n)+d2-d1); } return 0; }
main.c: In function 'main': main.c:5:22: error: redeclaration of 'y1' with no linkage 5 | int y1,m1,d1,y1,y2,m2,d2; | ^~ main.c:5:13: note: previous declaration of 'y1' with type 'int' 5 | int y1,m1,d1,y1,y2,m2,d2; | ^~
s870556480
p00125
C
#include<stdio.h> #include<string.h> int main(void) { int y1,y2,m1,m2,d1,d2,y=0,i,all=0,b=0,c=0,u; int a[12]={0}; while(1){ scanf("%d %d %d %d %d %d",&y1,&m1,&d1,&y2,&m2,&d2); if(y2-y1!=0){ for(i=y1;i<y2;i++){ u=0; if((i%4)==0){ u=1; if((i%100)==0){ u=0; if((i%400)==0){ u=1; } } } if(u==0){ y+=365; } else{ y+=366; } } } a[1]=31; if(u==0){ a[2]=28; } else{ a[2]=29; } a[3]=31; a[4]=30; a[5]=31; a[6]=30; a[7]=31; a[8]=31; a[9]=30; a[10]=31; a[11]=30; a[12]=31; for(i=1;i<=m1;i++){ b+=a[i]; } for(i=1;i<=m2;i++){ c+=a[i]; } b+=d1; c+=d2; all=y+(c-b); printf("%d\n",all); if(y1==-1 && y2==-1 && m1==-1 && m2=-1 && d1==-1 && d2==-1){ break; } } }
main.c: In function 'main': main.c:56:52: error: lvalue required as left operand of assignment 56 | if(y1==-1 && y2==-1 && m1==-1 && m2=-1 && d1==-1 && d2==-1){ | ^
s742801980
p00125
C
#include<stdio.h> #include<string.h> int main(void) { int y1,y2,m1,m2,d1,d2,y=0,i,all=0,b=0,c=0,u; int a[12]={0}; while(1){ scanf("%d %d %d %d %d %d",&y1,&m1,&d1,&y2,&m2,&d2); if(y2-y1!=0){ for(i=y1;i<y2;i++){ u=0; if((i%4)==0){ u=1; if((i%100)==0){ u=0; if((i%400)==0){ u=1; } } } if(u==0){ y+=365; } else{ y+=366; } } } a[1]=31; if(u==0){ a[2]=28; } else{ a[2]=29; } a[3]=31; a[4]=30; a[5]=31; a[6]=30; a[7]=31; a[8]=31; a[9]=30; a[10]=31; a[11]=30; a[12]=31; for(i=1;i<=m1;i++){ b+=a[i]; } for(i=1;i<=m2;i++){ c+=a[i]; } b+=d1; c+=d2; all=y+(c-b); if(y1==-1 && y2==-1 && m1==-1 && m2=-1 && d1==-1 && d2==-1){ break; } printf("%d\n",all); } }
main.c: In function 'main': main.c:55:68: error: lvalue required as left operand of assignment 55 | if(y1==-1 && y2==-1 && m1==-1 && m2=-1 && d1==-1 && d2==-1){ | ^
s700439237
p00125
C
#include<stdio.h> int main(void) { int a[11]={31,28,31,30,31,30,31,31,30,31,30}; int y1,m1,d1,y1,y2,m2,d2; int i,j,n,u,w; while(1){ scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2);// if(y1<0||y2<0||m1<0||m2<0||d1<0||d2<0) break; n=0; for(j=y1;j<=y2;j++){ u=0; if(j%4==0){ u=1; if(j%400==0){ u=1; } else if(j%100==0){ u=0; } } if(u==1){ d2=d2+1; } } n-0; for(i=0;i<m1;i++){ n=n+a[i]; } w=0; for(i=0;i<m2;i++){ w=w+a[i]; } u=0; if(y1%4==0){ u=1; if(y1%400==0){ u=1; } else if(y1%100){ u=0; } if(u==1&&m1>60){ d2=d2-1; } } u=0; if(y2%4==0){ u=1; if(y2%400==0){ u=1; } else if(y2%100){ u=0; } if(u==1&&w<60){ d2=d2-1; } } printf("%d\n",(y2-y1)*365+(w-n)+d2-d1); } return 0; }
main.c: In function 'main': main.c:5:22: error: redeclaration of 'y1' with no linkage 5 | int y1,m1,d1,y1,y2,m2,d2; | ^~ main.c:5:13: note: previous declaration of 'y1' with type 'int' 5 | int y1,m1,d1,y1,y2,m2,d2; | ^~
s269442567
p00125
C
#include<stdio.h> int main(void) { int a[11]={31,28,31,30,31,30,31,31,30,31,30}; int y1,m1,d1,y1,y2,m2,d2; int i,j,n,u,w; while(1){ scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2);// if(y1<0||y2<0||m1<0||m2<0||d1<0||d2<0) break; n=0; for(j=y1;j<=y2;j++){ u=0; if(j%4==0){ u=1; if(j%400==0){ u=1; } else if(j%100==0){ u=0; } } if(u==1){ d2=d2+1; } } n-0; for(i=0;i<m1;i++){ n=n+a[i]; } w=0; for(i=0;i<m2;i++){ w=w+a[i]; } u=0; if(y1%4==0){ u=1; if(y1%400==0){ u=1; } else if(y1%100){ u=0; } if(u==1&&m1>60){ d2=d2-1; } } u=0; if(y2%4==0){ u=1; if(y2%400==0){ u=1; } else if(y2%100){ u=0; } if(u==1&&w<60){ d2=d2-1; } } printf("%d\n",(y2-y1)*365+(w-n)+d2-d1); } return 0; }
main.c: In function 'main': main.c:5:22: error: redeclaration of 'y1' with no linkage 5 | int y1,m1,d1,y1,y2,m2,d2; | ^~ main.c:5:13: note: previous declaration of 'y1' with type 'int' 5 | int y1,m1,d1,y1,y2,m2,d2; | ^~
s933494816
p00125
C
#include<stdio.h> int main(void) { int a[11]={31,28,31,30,31,30,31,31,30,31,30}; int y1,m1,d1,y1,y2,m2,d2; int i,j,n,u,w; while(1){ scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2);// if(y1<0||y2<0||m1<0||m2<0||d1<0||d2<0) break; n=0; for(j=y1;j<=y2;j++){ u=0; if(j%4==0){ u=1; if(j%400==0){ u=1; } else if(j%100==0){ u=0; } } if(u==1){ d2=d2+1; } } n-0; for(i=0;i<m1;i++){ n=n+a[i]; } w=0; for(i=0;i<m2;i++){ w=w+a[i]; } u=0; if(y1%4==0){ u=1; if(y1%400==0){ u=1; } else if(y1%100){ u=0; } if(u==1&&m1>60){ d2=d2-1; } } u=0; if(y2%4==0){ u=1; if(y2%400==0){ u=1; } else if(y2%100){ u=0; } if(u==1&&w<60){ d2=d2-1; } } printf("%d\n",(y2-y1)*365+(w-n)+d2-d1); } return 0; }
main.c: In function 'main': main.c:5:22: error: redeclaration of 'y1' with no linkage 5 | int y1,m1,d1,y1,y2,m2,d2; | ^~ main.c:5:13: note: previous declaration of 'y1' with type 'int' 5 | int y1,m1,d1,y1,y2,m2,d2; | ^~
s675241753
p00125
C
#include<stdio.h> int main(void) { int a[11]={31,28,31,30,31,30,31,31,30,31,30}; int y1,m1,d1,y1,y2,m2,d2; int i,j,n,u,w; while(1){ scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2);//??\??? if(y1<0||y2<0||m1<0||m2<0||d1<0||d2<0) break; n=0; for(j=y1;j<=y2;j++){ u=0; if(j%4==0){ u=1; if(j%400==0){ u=1; } else if(j%100==0){ u=0; } } if(u==1){ d2=d2+1; } } n-0; for(i=0;i<m1;i++){ n=n+a[i]; } w=0; for(i=0;i<m2;i++){ w=w+a[i]; } u=0; if(y1%4==0){ u=1; if(y1%400==0){ u=1; } else if(y1%100){ u=0; } if(u==1&&m1>60){ d2=d2-1; } } u=0; if(y2%4==0){ u=1; if(y2%400==0){ u=1; } else if(y2%100){ u=0; } if(u==1&&w<60){ d2=d2-1; } } printf("%d\n",(y2-y1)*365+(w-n)+d2-d1);//?????? } return 0; }
main.c: In function 'main': main.c:5:22: error: redeclaration of 'y1' with no linkage 5 | int y1,m1,d1,y1,y2,m2,d2; | ^~ main.c:5:13: note: previous declaration of 'y1' with type 'int' 5 | int y1,m1,d1,y1,y2,m2,d2; | ^~
s288667815
p00125
C
#define _CRT_SECURE_NO_WARNINGS ////#define _USE_MATH_DEFINES #include<stdio.h> #include<stdlib.h> ////#include<math.h> //#include<string.h> #include<time.h> #define P(type,x) fprintf(stdout,"%"#type"\n",x) void countDays(); int main() { countDays(); return 0; } void countDays() { int y, m, d, days, yy, mm, dd; time_t s, e; struct tm tms, tme; while (fscanf(stdin, "%d%d%d%d%d%d", &y, &m, &d, &yy, &mm, &dd)) { if (y < 0 || m < 0 || d < 0 || yy < 0 || mm < 0 || dd < 0) break; tms = { 0,0,0,d,m - 1,y - 1900 }; tme = { 0,0,0,dd,mm - 1,yy - 1900 }; days = 0; s = mktime(&tms) + 86400; e = mktime(&tme) + 86400; while (e != s) s += 86400, days++; printf("%d\n", days); } }
main.c: In function 'countDays': main.c:21:23: error: expected expression before '{' token 21 | tms = { 0,0,0,d,m - 1,y - 1900 }; | ^ main.c:22:23: error: expected expression before '{' token 22 | tme = { 0,0,0,dd,mm - 1,yy - 1900 }; | ^
s048177450
p00125
C
#define _CRT_SECURE_NO_WARNINGS //#define _USE_MATH_DEFINES #include<stdio.h> #include<stdlib.h> //#include<math.h> //#include<string.h> //#include<time.h> #define P(type,x) fprintf(stdout,"%"#type"\n",x) int mon[12]{ 0,31,59,90,120,151,181,212,243,273,304,334 },yea[7000]; void countDays(); int serial(int, int, int); int isleap(int); int main() { int i; for (i = 1; i < 7000; i++)yea[i] = yea[i - 1] + 365 + isleap(i - 1); countDays(); return 0; } void countDays() { int y, m, d, days, yy, mm, dd; while (fscanf(stdin, "%d%d%d%d%d%d", &y, &m, &d, &yy, &mm, &dd)) { if (y < 0 || m < 0 || d < 0 || yy < 0 || mm < 0 || dd < 0) break; days = serial(yy, mm, dd) - serial(y, m, d); P(d, days); } } int serial(int y, int m, int d){ return yea[y] + mon[m - 1] + d + (m > 2 && isleap(y) ? 1 : 0); } int isleap(int y){ int isleap; isleap = y % 4 == 0; isleap = isleap && y % 100 != 0; isleap = isleap || y % 400 == 0; return isleap; }
main.c:9:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 9 | int mon[12]{ 0,31,59,90,120,151,181,212,243,273,304,334 },yea[7000]; | ^ main.c:9:58: error: expected identifier or '(' before ',' token 9 | int mon[12]{ 0,31,59,90,120,151,181,212,243,273,304,334 },yea[7000]; | ^ main.c: In function 'main': main.c:15:35: error: 'yea' undeclared (first use in this function) 15 | for (i = 1; i < 7000; i++)yea[i] = yea[i - 1] + 365 + isleap(i - 1); | ^~~ main.c:15:35: note: each undeclared identifier is reported only once for each function it appears in main.c: In function 'serial': main.c:30:16: error: 'yea' undeclared (first use in this function) 30 | return yea[y] + mon[m - 1] + d + (m > 2 && isleap(y) ? 1 : 0); | ^~~ main.c:30:25: error: 'mon' undeclared (first use in this function) 30 | return yea[y] + mon[m - 1] + d + (m > 2 && isleap(y) ? 1 : 0); | ^~~
s657589029
p00125
C
#define _CRT_SECURE_NO_WARNINGS ////#define _USE_MATH_DEFINES #include<stdio.h> //#include<stdlib.h> //#include<math.h> //#include<string.h> #include<time.h> #define P(type,x) fprintf(stdout,"%"#type"\n",x) void countDays(); int main() { countDays(); return 0; } void countDays() { int y, m, d, days, yy, mm, dd; time_t s, e; struct tm tms, tme; while (fscanf(stdin, "%d%d%d%d%d%d", &y, &m, &d, &yy, &mm, &dd)) { if (y < 0 || m < 0 || d < 0 || yy < 0 || mm < 0 || dd < 0) break; tms = { 0,0,0,d,m - 1,y - 1900,0,0,0}; tme = { 0,0,0,dd,mm - 1,yy - 1900,0,0,0}; days = 0; s = mktime(&tms) + 86400; e = mktime(&tme) + 86400; while (e != s) s += 86400, days++; printf("%d\n", days); } }
main.c: In function 'countDays': main.c:21:23: error: expected expression before '{' token 21 | tms = { 0,0,0,d,m - 1,y - 1900,0,0,0}; | ^ main.c:22:23: error: expected expression before '{' token 22 | tme = { 0,0,0,dd,mm - 1,yy - 1900,0,0,0}; | ^
s854609290
p00125
C
#include <stdio.h> int mdays(int y, int m); int uruu(int year); int main(void) { int y1,m1,d1,y2,m2,d2; int i,j,days; while(scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2)){ if(y1<0 || m1<0 || d1<0 || y2<0 || m2<0 || d2<0) break; for(i=y1,days=0; i<=y2; i++) for(i!=y1? j=1: j=m1 ; i!=y2? j<=12: j<=m2 ; j++) days+=mdays(i,j); days-=d1; days-=(mdays(y2,m2)-d2); printf("%d\n",days); } return 0; } int mdays(int y,int m) { int days[12]={31,28,31,30,31,30,31,31,30,31,30,31}; if(uruu(y)) days[1]=29; return days[m-1]; } int uruu(int year) { if(year%400==0) return 1; else if(year%100==0) return 0; else if(year%4==0) return 1; return 0; }
main.c: In function 'main': main.c:15:42: error: lvalue required as left operand of assignment 15 | for(i!=y1? j=1: j=m1 ; i!=y2? j<=12: j<=m2 ; j++) | ^
s218295334
p00125
C
#include <stdio.h> #define leap(x, y, z) ((x)% 400 == 0 || ((x) % 100 && (x) % 4 == 0) ? (y) : (z)) int x[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},a,b,c,d,e,f,i,dc; int main(){ for(;scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f), a != -1;){ dc = -c; i = a % 4; x[2] = leap(a, 29, 28); for(i = b; i <=(a==d?-1e:12); i++) dc += x[i]; for(i = a + 1;i < d;i++) dc += leap(i, 366, 365); x[2] = leap(d, 29, 28); for(i = (a==b?13:1);i < e;i++) dc += x[i]; printf("%d\n", dc + f); } return 0; }
main.c: In function 'main': main.c:11:27: error: exponent has no digits 11 | for(i = b; i <=(a==d?-1e:12); i++) dc += x[i]; | ^~
s557265206
p00125
C
#include <stdio.h> #define leap(x, y, z) ((x)% 400 == 0 || ((x) % 100 && (x) % 4 == 0) ? (y) : (z)) int d[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},a,b,c,d,e,f,i,r; int main(){ for(;scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f), a != -1;){ r = -c; i = a % 4; d[2] = leap(a, 29, 28); for(i = b; i <=(a==d?e-1:12); i++) r += d[i]; for(i = a + 1;i < d;i++) r += leap(i, 366, 365); d[2] = leap(d, 29, 28); for(i = (a==d?13:1);i < e;i++) r += d[i]; printf("%d\n", r + f); } return 0; }
main.c:4:71: error: conflicting types for 'd'; have 'int' 4 | int d[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},a,b,c,d,e,f,i,r; | ^ main.c:4:5: note: previous definition of 'd' with type 'int[13]' 4 | int d[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},a,b,c,d,e,f,i,r; | ^
s609871933
p00125
C++
import java.util.Scanner; class Main{ public static void main(String[] args){ int[] dayday = new int[6]; int di; boolean flag = false; Scanner input = new Scanner(System.in); while(true){ di = 0; for(int i = 0; i < 6; i++){ dayday[i] = input.nextInt(); if (dayday[i] < 0){ flag = true; } } if(flag) break; Day day = new Day(dayday[0], dayday[1], dayday[2]); day.Day2(dayday[3], dayday[4], dayday[5]); di += day.year_d(); di += day.month_d(); di += day.d_d(); System.out.println(di); } } } class Day{ private int year; private int month; private int date; private int year2; private int month2; private int date2; private int uru = 0; public Day(int year, int month, int date){ this.year = year; this.month = month; this.date = date; } public void Day2(int year, int month, int date){ this.year2 = year; this.month2 = month; this.date2 = date; } public void printday(){ System.out.println("year = " + this.year); System.out.println("month = " + this.month); System.out.println("date = " + this.date); System.out.println("year2 = " + this.year2); System.out.println("month2 = " + this.month2); System.out.println("date2 = " + this.date2); } public int year_d(){ for (int i = this.year; i < this.year2; i++){ if (i%4 == 0 && !(i%100 == 0) || i%400 == 0){ this.uru++; } } return (this.year2 - this.year) * 365 + uru; } public int month_d(){ int sum = 0; int sum2 = 0; for (int i = 1; i < this.month; i++){ if(i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12){ sum += 31; } else if(i == 2) { sum += 28; if(uru > 0){ sum--; } } else{ sum += 30; } } for (int i = 1; i < this.month2; i++){ if(i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12){ sum2 += 31; } else if(i == 2) { sum2 += 28; if(uru > 0){ sum2--; } } else{ sum2 += 30; } } return sum2 - sum; } public int d_d(){ this.date2 -= this.date; return date2; } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:15: error: expected ':' before 'static' 4 | public static void main(String[] args){ | ^~~~~~~ | : a.cc:4:33: error: 'String' has not been declared 4 | public static void main(String[] args){ | ^~~~~~ a.cc:4:42: error: expected ',' or '...' before 'args' 4 | public static void main(String[] args){ | ^~~~ a.cc:30:2: error: expected ';' after class definition 30 | } | ^ | ; a.cc: In static member function 'static void Main::main(int*)': a.cc:6:20: error: structured binding declaration cannot have type 'int' 6 | int[] dayday = new int[6]; | ^~ a.cc:6:20: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:6:20: error: empty structured binding declaration a.cc:6:23: error: expected initializer before 'dayday' 6 | int[] dayday = new int[6]; | ^~~~~~ a.cc:8:17: error: 'boolean' was not declared in this scope; did you mean 'bool'? 8 | boolean flag = false; | ^~~~~~~ | bool a.cc:9:17: error: 'Scanner' was not declared in this scope 9 | Scanner input = new Scanner(System.in); | ^~~~~~~ a.cc:14:33: error: 'dayday' was not declared in this scope 14 | dayday[i] = input.nextInt(); | ^~~~~~ a.cc:14:45: error: 'input' was not declared in this scope; did you mean 'int'? 14 | dayday[i] = input.nextInt(); | ^~~~~ | int a.cc:16:41: error: 'flag' was not declared in this scope 16 | flag = true; | ^~~~ a.cc:19:28: error: 'flag' was not declared in this scope 19 | if(flag) break; | ^~~~ a.cc:21:25: error: 'Day' was not declared in this scope 21 | Day day = new Day(dayday[0], dayday[1], dayday[2]); | ^~~ a.cc:22:25: error: 'day' was not declared in this scope 22 | day.Day2(dayday[3], dayday[4], dayday[5]); | ^~~ a.cc:22:34: error: 'dayday' was not declared in this scope 22 | day.Day2(dayday[3], dayday[4], dayday[5]); | ^~~~~~ a.cc:27:25: error: 'System' was not declared in this scope 27 | System.out.println(di); | ^~~~~~ a.cc: At global scope: a.cc:33:16: error: expected ':' before 'int' 33 | private int year; | ^~~~ | : a.cc:34:16: error: expected ':' before 'int' 34 | private int month; | ^~~~ | : a.cc:35:16: error: expected ':' before 'int' 35 | private int date; | ^~~~ | : a.cc:36:16: error: expected ':' before 'int' 36 | private int year2; | ^~~~ | : a.cc:37:16: error: expected ':' before 'int' 37 | private int month2; | ^~~~ | : a.cc:38:16: error: expected ':' before 'int' 38 | private int date2; | ^~~~ | : a.cc:39:16: error: expected ':' before 'int' 39 | private int uru = 0; | ^~~~ | : a.cc:41:15: error: expected ':' before 'Day' 41 | public Day(int year, int month, int date){ | ^~~~ | : a.cc:46:15: error: expected ':' before 'void' 46 | public void Day2(int year, int month, int date){ | ^~~~~ | : a.cc:51:15: error: expected ':' before 'void' 51 | public void printday(){ | ^~~~~ | : a.cc:59:15: error: expected ':' before 'int' 59 | public int year_d(){ | ^~~~ | : a.cc:67:15: error: expected ':' before 'int' 67 | public int month_d(){ | ^~~~ | : a.cc:103:15: error: expected ':' before 'int' 103 | public int d_d(){ | ^~~~ | : a.cc:108:2: error: expected ';' after class definition 108 | } | ^ | ; a.cc: In constructor 'Day::Day(int, int, int)': a.cc:42:22: error: request for member 'year' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 42 | this.year = year; | ^~~~ a.cc:43:22: error: request for member 'month' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 43 | this.month = month; | ^~~~~ a.cc:44:22: error: request for member 'date' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 44 | this.date = date; | ^~~~ a.cc: In member function 'void Day::Day2(int, int, int)': a.cc:47:22: error: request for member 'year2' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 47 | this.year2 = year; | ^~~~~ a.cc:48:22: error: request for member 'month2' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 48 | this.month2 = month; | ^~~~~~ a.cc:49:22: error: request for member 'date2' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 49 | this.date2 = date; | ^~~~~ a.cc: In member function 'void Day::printday()': a.cc:52:17: error: 'System' was not declared in this scope 52 | System.out.println("year = " + this.year); | ^~~~~~ a.cc:52:53: error: request for member 'year' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 52 | System.out.println("year = " + this.year); | ^~~~ a.cc:53:54: error: request for member 'month' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 53 | System.out.println("month = " + this.month); | ^~~~~ a.cc:54:53: error: request for member 'date' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 54 | System.out.println("date = " + this.date); | ^~~~ a.cc:55:54: error: request for member 'year2' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 55 | System.out.println("year2 = " + this.year2); | ^~~~~ a.cc:56:55: error: request for member 'month2' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 56 | System.out.println("month2 = " + this.month2); | ^~~~~~ a.cc:57:54: error: request for member 'date2' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 57 | System.out.println("date2 = " + this.date2); | ^~~~~ a.cc: In member function 'int Day::year_d()': a.cc:60:35: error: request for member 'year' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 60 | for (int i = this.year; i < this.year2; i++){ | ^~~~ a.cc:60:50: error: request for member 'year2' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 60 | for (int i = this.year; i < this.year2; i++){ | ^~~~~ a.cc:62:38: error: request for member 'uru' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 62 | this.uru++; | ^~~ a.cc:65:30: error: request for member 'year2' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 65 | return (this.year2 - this.year) * 365 + uru; | ^~~~~ a.cc:65:43: error: request for member 'year' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 65 | return (this.year2 - this.year) * 365 + uru; | ^~~~ a.cc: In member function 'int Day::month_d()': a.cc:70:42: error: request for member 'month' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 70 | for (int i = 1; i < this.month; i++){ | ^~~~~ a.cc:85:42: error: request for member 'month2' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 85 | for (int i = 1; i < this.month2; i++){ | ^~~~~~ a.cc: In member function 'int Day::d_d()': a.cc:104:22: error: request for member 'date2' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 104 | this.date2 -= this.date; | ^~~~~ a.cc:104:36: error: request for member 'date' in '(Day*)this', which is of pointer type 'Day*' (maybe you meant to use '->' ?) 104 | this.date2 -= this.date;
s289690013
p00125
C++
J:0093 Leap Year??§?????£????????´???????????¢??°????????¨????????¨?\???§?????? #define _USE_MATH_DEFINES #include <iostream> #include <sstream> #include <cmath> #include <algorithm> #include <queue> #include <stack> #include <limits> #include <map> #include <string> #include <cstring> #include <set> #include <deque> using namespace std; typedef long long ll; typedef pair<string,int> P; bool isLeap(int i){ return i % 400 == 0 ? true : i % 100 == 0 ? false : i % 4 == 0 ? true : false; } int getSum(int y,int m,int d,const int* month){ int sum=0; for(int i=0;i<y;i++){ sum += isLeap(i) ? 366 : 365; } for(int i=1;i<m;i++){ sum += i != 2 ? month[i] : isLeap(y) ? month[i] + 1 : month[i]; } sum += d; return sum; } int main(){ const int month[] = {-1,31,28,31,30,31,30,31,31,30,31,30,31}; int y1, m1, d1, y2, m2, d2; while(~scanf("%d %d %d %d %d %d",&y1, &m1, &d1, &y2, &m2, &d2)){ if(y1 < 0 || m1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2 < 0) break; cout << abs(getSum(y1,m1,d1,month) - getSum(y2,m2,d2,month)) << endl; } }
a.cc:1:3: error: invalid digit "9" in octal constant 1 | J:0093 Leap Year??§?????£????????´???????????¢??°????????¨????????¨?\???§?????? | ^~~~ a.cc:1:19: error: extended character § is not valid in an identifier 1 | J:0093 Leap Year??§?????£????????´???????????¢??°????????¨????????¨?\???§?????? | ^ a.cc:1:25: error: extended character £ is not valid in an identifier 1 | J:0093 Leap Year??§?????£????????´???????????¢??°????????¨????????¨?\???§?????? | ^ a.cc:1:46: error: extended character ¢ is not valid in an identifier 1 | J:0093 Leap Year??§?????£????????´???????????¢??°????????¨????????¨?\???§?????? | ^ a.cc:1:49: error: extended character ° is not valid in an identifier 1 | J:0093 Leap Year??§?????£????????´???????????¢??°????????¨????????¨?\???§?????? | ^ a.cc:1:69: error: stray '\' in program 1 | J:0093 Leap Year??§?????£????????´???????????¢??°????????¨????????¨?\???§?????? | ^ a.cc:1:73: error: extended character § is not valid in an identifier 1 | J:0093 Leap Year??§?????£????????´???????????¢??°????????¨????????¨?\???§?????? | ^ a.cc:1:1: error: 'J' does not name a type 1 | J:0093 Leap Year??§?????£????????´???????????¢??°????????¨????????¨?\???§?????? | ^ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:4: /usr/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/exception_ptr.h:38, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ 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/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /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/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared 140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared 142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /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/new:145:52: error: expected primary-expression before 'const' 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /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/new:147:54: error: expected primary-expression before 'const' 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~ /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/new:154:68: error: expected primary-expression before ')' token 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive] 155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /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/new:156:68: error: expected primary-expression before ',' token 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:156:70: error: expected primary-expression before 'const' 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~ /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/new:162:70: error: expected primary-expression before ')' token 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive] 163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 164 | _GLIBCXX_NODISCARD void* operator new[](std
s645604719
p00125
C++
#include<iostream> #include<string> #include<vector> using namespace std; int main() { while (1) { int L, R; L = R = 0; int a, b, c, d, e, f; cin >> a >> b >> c >> d >> e >> f; if (a<0||b<0 || a<0||a<0||a<0||a<)break; for (int g = 1; g < a; g++) { if (g % 400 == 0) L += 366; else if (g % 100 == 0) L += 365; else if (g % 4 == 0)L += 366; else L += 365; } for (int g = 1; g < d; g++) { if (g % 400 == 0) R += 366; else if (g % 100 == 0) R += 365; else if (g % 4 == 0)R += 366; else R += 365; } for (int h = 1; h < b; h++) { switch (h) { case 1:case 3:case 5:case 7:case 8:case 10:case 12:L += 31; break; case 4:case 6:case 9:case 11:L += 30; break; case 2:if (a % 400 == 0) L += 29; else if (a % 100 == 0) L += 28; else if (a % 4 == 0)L += 29; else L += 28; } } for (int h = 1; h < e; h++) { switch (h) { case 1:case 3:case 5:case 7:case 8:case 10:case 12:R += 31; break; case 4:case 6:case 9:case 11:R += 30; break; case 2:if (a % 400 == 0)R += 29; else if (a % 100 == 0) R += 28; else if (a % 4 == 0)R += 29; else R += 28; } } cout << (R + f) - (L + c) << endl; } }
a.cc: In function 'int main()': a.cc:13:50: error: expected primary-expression before ')' token 13 | if (a<0||b<0 || a<0||a<0||a<0||a<)break; | ^
s145534554
p00125
C++
#include<stdio.h> int main(void){ int y1, m1, d1, y2, m2, d2, Y1, Y2; while { scanf("%d %d %d %d %d %d", &y1, &m1, &d1, &y2, &m2, &d2); /*???????????´????±????????????????*/ if ( m1 >= 3) Y1 = y1 + 1; else Y1 = y1; if ( m2 >= 3 ) Y2 = y2; else Y2 = y2 - 1; /*???????????´?????°????±???????*/ for ( i = Y1; i < Y2; i++ ) { if ( i % 4 == 0 ) { if ( i % 400 == 0 ) u++; else if ( i % 100 == 0 ) u++; else u++; } } } return 0; }
a.cc: In function 'int main()': a.cc:4:10: error: expected '(' before '{' token 4 | while { | ^ | ( a.cc:4:10: error: expected primary-expression before '{' token a.cc:4:9: error: expected ')' before '{' token 4 | while { | ^~ | ) a.cc:12:14: error: 'i' was not declared in this scope 12 | for ( i = Y1; i < Y2; i++ ) { | ^ a.cc:14:36: error: 'u' was not declared in this scope 14 | if ( i % 400 == 0 ) u++; | ^ a.cc:15:41: error: 'u' was not declared in this scope 15 | else if ( i % 100 == 0 ) u++; | ^ a.cc:16:21: error: 'u' was not declared in this scope 16 | else u++; | ^
s158453673
p00125
C++
#include <iostream> #include <fstream> #include <string> #include <cstring> #include <cmath> #include <cstdlib> #include <ctime> #include <vector> #include <algorithm> #include <numeric> #include <map> #include <set> #include <stack> #include <queue> #include <deque> #include <functional> #include <cctype> #include <list> //#include <boost/multiprecision/cpp_int.hpp> #define BIT(a) (1 << (a)) #define EPS (1e-10) using namespace std; //using namespace boost::multiprecision; const long long MOD = 1000000007; const int COUNTER_CLOCKWISE = 1; const int CLOCKWISE = -1; const int ONLINE_BACK = 2; const int ONLINE_FRONT = -2; const int ON_SEGMENT = 0; class Point{ public: double x, y; Point(double x = 0, double y = 0): x(x), y(y) {} Point operator+(Point p){return Point(x + p.x, y + p.y);} Point operator-(Point p){return Point(x - p.x, y - p.y);} Point operator*(double a){return Point(a * x, a * y);} Point operator/(double a){return Point(x / a, y / a);} bool operator < (const Point &p) const { return y != p.y ? y < p.y : x < p.x; } double norm(){return x * x + y * y;} }; typedef Point Vector; typedef vector<Vector> Polygon; double cross(Vector a, Vector b){ return a.x*b.y - a.y*b.x; } double dot(Vector a, Vector b){ return a.x * b.x + a.y * b.y; } int ccw(Point p0, Point p1, Point p2){ Vector a = p1 - p0; Vector b = p2 - p0; if (cross(a, b) > EPS)return COUNTER_CLOCKWISE; if (cross(a, b) > -EPS)return CLOCKWISE; if (dot(a, b) < -EPS)return ONLINE_BACK; if (a.norm() < b.norm())return ONLINE_FRONT; return ON_SEGMENT; } Polygon andrewScan(Polygon s){ Polygon u, l; if (s.size() < 3) return s; sort(s.begin(), s.end()); u.push_back(s[0]); u.push_back(s[1]); l.push_back(s[s.size()-1]); l.push_back(s[s.size()-2]); for (size_t i = 2; i < s.size(); i++){ for (size_t n = u.size(); n >= 2 && ccw(u[n-2], u[n-1], s[i]) == COUNTER_CLOCKWISE; n--){ u.pop_back(); } u.push_back(s[i]); } for (int i = (int)s.size() - 3; i >= 0; i--){ for (size_t n = l.size(); n >= 2 && ccw(l[n-2], l[n-1], s[i]) == COUNTER_CLOCKWISE; n--){ l.pop_back(); } l.push_back(s[i]); } reverse(l.begin(), l.end()); for (size_t i = u.size() - 2; i >= 1; i--) l.push_back(u[i]); return l; } long long mod_pow(long long x, long long n){ long long res = 1; for(int i = 0;i < 60; i++){ if(n >> i & 1) res = res * x % MOD; x = x * x % MOD; } return res; } long long ly[55]; long long ry[55]; long long lm[55]; long long rm[55]; long long ld[55]; long long rd[55]; int mimos[13]; int init(){ int month[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; for (int i = 1; i < 13; i++){ mimos[i] = month[i] + mimos[i-1]; } return 0; } int main(void){ int cnt = 0; init(); while (1){ long long tmp[6]; int flag = 0; for (int i = 0; i < 6; i++){ cin >> tmp[i]; if (tmp[i] == -1) flag = 1; } if (flag) break; ly[cnt] = tmp[0]; lm[cnt] = tmp[1]; ld[cnt] = tmp[2]; ry[cnt] = tmp[3]; rm[cnt] = tmp[4]; rd[cnt] = tmp[5]; cnt++; } for (int i = 0; i < cnt; i++){ long long ans = 0; ans += (ry[i] - ly[i])*365; ans -= (mimos[lm[i]-1] + (ld[i] - 1) ans += (mimos[rm[i]-1] + (rd[i] - 1)); if (ry[i] % 4 == 0){ if (rm[i] > 2){ ans++; if (ry[i] % 100 == 0){ ans--; if (ry[i] % 400 == 0){ ans++; } } } } for (long long j = ly[i]; j < ry[i]; j++){ if (j % 4 == 0){ ans += ((ry[i] - j - 1) / 4) + 1; break; } } for (long long j = ly[i]; j < ry[i]; j++){ if (j % 100 == 0){ ans -= (((ry[i] - 1 - j) / 100) + 1); break; } } for (long long j = ly[i]; j < ry[i]; j++){ if (j % 400 == 0){ ans += (((ry[i] - 1 - j) / 400) + 1); break; } } cout << ans << endl; } return 0; }
a.cc: In function 'int main()': a.cc:155:45: error: expected ')' before 'ans' 155 | ans -= (mimos[lm[i]-1] + (ld[i] - 1) | ~ ^ | ) 156 | ans += (mimos[rm[i]-1] + (rd[i] - 1)); | ~~~
s305885098
p00125
C++
#include<iostream> #include<cstdlib> #include<ctime> using namespace std; int main(void){ while( true ){ int y1, m1, d1; int y2, m2, d2; struct tm t1, t2; double diff; time_t second1, second2; cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2; if( y1 == -1 && y2 == -1 && m1 == -1 && m2 == -1 && d1 == -1 && d2 == -1 ) break; memset(&t1,0,sizeof(t1)); memset(&t2,0,sizeof(t2)); t1.tm_year = y1 - 1900; t1.tm_mon = m1 - 1; t1.tm_mday = d1; t2.tm_year = y2 - 1900; t2.tm_mon = m2 - 1; t2.tm_mday = d2; second1 = mktime( &t1 ); second2 = mktime( &t2 ); diff = difftime( second2, second1 ); cout << (int)(diff / (3600*24)) << '\n'; } return 0; }
a.cc: In function 'int main()': a.cc:17:17: error: 'memset' was not declared in this scope 17 | memset(&t1,0,sizeof(t1)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<ctime> +++ |+#include <cstring> 4 | using namespace std;
s169048841
p00125
C++
#include<iostream> using namespace std; #define REP(i,b,n) for(int i=b;i<n;i++) #define rep(i,n) REP(i,0,n) int month[]={ 0, 31,//1 28,//2 31,//3 30,//4 31,//5 30,//6 31,//7 31,//8 30,//9 31,//10 30,//11 31//12 }; int day(int y,int m,int d){ int base = d; REP(i,1,m)base+=month[i]; int lim = m > 2 ? y+1:y; REP(i,1,y){ base+=365 if ( i %400 == 0 || (i % 100 !=0 && i % 4 == 0))base++; } return base; } /* correct version int day(int y,int m,int d){ y += 4800; if (m < 3) --y, m += 12; return 365L*y+y/4-y/100+y/400+(153*m-457)/5+d-32045; } */ main(){ int y1,m1,d1,y2,m2,d2; while(cin>>y1>>m1>>d1>>y2>>m2>>d2 ){ if ( y1 < 0 || m1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2 < 0)break; int a=day(y1,m1,d1),b=day(y2,m2,d2); cout << b-a << endl; } }
a.cc: In function 'int day(int, int, int)': a.cc:28:14: error: expected ';' before 'if' 28 | base+=365 | ^ | ; 29 | if ( i %400 == 0 || | ~~ a.cc: At global scope: a.cc:46:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 46 | main(){ | ^~~~
s439156200
p00125
C++
#include <iostream> using namespace std;int main(){int a,b,c,d,e,f,g;int h[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(y==-1)break;g=f-c+h[mm]-h[m]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}return 0;}
a.cc: In function 'int main()': a.cc:2:141: error: 'y' was not declared in this scope 2 | using namespace std;int main(){int a,b,c,d,e,f,g;int h[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(y==-1)break;g=f-c+h[mm]-h[m]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}return 0;} | ^ a.cc:2:161: error: 'mm' was not declared in this scope; did you mean 'tm'? 2 | using namespace std;int main(){int a,b,c,d,e,f,g;int h[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(y==-1)break;g=f-c+h[mm]-h[m]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}return 0;} | ^~ | tm a.cc:2:167: error: 'm' was not declared in this scope 2 | using namespace std;int main(){int a,b,c,d,e,f,g;int h[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(y==-1)break;g=f-c+h[mm]-h[m]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}return 0;} | ^
s235572906
p00125
C++
#include <iostream> using namespace std;int main(){int a,b,c,d,e,f,g,h[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(y==-1)break;g=f-c+h[mm]-h[m]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}return 0;}
a.cc: In function 'int main()': a.cc:2:137: error: 'y' was not declared in this scope 2 | using namespace std;int main(){int a,b,c,d,e,f,g,h[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(y==-1)break;g=f-c+h[mm]-h[m]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}return 0;} | ^ a.cc:2:157: error: 'mm' was not declared in this scope; did you mean 'tm'? 2 | using namespace std;int main(){int a,b,c,d,e,f,g,h[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(y==-1)break;g=f-c+h[mm]-h[m]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}return 0;} | ^~ | tm a.cc:2:163: error: 'm' was not declared in this scope 2 | using namespace std;int main(){int a,b,c,d,e,f,g,h[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(y==-1)break;g=f-c+h[mm]-h[m]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}return 0;} | ^
s295304903
p00125
C++
#include <iostream> using namespace std;main(){int a,b,c,d,e,f,g,h[]={,,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(a==-1)break;g=f-c+h[e]-h[b]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}}
a.cc:2:21: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | using namespace std;main(){int a,b,c,d,e,f,g,h[]={,,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(a==-1)break;g=f-c+h[e]-h[b]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}} | ^~~~ a.cc: In function 'int main()': a.cc:2:51: error: expected primary-expression before ',' token 2 | using namespace std;main(){int a,b,c,d,e,f,g,h[]={,,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(a==-1)break;g=f-c+h[e]-h[b]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}} | ^ a.cc:2:52: error: expected primary-expression before ',' token 2 | using namespace std;main(){int a,b,c,d,e,f,g,h[]={,,31,59,90,120,151,181,212,243,273,304,334};while(1){cin>>a>>b>>c>>d>>e>>f;if(a==-1)break;g=f-c+h[e]-h[b]+(d-a)*365;if(e<3)d--;if(b<3)a--;g+=d/4-a/4-d/100+a/100+d/400-a/400;cout<<g<<endl;}} | ^
s082985481
p00125
C++
import java.util.*; public class Main { static final int[] days = {0,31,28,31,30,31,30,31,31,30,31,30,31}; public static boolean isUruu(int y) { return (y%4 == 0 && y%100 != 0) || y%400 == 0; } public static int getDays(int y,int m,int d) { int res = 0; for(int i = 1; i <= y-1; ++i) { if(isUruu(i)) res += 366; else res += 365; } for(int i = 1; i <= m-1; ++i) { res += days[i]; if(i == 2 && isUruu(y)) ++res; } res += d; return res; } public static void main(String[] args) { Scanner s = new Scanner(System.in); while(true) { int d[][] = new int[2][3]; boolean flag = false; for(int i = 0; i < 2; ++i) { for(int j = 0; j < 3; ++j) { d[i][j] = s.nextInt(); if(d[i][j] < 0) flag = true; } } if(flag) break; System.out.println(Math.abs(getDays(d[1][0],d[1][1],d[1][2])-getDays(d[0][0],d[0][1],d[0][2]))); } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s975452599
p00125
C++
#include <cstdio> int y1, m1, d1, y2, m2, d2; int day[2][12]={ {31,28,31,30,31,30,31,31,30,31,30,31,31}, {31,29,31,30,31,30,31,31,30,31,30,31,31} }; bool uruu(int year) { if (year%400==0) return true; else if (year%100==0) return false; else if (year%4==0) return true; else return false; } int main() { while (scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2)) { if (y1==-1&&m1==-1&&d1==-1&&y2==-1&&m2==-1&&d2==-1) break; int res = 0, flag; if (y1==y2) { if (uruu(y1)) flag = 1; else flag = 0; if (m1==m2) res = d2-d1; else { for (int i=m1; i<m2; i++) res += day[flag][i]; res += day[flag][m1-1] - d1; res += d2; } } else { if (uruu(y1)) flag = 1; else flag = 0; for (int i=m1; i<12; i++) res += day[flag][i]; res += day[flag][m1-1] - d1; for (int i=y1+1; i<y2; i++) { if (uruu(i)) res += 366; else res += 365; } if (uruu(y2)) flag = 1; else flag = 0; for (int i=0; i<m1-1; i++) res += day[flag][i]; res += d2; } printf("%d\n", res); } }
a.cc:2:5: warning: built-in function 'y1' declared as non-function [-Wbuiltin-declaration-mismatch] 2 | int y1, m1, d1, y2, m2, d2; | ^~ a.cc:6:1: error: too many initializers for 'int [12]' 6 | }; | ^
s942345555
p00125
C++
for(int i = 1 ; i < y ; i++) { day += 365; if(i % 4 == 0 && i % 100 != 0 || i % 400 == 0) day += 1; } for(int i = 1 ; i < m ; i++) { day += 30; if(i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) day++; if(i == 2) day -= 2; //if(u) day++; } } for(int i = 0 ; i < d ; i++) { day++; } return day; }
a.cc:2:3: error: expected unqualified-id before 'for' 2 | for(int i = 1 ; i < y ; i++) { | ^~~ a.cc:2:19: error: 'i' does not name a type 2 | for(int i = 1 ; i < y ; i++) { | ^ a.cc:2:27: error: 'i' does not name a type 2 | for(int i = 1 ; i < y ; i++) { | ^ a.cc:7:3: error: expected unqualified-id before 'for' 7 | for(int i = 1 ; i < m ; i++) { | ^~~ a.cc:7:19: error: 'i' does not name a type 7 | for(int i = 1 ; i < m ; i++) { | ^ a.cc:7:27: error: 'i' does not name a type 7 | for(int i = 1 ; i < m ; i++) { | ^ a.cc:12:3: error: expected unqualified-id before 'for' 12 | for(int i = 0 ; i < d ; i++) { | ^~~ a.cc:12:19: error: 'i' does not name a type 12 | for(int i = 0 ; i < d ; i++) { | ^ a.cc:12:27: error: 'i' does not name a type 12 | for(int i = 0 ; i < d ; i++) { | ^ a.cc:15:3: error: expected unqualified-id before 'return' 15 | return day; | ^~~~~~ a.cc:16:1: error: expected declaration before '}' token 16 | } | ^
s056400934
p00126
C
int main() { //field : ????????°??¬?????¶??? //used : ???????????????????????????????????????????????°????????????????????? int field[10][10], used[10]; //judge : ??°??¬???????????£???????????¨?????????true??? bool judge[10][10]; int num; cin >> num; while(num--) { memset(judge, false, sizeof(judge)); for(int i = 0; i < 9; i++) { for(int j = 0; j< 9; j++) { cin >> field[i][j]; } } for(int i = 0; i < 9; i++) { memset(used, 0, sizeof(used)); for(int j = 0; j < 9; j++) { used[field[i][j]]++; } for(int j = 1; j <=9; j++) { if(used[j] >= 2) { for(int k = 0; k < 9; k++) { if(field[i][k] == j) { judge[i][k] = true; } } } } memset(used, 0, sizeof(used)); for(int j = 0; j < 9; j++) { used[field[j][i]]++; } for(int j = 1; j<= 9; j++) { if(used[j] >= 2) { for(int k = 0; k < 9; k++) { if(field[k][i] == j) { judge[k][i] = true; } } } } } for(int l = 0; l < 9; l+=3) { for(int m = 0; m < 9; m+=3) { memset(used, false, sizeof(used)); for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { used[field[i+l][j+m]]++; } } for(int n = 1; n <=9; n++) { if(used[n] >= 2) { for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { if(field[i+l][j+m] == n) { judge[i+l][j+m] = true; } } } } } } } for(int i = 0; i < 9; i++) { for(int j = 0; j < 9; j++) { printf("%s%d",(judge[i][j])?"*":" " ,field[i][j]); } puts(""); } if(num != 0) { puts(""); } } }
main.c: In function 'main': main.c:7:9: error: unknown type name 'bool' 7 | bool judge[10][10]; | ^~~~ main.c:1:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' +++ |+#include <stdbool.h> 1 | int main() main.c:10:9: error: 'cin' undeclared (first use in this function) 10 | cin >> num; | ^~~ main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in main.c:13:17: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 13 | memset(judge, false, sizeof(judge)); | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset' +++ |+#include <string.h> 1 | int main() main.c:13:17: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch] 13 | memset(judge, false, sizeof(judge)); | ^~~~~~ main.c:13:17: note: include '<string.h>' or provide a declaration of 'memset' main.c:13:31: error: 'false' undeclared (first use in this function) 13 | memset(judge, false, sizeof(judge)); | ^~~~~ main.c:13:31: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' main.c:37:71: error: 'true' undeclared (first use in this function) 37 | judge[i][k] = true; | ^~~~ main.c:37:71: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' main.c:98:33: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 98 | printf("%s%d",(judge[i][j])?"*":" " ,field[i][j]); | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | int main() main.c:98:33: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 98 | printf("%s%d",(judge[i][j])?"*":" " ,field[i][j]); | ^~~~~~ main.c:98:33: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:100:25: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 100 | puts(""); | ^~~~ main.c:100:25: note: include '<stdio.h>' or provide a declaration of 'puts'
s150815821
p00126
C
#include<stdio.h> int main() { //field : ????????°??¬?????¶??? //used : ???????????????????????????????????????????????°????????????????????? int field[10][10], used[10]; //judge : ??°??¬???????????£???????????¨?????????true??? bool judge[10][10]; int num; cin >> num; while(num--) { memset(judge, false, sizeof(judge)); for(int i = 0; i < 9; i++) { for(int j = 0; j< 9; j++) { cin >> field[i][j]; } } for(int i = 0; i < 9; i++) { memset(used, 0, sizeof(used)); for(int j = 0; j < 9; j++) { used[field[i][j]]++; } for(int j = 1; j <=9; j++) { if(used[j] >= 2) { for(int k = 0; k < 9; k++) { if(field[i][k] == j) { judge[i][k] = true; } } } } memset(used, 0, sizeof(used)); for(int j = 0; j < 9; j++) { used[field[j][i]]++; } for(int j = 1; j<= 9; j++) { if(used[j] >= 2) { for(int k = 0; k < 9; k++) { if(field[k][i] == j) { judge[k][i] = true; } } } } } for(int l = 0; l < 9; l+=3) { for(int m = 0; m < 9; m+=3) { memset(used, false, sizeof(used)); for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { used[field[i+l][j+m]]++; } } for(int n = 1; n <=9; n++) { if(used[n] >= 2) { for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { if(field[i+l][j+m] == n) { judge[i+l][j+m] = true; } } } } } } } for(int i = 0; i < 9; i++) { for(int j = 0; j < 9; j++) { printf("%s%d",(judge[i][j])?"*":" " ,field[i][j]); } puts(""); } if(num != 0) { puts(""); } } }
main.c: In function 'main': main.c:8:9: error: unknown type name 'bool' 8 | bool judge[10][10]; | ^~~~ main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 1 | #include<stdio.h> +++ |+#include <stdbool.h> 2 | int main() main.c:11:9: error: 'cin' undeclared (first use in this function) 11 | cin >> num; | ^~~ main.c:11:9: note: each undeclared identifier is reported only once for each function it appears in main.c:14:17: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 14 | memset(judge, false, sizeof(judge)); | ^~~~~~ main.c:2:1: note: include '<string.h>' or provide a declaration of 'memset' 1 | #include<stdio.h> +++ |+#include <string.h> 2 | int main() main.c:14:17: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch] 14 | memset(judge, false, sizeof(judge)); | ^~~~~~ main.c:14:17: note: include '<string.h>' or provide a declaration of 'memset' main.c:14:31: error: 'false' undeclared (first use in this function) 14 | memset(judge, false, sizeof(judge)); | ^~~~~ main.c:14:31: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' main.c:38:71: error: 'true' undeclared (first use in this function) 38 | judge[i][k] = true; | ^~~~ main.c:38:71: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
s470210741
p00126
C++
2 2 1 3 4 5 6 7 8 9 4 5 6 7 8 9 1 2 3 7 8 9 1 2 3 4 5 6 2 3 4 5 6 7 8 9 1 5 6 7 8 9 1 2 3 4 8 9 1 2 3 4 5 6 7 3 4 5 6 7 8 9 1 2 6 7 8 9 1 2 3 4 5 9 1 2 3 4 5 6 7 8 2 1 3 4 5 6 7 8 9 4 5 6 7 8 9 1 2 3 7 8 9 1 2 3 4 5 6 2 3 4 5 6 7 8 9 1 5 6 7 8 9 1 2 3 4 8 9 1 2 3 4 5 6 7 3 4 5 6 7 8 9 1 2 6 7 8 9 1 2 3 4 5 9 1 2 3 4 5 6 7 8
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 2 | ^
s797230455
p00126
C++
#include <bits/std++.h> using namespace std; int puzzle[9][9]; void field(int x, int &to, int &from) { if (0 <= x && x < 3) { to = 0; from = 3; } else if (3 <= x && x < 6) { to = 3; from = 6; } else { to = 6; from = 9; } } bool check1(int x, int y) { for (int i = x-1; i >= 0; i--) { if (puzzle[x][y] == puzzle[i][y]) return 0; } for (int i = x+1; i < 9; i++) { if (puzzle[x][y] == puzzle[i][y]) return 0; } return 1; } bool check2(int x, int y) { for (int i = y-1; i >= 0; i--) { if (puzzle[x][y] == puzzle[x][i]) return 0; } for (int i = y+1; i < 9; i++) { if (puzzle[x][y] == puzzle[x][i]) return 0; } return 1; } bool check3(int x, int y) { int sx, tx, sy, ty; field(x, sx, tx); field(y, sy, ty); for (int i = sx; i < tx; i++) { for (int j = sy; j < ty; j++) { if (x == i && y == j) continue; if (puzzle[x][y] == puzzle[i][j]) return 0; } } return 1; } int main() { int T; cin >> T; for (int t = 0; t < T; t++) { if(t) cout << endl; for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { cin >> puzzle[i][j]; } } char ch[9][9]; for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { ch[i][j] = ' '; } } for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { if (check1(i, j) && check2(i, j) && check3(i, j)) continue; ch[i][j] = '*'; } } for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { cout << ch[i][j] << puzzle[i][j]; } cout << endl; } } return 0; }
a.cc:1:10: fatal error: bits/std++.h: No such file or directory 1 | #include <bits/std++.h> | ^~~~~~~~~~~~~~ compilation terminated.
s013242463
p00126
C++
int main() { //field : ????????°??¬?????¶??? //used : ???????????????????????????????????????????????°????????????????????? int field[10][10], used[10]; //judge : ??°??¬???????????£???????????¨?????????true??? bool judge[10][10]; int num; cin >> num; while(num--) { memset(judge, false, sizeof(judge)); for(int i = 0; i < 9; i++) { for(int j = 0; j< 9; j++) { cin >> field[i][j]; } } for(int i = 0; i < 9; i++) { memset(used, 0, sizeof(used)); for(int j = 0; j < 9; j++) { used[field[i][j]]++; } for(int j = 1; j <=9; j++) { if(used[j] >= 2) { for(int k = 0; k < 9; k++) { if(field[i][k] == j) { judge[i][k] = true; } } } } memset(used, 0, sizeof(used)); for(int j = 0; j < 9; j++) { used[field[j][i]]++; } for(int j = 1; j<= 9; j++) { if(used[j] >= 2) { for(int k = 0; k < 9; k++) { if(field[k][i] == j) { judge[k][i] = true; } } } } } for(int l = 0; l < 9; l+=3) { for(int m = 0; m < 9; m+=3) { memset(used, false, sizeof(used)); for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { used[field[i+l][j+m]]++; } } for(int n = 1; n <=9; n++) { if(used[n] >= 2) { for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { if(field[i+l][j+m] == n) { judge[i+l][j+m] = true; } } } } } } } for(int i = 0; i < 9; i++) { for(int j = 0; j < 9; j++) { printf("%s%d",(judge[i][j])?"*":" " ,field[i][j]); } puts(""); } if(num != 0) { puts(""); } } }
a.cc: In function 'int main()': a.cc:10:9: error: 'cin' was not declared in this scope 10 | cin >> num; | ^~~ a.cc:13:17: error: 'memset' was not declared in this scope 13 | memset(judge, false, sizeof(judge)); | ^~~~~~ a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' +++ |+#include <cstring> 1 | int main() a.cc:98:33: error: 'printf' was not declared in this scope 98 | printf("%s%d",(judge[i][j])?"*":" " ,field[i][j]); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | int main() a.cc:100:25: error: 'puts' was not declared in this scope 100 | puts(""); | ^~~~ a.cc:104:25: error: 'puts' was not declared in this scope 104 | puts(""); | ^~~~
s371978252
p00126
C++
#include<iostream> int main() { //field : ????????°??¬?????¶??? //used : ???????????????????????????????????????????????°????????????????????? int field[10][10], used[10]; //judge : ??°??¬???????????£???????????¨?????????true??? bool judge[10][10]; int num; cin >> num; while(num--) { memset(judge, false, sizeof(judge)); for(int i = 0; i < 9; i++) { for(int j = 0; j< 9; j++) { cin >> field[i][j]; } } for(int i = 0; i < 9; i++) { memset(used, 0, sizeof(used)); for(int j = 0; j < 9; j++) { used[field[i][j]]++; } for(int j = 1; j <=9; j++) { if(used[j] >= 2) { for(int k = 0; k < 9; k++) { if(field[i][k] == j) { judge[i][k] = true; } } } } memset(used, 0, sizeof(used)); for(int j = 0; j < 9; j++) { used[field[j][i]]++; } for(int j = 1; j<= 9; j++) { if(used[j] >= 2) { for(int k = 0; k < 9; k++) { if(field[k][i] == j) { judge[k][i] = true; } } } } } for(int l = 0; l < 9; l+=3) { for(int m = 0; m < 9; m+=3) { memset(used, false, sizeof(used)); for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { used[field[i+l][j+m]]++; } } for(int n = 1; n <=9; n++) { if(used[n] >= 2) { for(int i = 0; i < 3; i++) { for(int j = 0; j < 3; j++) { if(field[i+l][j+m] == n) { judge[i+l][j+m] = true; } } } } } } } for(int i = 0; i < 9; i++) { for(int j = 0; j < 9; j++) { printf("%s%d",(judge[i][j])?"*":" " ,field[i][j]); } puts(""); } if(num != 0) { puts(""); } } }
a.cc: In function 'int main()': a.cc:11:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 11 | cin >> num; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:14:17: error: 'memset' was not declared in this scope 14 | memset(judge, false, sizeof(judge)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring> 2 | int main()
s847067834
p00126
C++
#include <iostream> #include <algorithm> using namespace std; int math[9][9], jud[10] = {}; bool mmath[9][9]; void jj(int x, int y){ int jud2[10][2]; for(int i = 0; i < 10; i++){ fill(jud2[i], jud2[i] + 2, -1); } for(int i = x; i < x + 3; i++){ for(int j = y; j < y + 3; j++){ if(jud2[math[i][j]][0] >= 0){ mmath[i][j] = 1; mmath[jud2[math[i][j]][0]][jud2[math[i][j]][1]] = 1;; } jud2[math[i][j]][0] = i; jud2[math[i][j]][1] = j; } } } int main(){ int n; cin >> n; for(int k = 0; k < n; k++){ for(int i = 0; i < 9; i++) fill(mmath[i], mmath[i] + 9, 0); for(int i = 0; i < 9; i++){ for(int j = 0; j < 9; j++){ cin >> math[i][j]; } } for(int i = 0; i < 9; i++){ fill(jud, jud + 10, -1); for(int j = 0; j < 9; j++){ if(jud[math[i][j]] >= 0){ mmath[i][j] = 1; mmath[i][jud[math[i][j]]] = 1; } jud[math[i][j]] = j; } } for(int i = 0; i < 9; i++){ fill(jud, jud + 10, -1); for(int j = 0; j < 9; j++){ if(jud[math[j][i]] >= 0){ mmath[j][i] = 1; mmath[jud[math[j][i]]][i] = 1; } jud[math[j][i]] = j; } } jj(0, 0); jj(3, 0); jj(6, 0); jj(0, 3); jj(3, 3); jj(6, 3); jj(0, 6); jj(3, 6); jj(6, 6); for(int i = 0; i < 9; i++){ for(int j = 0; j < 9; j++){ if(!mmath[i][j]) cout << " "; else cout << "*" cout << math[i][j]; } cout << endl; } cout << endl; } }
a.cc: In function 'int main()': a.cc:61:52: error: expected ';' before 'cout' 61 | cout << "*" | ^ | ; 62 | cout << math[i][j]; | ~~~~
s915312229
p00126
C++
#include <iostream> using namespace std; const int COL_SIZE = 9; const int ROW_SIZE = 9; void inputBoard( int board[][ COL_SIZE ] ) { for( int i = 0; i < ROW_SIZE; ++i ){ for( int j = 0; j < COL_SIZE; ++j ){ cin >> board[ i ][ j ]; } } } void outputBoard( int board[][ COL_SIZE ], bool check[][ COL_SIZE ] ) { for( int i = 0; i < ROW_SIZE; ++i ){ for( int j = 0; j < COL_SIZE; ++j ){ cout << ( check[ i ][ j ] ? '*' : ' ' ) << board[ i ][ j ]; } cout << endl; } } enum{ COL = 0, ROW, BLOCK }; bool investigate( int board[][ COL_SIZE ], bool check[][ COL_SIZE ] ) { for( int i = 0; i < ROW_SIZE; ++i ){ int usedNumber[ 3 ][ 10 ]; memset( usedNumber, 0, sizeof(usedNumber) ); for( int j = 0; j < COL_SIZE; ++j ){ usedNumber[ COL ][ board[ i ][ j ] ]++; usedNumber[ ROW ][ board[ j ][ i ] ]++; usedNumber[ BLOCK ][ board[ ( i / 3 ) * 3 + j / 3 ][ ( i % 3 ) * 3 + j % 3 ] ]++; } for( int j = 0; j < COL_SIZE; ++j ){ if( usedNumber[ COL ][ board[ i ][ j ] ] > 1 ){ check[ i ][ j ] = true; } if( usedNumber[ ROW ][ board[ j ][ i ] ] > 1 ){ check[ j ][ i ] = true; } int y = ( i / 3 ) * 3 + j / 3; int x = ( i % 3 ) * 3 + j % 3; if( usedNumber[ BLOCK][ board[ y ][ x ] ] > 1 ){ check[ y ][ x ] = true; } } } return false; } int main() { int n; cin >> n; for( int i = 0; i < n; ++i ){ int board[ ROW_SIZE ][ COL_SIZE ]; bool check[ ROW_SIZE ][ COL_SIZE ]; memset( check, 0, sizeof(check) ); inputBoard( board ); investigate( board, check ); if( i != 0 ){ cout << endl; } outputBoard( board, check ); } return 0; }
a.cc: In function 'bool investigate(int (*)[9], bool (*)[9])': a.cc:36:17: error: 'memset' was not declared in this scope 36 | memset( usedNumber, 0, sizeof(usedNumber) ); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | using namespace std; a.cc: In function 'int main()': a.cc:66:17: error: 'memset' was not declared in this scope 66 | memset( check, 0, sizeof(check) ); | ^~~~~~ a.cc:66:17: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
s455873486
p00126
C++
#include<iostream> #include<set> #include<utility> typedef std::pair<int, int> P; bool ver[9][9], hor[9][9], sq[9][9]; int n; char puzzle[9][9]; std::set<int> s[3][9]; // k: 0 -> ver, 1 -> hor, 2 -> sq int f( int k, int i, int j ) { switch( k ) { case 0: return j; case 1: return i; case 2: return i / 3 * 3 + j / 3; } } int main() { std::cin >> n; bool fst = true; while( n-- ) { memset( ver, false, sizeof( ver ) ); memset( hor, false, sizeof( hor ) ); memset( sq, false, sizeof( sq ) ); for( int i = 0; i != 3; ++i ) for( int j = 0; j != 9; ++j ) s[i][j].clear(); for( int i = 0; i != 9; ++i ) { for( int j = 0; j != 9; ++j ) { std::cin >> puzzle[i][j]; int t = puzzle[i][j] - '1'; int fl = ver[f(0, i, j)][t] | ( hor[f(1, i, j)][t] << 1 ) | ( sq[f(2, i, j)][t] << 2 ); if( !fl ) ver[f(0, i, j)][t] = hor[f(1, i, j)][t] = sq[f(2, i, j)][t] = true; else { for( int k = 0; k != 3; ++k ) if( fl >> k & 1 ) s[k][f(k, i, j)].insert( t ); } } } if( !fst ) std::cout << std::endl; for( int i = 0; i != 9; ++i ) { for( int j = 0; j != 9; ++j ) { bool fl = false; for( int k = 0; k != 3; ++k ) fl |= s[k][f(k, i, j)].count( puzzle[i][j] - '1' ); std::cout << ( fl ? '*' : ' ' ) << puzzle[i][j]; } std::cout << std::endl; } fst = false; } return 0; }
a.cc: In function 'int main()': a.cc:33:17: error: 'memset' was not declared in this scope 33 | memset( ver, false, sizeof( ver ) ); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<utility> +++ |+#include <cstring> 4 | a.cc: In function 'int f(int, int, int)': a.cc:24:1: warning: control reaches end of non-void function [-Wreturn-type] 24 | } | ^
s576831394
p00126
C++
#include <iostream> using namespace std; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { if (i != 0) { cout << endl << flush; } int hyou[9][9][2] = {0}; for (int j = 0; j < 9; j++) { for (int k = 0; k < 9; k++) { cin >> hyou[j][k][0]; } } int hantei3[9][9] = {0}; for (int j = 0; j < 9; j++) { int hantei[9] = {0}; int hantei2[9] = {0}; int p; for (int k = 0; k < 9; k++) { hantei[hyou[j][k][0]-1]++; // yoko hantei2[hyou[k][j][0]-1]++; // tate if (0 <= k && k <= 2) { if (0 <= j && j <= 2) { p = 0; } else if (3 <= j && j <= 5) { p = 3; } else { p = 6; } } else if (3 <= k && k <= 5) { if (0 <= j && j <= 2) { p = 1; } else if (3 <= j && j <= 5) { p = 4; } else { p = 7; } } else { if (0 <= j && j <= 2) { p = 2; } else if (3 <= j && j <= 5) { p = 5; } else { p = 8; } } hantei[p][hyou[j][k][0]-1]++; } for (int k = 0; k < 9; k++) { if (hantei[hyou[j][k][0]-1] > 1) { hyou[j][k][1]++; } if (hantei2[hyou[k][j][0]-1] > 1) { hyou[k][j][1]++; } } } for (int j = 0; j < 9; j++) { int p; for (int k = 0; k < 9; k++) { if (0 <= k && k <= 2) { if (0 <= j && j <= 2) { p = 0; } else if (3 <= j && j <= 5) { p = 3; } else { p = 6; } } else if (3 <= k && k <= 5) { if (0 <= j && j <= 2) { p = 1; } else if (3 <= j && j <= 5) { p = 4; } else { p = 7; } } else { if (0 <= j && j <= 2) { p = 2; } else if (3 <= j && j <= 5) { p = 5; } else { p = 8; } } if (hantei3[p][hyou[j][k][0]-1] > 1) { hyou[j][k][1]++; } } } for (int j = 0; j < 9; j++) { for (int k = 0; k < 9; k++) { if (hyou[j][k][1] > 0) { cout << "*" << flush; } else { cout << " " << flush; } cout << hyou[j][k][0] << flush; } cout << endl << flush; } } return 0; }
a.cc: In function 'int main()': a.cc:51:42: error: invalid types 'int[int]' for array subscript 51 | hantei[p][hyou[j][k][0]-1]++; | ^
s298827173
p00126
C++
#include <iostream> using namespace std; int main() { int n; cin >> n; bool flag = false; for(int i = 0; i < n; i++) { int board[16][16]; char mark[16][16]; memset(mark, ' ', sizeof(mark)); for(int j = 0; j < 9; j++) for(int k = 0; k < 9; k++) cin >> board[j][k]; // row & comlumn for(int j = 0; j < 9; j++) { for(int k = 0; k < 9; k++) { for(int l = k + 1; l < 9; l++) { if(board[j][k] == board[j][l]) mark[j][k] = mark[j][l] = '*'; if(board[k][j] == board[l][j]) mark[k][j] = mark[l][j] = '*'; } } } // block for(int j = 0; j < 3; j++) { for(int k = 0; k < 3; k++) { for(int l = 0; l < 3; l++) { for(int m = 0; m < 3; m++) { for(int n = l + 1; n < 3; n++) { for(int o = m + 1; o < 3; o++) { if(board[j * 3 + l][k * 3 + m] == board[j * 3 + n][k * 3 + o]) mark[j * 3 + l][k * 3 + m] = mark[j * 3 + n][k * 3 + o] = '*'; } } } } } } if(flag) cout << endl; for(int j = 0; j < 9; j++) { for(int k = 0; k < 9; k++) { cout << mark[j][k] << board[j][k]; } cout << endl; } flag = true; } return 0; }
a.cc: In function 'int main()': a.cc:12:17: error: 'memset' was not declared in this scope 12 | memset(mark, ' ', sizeof(mark)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | using namespace std;
s626151047
p00127
Java
import java.util.*; public class aoj0127 { static final Scanner stdin = new Scanner(System.in); static char[][] map = { {'a', 'b', 'c', 'd', 'e'}, {'f', 'g', 'h', 'i', 'j'}, {'k', 'l', 'm', 'n', 'o'}, {'p', 'q', 'r', 's', 't'}, {'u', 'v', 'w', 'x', 'y'}, {'z', '.', '?', '!', ' '}}; public static void main(String[] args) { while(stdin.hasNext()){ char[] line = stdin.nextLine().toCharArray(); StringBuilder ans = new StringBuilder(); try{ for(int i = 0; i < line.length; i+=2) ans.append(map[line[i]-'1'][line[i+1]-'1']); }catch(Exception e){ ans = new StringBuilder("NA"); }finally{ System.out.println(ans.toString()); } } } }
Main.java:2: error: class aoj0127 is public, should be declared in a file named aoj0127.java public class aoj0127 { ^ 1 error
s049380911
p00127
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class P127 { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String input; while((input = br.readLine()) != null){ System.out.println(encode(input)); } } public static String encode(String input){ if(input.length() % 2 != 0) return "NA"; StringBuffer sbuf = new StringBuffer(); for(int i = 0; i < input.length(); i += 2){ //数字を英字に変換 int raw = Integer.parseInt(input.substring(i, i + 1)); int line = Integer.parseInt(input.substring(i + 1, i + 2)); int c = 'a' + (raw - 1) * 5 + line - 1; if(c > 'z' + 4) return "NA"; if(c == 'z' + 1) c = '.'; else if(c == 'z' + 2) c = '?'; else if(c == 'z' + 3) c = '!'; else if(c == 'z' + 4) c = ' '; sbuf.append((char)c); } return sbuf.toString(); } }
Main.java:5: error: class P127 is public, should be declared in a file named P127.java public class P127 { ^ 1 error
s331244014
p00127
C
#include <cstdio> #include <string.h> using namespace std; int main() { char change[6][6] = { "abcde", "fghij", "klmno", "pqrst", "uvwxy", "z.?! " }; char str[256]; while (scanf("%s", str) != EOF){ char str2[256]; strcpy(str2, ""); int i = 0; while (str[i] != '\0'){ if ( (str[i] < '1' || str[i] > '6') || (str[i + 1] < '1' || str[i + 1] > '5') ){ strcpy(str2, "NA"); break; } strncat(str2, &change[str[i] - '0' - 1][str[i + 1] - '0' - 1], 1); i += 2; } printf("%s\n", str2); } return 0; }
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.