QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#328615#8113. SudokuKevin5307#Compile Error//C++23938b2024-02-15 22:02:082024-07-04 03:23:58

Judging History

你现在查看的是最新测评结果

  • [2024-07-04 03:23:58]
  • 评测
  • [2024-02-15 22:02:08]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
string grid[11];
int main()
{
	int c=0;
	string s;
	char ch=getchar();
	while(ch!=EOF)
	{
		if(isdigit(ch)||ch=='.')
			s+=ch;
		if(sz(s)==9)
		{
			grid[c++]=s;
			s.clear();
		}
		ch=getchar();
	}
	for(int i=0;i<9;i++)
		for(int a=0;a<9;a++)
			for(int b=a+1;b<9;b++)
				if(grid[i][a]==grid[i][b]&&grid[i][a]!='.')
				{
					puts("GRESKA");
					return 0;
				}
	for(int i=0;i<9;i++)
		for(int a=0;a<9;a++)
			for(int b=a+1;b<9;b++)
				if(grid[a][i]==grid[b][i]&&grid[a][i]!='.')
				{
					puts("GRESKA");
					return 0;
				}
	for(int i=0;i<9;i++)
		for(int j=0;j<9;j++)
			for(int a=0;a<9;a++)
				for(int b=0;b<9;b++)
					if(a!=i||b!=j)
						if(a/3==i/3)
							if(b/3==j/3)
								if(grid[i][j]==grid[a][b])
									if(grid[i][j]!='.')
									{
										puts("GRESKA");
										return 0;
									}
	puts("OK");
	return 0;
}

Details

answer.code: In function ‘int main()’:
answer.code:13:20: error: ‘sz’ was not declared in this scope; did you mean ‘s’?
   13 |                 if(sz(s)==9)
      |                    ^~
      |                    s