QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#328616#8113. SudokuKevin5307#50 ✓0ms3816kbC++23943b2024-02-15 22:02:372024-07-04 03:23:59

Judging History

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

  • [2024-07-04 03:23:59]
  • 评测
  • 测评结果:50
  • 用时:0ms
  • 内存:3816kb
  • [2024-02-15 22:02:37]
  • 提交

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(s.length()==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

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 11
Accepted

Test #1:

score: 11
Accepted
time: 0ms
memory: 3796kb

input:

+---+---+---+
|...|4..|...|
|..9|6..|.9.|
|...|...|...|
+---+---+---+
|3..|..3|54.|
|642|8..|...|
|...|.1.|6.2|
+---+---+---+
|15.|.8.|1.4|
|...|...|.3.|
|.9.|...|...|
+---+---+---+

output:

GRESKA

result:

ok single line: 'GRESKA'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3800kb

input:

+---+---+---+
|8.6|.2.|.9.|
|3.5|3..|...|
|7.9|.6.|...|
+---+---+---+
|...|2..|21.|
|2..|...|...|
|...|4..|..5|
+---+---+---+
|...|...|...|
|...|...|.3.|
|...|..9|..7|
+---+---+---+

output:

GRESKA

result:

ok single line: 'GRESKA'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3512kb

input:

+---+---+---+
|...|...|...|
|.94|8..|.6.|
|...|..4|...|
+---+---+---+
|73.|7..|.9.|
|...|...|8..|
|6.5|9..|...|
+---+---+---+
|.7.|..3|5..|
|...|.48|.76|
|.68|...|...|
+---+---+---+

output:

GRESKA

result:

ok single line: 'GRESKA'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3516kb

input:

+---+---+---+
|...|6..|5.3|
|.5.|...|91.|
|7..|...|..6|
+---+---+---+
|.8.|5..|7..|
|...|...|2..|
|9.2|...|.38|
+---+---+---+
|2..|.1.|.5.|
|..8|.68|.89|
|...|42.|...|
+---+---+---+

output:

GRESKA

result:

ok single line: 'GRESKA'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3772kb

input:

+---+---+---+
|...|...|...|
|...|...|.94|
|8..|...|6..|
+---+---+---+
|.4.|...|...|
|...|.9.|3.5|
|.12|..3|4..|
+---+---+---+
|.7.|...|...|
|...|24.|...|
|1..|8..|..6|
+---+---+---+

output:

OK

result:

ok single line: 'OK'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3464kb

input:

+---+---+---+
|78.|...|...|
|...|..6|..8|
|.53|...|...|
+---+---+---+
|34.|..7|...|
|..2|...|...|
|571|2..|...|
+---+---+---+
|...|.6.|492|
|.2.|.5.|3..|
|...|.7.|...|
+---+---+---+

output:

OK

result:

ok single line: 'OK'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3504kb

input:

+---+---+---+
|.3.|.87|1.2|
|...|.2.|..5|
|...|.3.|...|
+---+---+---+
|...|..8|.3.|
|.56|..3|...|
|...|.9.|...|
+---+---+---+
|.7.|..4|...|
|5..|...|..7|
|6..|...|...|
+---+---+---+

output:

OK

result:

ok single line: 'OK'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3516kb

input:

+---+---+---+
|...|...|...|
|9..|.3.|...|
|...|...|.4.|
+---+---+---+
|...|.28|...|
|.4.|...|...|
|.8.|...|...|
+---+---+---+
|..3|...|.7.|
|...|.1.|...|
|.6.|.7.|..4|
+---+---+---+

output:

OK

result:

ok single line: 'OK'

Subtask #2:

score: 12
Accepted

Test #9:

score: 12
Accepted
time: 0ms
memory: 3588kb

input:

+---+---+---+
|.93|...|.6.|
|.8.|...|.7.|
|1..|354|..8|
+---+---+---+
|...|.53|...|
|.17|...|.6.|
|6.8|2..|5..|
+---+---+---+
|698|.1.|.2.|
|...|.4.|9.1|
|4..|.6.|.8.|
+---+---+---+

output:

GRESKA

result:

ok single line: 'GRESKA'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

+---+---+---+
|..6|15.|..2|
|...|49.|.6.|
|53.|8..|...|
+---+---+---+
|..5|...|..3|
|...|...|..4|
|..7|8.1|.9.|
+---+---+---+
|...|...|...|
|1.7|.9.|...|
|.4.|1.7|..5|
+---+---+---+

output:

GRESKA

result:

ok single line: 'GRESKA'

Test #11:

score: 0
Accepted
time: 0ms
memory: 3576kb

input:

+---+---+---+
|..7|...|.28|
|..1|...|..3|
|.4.|.9.|..6|
+---+---+---+
|.84|...|...|
|.76|..3|..8|
|...|...|..4|
+---+---+---+
|..3|42.|85.|
|.5.|..3|.46|
|.1.|...|...|
+---+---+---+

output:

GRESKA

result:

ok single line: 'GRESKA'

Test #12:

score: 0
Accepted
time: 0ms
memory: 3536kb

input:

+---+---+---+
|..8|3..|2..|
|9.2|...|...|
|.4.|2..|.6.|
+---+---+---+
|.9.|...|.1.|
|6.3|...|..7|
|...|.1.|.8.|
+---+---+---+
|...|...|78.|
|.7.|6..|..2|
|..3|7..|9..|
+---+---+---+

output:

GRESKA

result:

ok single line: 'GRESKA'

Test #13:

score: 0
Accepted
time: 0ms
memory: 3768kb

input:

+---+---+---+
|...|.84|...|
|.27|.1.|...|
|...|2..|4..|
+---+---+---+
|...|...|7.2|
|...|..6|..3|
|.1.|..3|...|
+---+---+---+
|5..|7..|...|
|.8.|...|...|
|.4.|6..|...|
+---+---+---+

output:

OK

result:

ok single line: 'OK'

Test #14:

score: 0
Accepted
time: 0ms
memory: 3496kb

input:

+---+---+---+
|.3.|5..|...|
|..6|.1.|...|
|...|.4.|...|
+---+---+---+
|..3|..2|...|
|.6.|.5.|.9.|
|..2|...|3.8|
+---+---+---+
|...|..5|8.9|
|8..|...|...|
|...|...|.6.|
+---+---+---+

output:

OK

result:

ok single line: 'OK'

Test #15:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

+---+---+---+
|...|6.8|...|
|...|...|9..|
|...|..7|...|
+---+---+---+
|.72|.8.|3..|
|...|...|..5|
|9.6|..3|1..|
+---+---+---+
|...|5..|.9.|
|...|...|.34|
|..7|...|..2|
+---+---+---+

output:

OK

result:

ok single line: 'OK'

Test #16:

score: 0
Accepted
time: 0ms
memory: 3812kb

input:

+---+---+---+
|8..|...|.5.|
|...|...|.4.|
|9..|1.7|..2|
+---+---+---+
|.3.|5..|...|
|75.|.3.|...|
|2..|.1.|...|
+---+---+---+
|..4|...|...|
|...|..5|.8.|
|...|...|.64|
+---+---+---+

output:

OK

result:

ok single line: 'OK'

Subtask #3:

score: 13
Accepted

Test #17:

score: 13
Accepted
time: 0ms
memory: 3732kb

input:

+---+---+---+
|132|.9.|67.|
|...|.3.|...|
|.1.|.29|4..|
+---+---+---+
|.2.|9.8|..4|
|4.8|1.6|7..|
|6..|...|...|
+---+---+---+
|...|.1.|...|
|2..|...|...|
|..5|.7.|24.|
+---+---+---+

output:

GRESKA

result:

ok single line: 'GRESKA'

Test #18:

score: 0
Accepted
time: 0ms
memory: 3808kb

input:

+---+---+---+
|537|...|...|
|.28|.5.|.91|
|..4|...|...|
+---+---+---+
|...|.12|...|
|...|..5|...|
|4.1|...|..5|
+---+---+---+
|.9.|.6.|.5.|
|...|..9|.3.|
|..9|74.|..8|
+---+---+---+

output:

GRESKA

result:

ok single line: 'GRESKA'

Test #19:

score: 0
Accepted
time: 0ms
memory: 3516kb

input:

+---+---+---+
|7..|.2.|.5.|
|.6.|.3.|4..|
|..9|..8|..6|
+---+---+---+
|...|...|.9.|
|...|...|..8|
|938|7..|5.4|
+---+---+---+
|.5.|...|8..|
|.13|...|.8.|
|1..|8..|.4.|
+---+---+---+

output:

GRESKA

result:

ok single line: 'GRESKA'

Test #20:

score: 0
Accepted
time: 0ms
memory: 3800kb

input:

+---+---+---+
|.47|8..|.9.|
|6..|...|...|
|5..|31.|..4|
+---+---+---+
|8..|..4|..9|
|16.|...|9.2|
|...|7.9|..1|
+---+---+---+
|3..|69.|.8.|
|7..|.4.|...|
|.82|4..|5..|
+---+---+---+

output:

GRESKA

result:

ok single line: 'GRESKA'

Test #21:

score: 0
Accepted
time: 0ms
memory: 3576kb

input:

+---+---+---+
|...|..5|7..|
|.8.|.4.|.5.|
|...|...|.21|
+---+---+---+
|...|...|...|
|43.|...|...|
|...|..6|..4|
+---+---+---+
|8..|.1.|..6|
|..4|...|3.8|
|5.7|8..|...|
+---+---+---+

output:

OK

result:

ok single line: 'OK'

Test #22:

score: 0
Accepted
time: 0ms
memory: 3472kb

input:

+---+---+---+
|2..|...|...|
|...|...|.5.|
|...|7..|...|
+---+---+---+
|...|...|.8.|
|..1|..7|...|
|...|8.3|.1.|
+---+---+---+
|.1.|4..|.6.|
|...|...|..7|
|.4.|...|..1|
+---+---+---+

output:

OK

result:

ok single line: 'OK'

Test #23:

score: 0
Accepted
time: 0ms
memory: 3476kb

input:

+---+---+---+
|..7|...|.64|
|.89|...|..3|
|...|...|...|
+---+---+---+
|...|...|...|
|..5|3..|7..|
|...|...|...|
+---+---+---+
|...|...|...|
|...|...|...|
|..8|1.9|...|
+---+---+---+

output:

OK

result:

ok single line: 'OK'

Test #24:

score: 0
Accepted
time: 0ms
memory: 3764kb

input:

+---+---+---+
|...|..5|...|
|1.7|...|...|
|...|...|.5.|
+---+---+---+
|...|.8.|.4.|
|.4.|...|...|
|...|..2|36.|
+---+---+---+
|...|1.7|..2|
|...|269|...|
|...|...|...|
+---+---+---+

output:

OK

result:

ok single line: 'OK'

Subtask #4:

score: 14
Accepted

Test #25:

score: 14
Accepted
time: 0ms
memory: 3768kb

input:

+---+---+---+
|.1.|...|2..|
|5..|9.9|3.8|
|.8.|.5.|..7|
+---+---+---+
|625|685|6.3|
|...|3.4|..6|
|8.9|..6|5..|
+---+---+---+
|...|32.|...|
|5.3|.2.|.1.|
|8.9|2..|8.9|
+---+---+---+

output:

GRESKA

result:

ok single line: 'GRESKA'

Test #26:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

+---+---+---+
|48.|...|872|
|8..|1..|81.|
|54.|2.5|2.7|
+---+---+---+
|993|...|812|
|66.|...|...|
|..6|...|..1|
+---+---+---+
|25.|..3|5..|
|287|...|.5.|
|...|.5.|4..|
+---+---+---+

output:

GRESKA

result:

ok single line: 'GRESKA'

Test #27:

score: 0
Accepted
time: 0ms
memory: 3816kb

input:

+---+---+---+
|9.6|1..|..4|
|29.|.9.|34.|
|5..|729|9..|
+---+---+---+
|.12|.4.|..3|
|6..|152|444|
|..5|..8|..2|
+---+---+---+
|.9.|..7|28.|
|..5|121|..8|
|..8|..5|...|
+---+---+---+

output:

GRESKA

result:

ok single line: 'GRESKA'

Test #28:

score: 0
Accepted
time: 0ms
memory: 3768kb

input:

+---+---+---+
|6..|463|.81|
|..4|79.|42.|
|551|1.7|...|
+---+---+---+
|7.7|2.9|9.1|
|7..|.5.|.9.|
|..4|.6.|.4.|
+---+---+---+
|..9|313|.3.|
|6.6|679|8..|
|9..|2..|..5|
+---+---+---+

output:

GRESKA

result:

ok single line: 'GRESKA'

Test #29:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

+---+---+---+
|...|...|.7.|
|...|...|..8|
|...|548|...|
+---+---+---+
|...|..7|.93|
|5..|8..|...|
|..9|...|..4|
+---+---+---+
|6.3|.5.|..2|
|82.|1..|...|
|..4|.6.|...|
+---+---+---+

output:

OK

result:

ok single line: 'OK'

Test #30:

score: 0
Accepted
time: 0ms
memory: 3576kb

input:

+---+---+---+
|2..|...|..8|
|...|.5.|2..|
|...|...|...|
+---+---+---+
|.2.|..3|...|
|.4.|..5|...|
|.9.|...|...|
+---+---+---+
|...|...|..2|
|...|...|..7|
|.54|.1.|...|
+---+---+---+

output:

OK

result:

ok single line: 'OK'

Test #31:

score: 0
Accepted
time: 0ms
memory: 3812kb

input:

+---+---+---+
|...|1..|5..|
|...|...|.3.|
|...|3..|...|
+---+---+---+
|..9|.1.|3.8|
|...|27.|...|
|...|.6.|.1.|
+---+---+---+
|..6|9..|.8.|
|.97|...|..6|
|8..|...|..3|
+---+---+---+

output:

OK

result:

ok single line: 'OK'

Test #32:

score: 0
Accepted
time: 0ms
memory: 3736kb

input:

+---+---+---+
|...|5..|6..|
|.3.|7..|5..|
|...|...|...|
+---+---+---+
|...|4..|...|
|...|.9.|..6|
|.6.|.1.|...|
+---+---+---+
|..5|...|...|
|3..|...|...|
|...|...|.2.|
+---+---+---+

output:

OK

result:

ok single line: 'OK'

Test #33:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

+---+---+---+
|..1|...|...|
|...|7..|.5.|
|.2.|.4.|.1.|
+---+---+---+
|8.2|...|1..|
|..7|.1.|.8.|
|6..|.3.|..3|
+---+---+---+
|546|2..|..6|
|..9|..9|..8|
|...|...|3..|
+---+---+---+

output:

GRESKA

result:

ok single line: 'GRESKA'

Test #34:

score: 0
Accepted
time: 0ms
memory: 3736kb

input:

+---+---+---+
|95.|...|..3|
|.36|.1.|..2|
|..1|7.3|5.9|
+---+---+---+
|..9|...|2.6|
|...|..3|.9.|
|..4|...|.5.|
+---+---+---+
|...|...|3..|
|...|.92|.6.|
|2.8|..4|91.|
+---+---+---+

output:

GRESKA

result:

ok single line: 'GRESKA'

Test #35:

score: 0
Accepted
time: 0ms
memory: 3772kb

input:

+---+---+---+
|...|1.6|..4|
|...|...|.13|
|7..|..5|1..|
+---+---+---+
|..2|4..|..5|
|.5.|...|...|
|..9|7..|...|
+---+---+---+
|...|25.|...|
|..3|.18|...|
|8..|...|2.1|
+---+---+---+

output:

GRESKA

result:

ok single line: 'GRESKA'

Extra Test:

score: 0
Extra Test Passed