QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#821617#9068. Triple SevensLaVuna47#AC ✓0ms3712kbC++171.6kb2024-12-19 16:58:412024-12-19 16:58:47

Judging History

This is the latest submission verdict.

  • [2024-12-19 16:58:47]
  • Judged
  • Verdict: AC
  • Time: 0ms
  • Memory: 3712kb
  • [2024-12-19 16:58:41]
  • Submitted

answer

/** gnu specific **/
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
/** contains everything I need in std **/
#include <bits/stdc++.h>

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(S) ((int)S.size())
#define FOR(i, st_, n) for(int i = st_; i < n; ++i)
#define RFOR(i, n, end_) for(int i = (n)-1; i >= end_; --i)
#define x first
#define y second
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef unsigned long long ull;
typedef long double LD;
typedef pair<ull, ull> pull;
using namespace __gnu_pbds;
typedef tree<ll, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
using namespace std;
#ifdef ONPC
mt19937 rnd(228);
#else
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif


int solve()
{
	int n;
	if(!(cin>>n))return 1;
	bool ok =true;
	FOR(i,0,3)
	{
		bool cur_ok=false;
		int el;
		FOR(j,0,n)
		{
			cin>> el;
			if(el==7)cur_ok=true;
		}
		if(!cur_ok)ok=false;
	}
	if(ok)cout<<"777\n";
	else cout<<"0\n";
    return 0;
}

int32_t main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int TET = 1e9;
    //cin >> TET;
    for (int i = 1; i <= TET; i++)
    {
        if (solve())
        {
            break;
        }
#ifdef ONPC
        cout << "__________________________" << endl;
#endif
    }
#ifdef ONPC
    cerr << endl << "finished in " << clock() * 1.0 / CLOCKS_PER_SEC << " sec" << endl;
#endif
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3704kb

input:

2
0 7
7 3
7 0

output:

777

result:

ok single line: '777'

Test #2:

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

input:

2
0 7
7 3
3 9

output:

0

result:

ok single line: '0'

Test #3:

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

input:

1
7
7
7

output:

777

result:

ok single line: '777'

Test #4:

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

input:

10
5 6 3 2 8 1 9 7 0 4
5 9 0 4 8 6 7 2 3 1
9 1 0 4 5 3 2 7 6 8

output:

777

result:

ok single line: '777'

Test #5:

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

input:

1
6
0
8

output:

0

result:

ok single line: '0'

Test #6:

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

input:

2
6 7
0 7
8 7

output:

777

result:

ok single line: '777'

Test #7:

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

input:

2
1 6
3 9
8 4

output:

0

result:

ok single line: '0'

Test #8:

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

input:

3
1 7 6
7 9 3
7 8 4

output:

777

result:

ok single line: '777'

Test #9:

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

input:

3
2 4 6
3 4 8
1 8 5

output:

0

result:

ok single line: '0'

Test #10:

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

input:

4
2 4 7 6
7 3 8 4
5 8 7 1

output:

777

result:

ok single line: '777'

Test #11:

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

input:

4
4 6 3 2
4 8 3 6
3 4 5 8

output:

0

result:

ok single line: '0'

Test #12:

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

input:

5
3 7 4 2 6
7 8 6 4 3
3 5 4 8 7

output:

777

result:

ok single line: '777'

Test #13:

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

input:

5
3 5 1 0 6
4 8 9 5 2
5 2 9 8 4

output:

0

result:

ok single line: '0'

Test #14:

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

input:

6
1 0 6 3 7 5
9 5 2 8 4 7
4 2 9 7 8 5

output:

777

result:

ok single line: '777'

Test #15:

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

input:

6
0 3 2 1 4 8
2 1 3 0 9 6
6 4 2 8 5 9

output:

0

result:

ok single line: '0'

Test #16:

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

input:

7
3 1 7 8 4 0 2
7 2 1 3 9 0 6
2 7 5 4 8 9 6

output:

777

result:

ok single line: '777'

Test #17:

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

input:

7
4 9 6 2 8 1 3
5 6 1 8 9 0 2
8 6 2 1 4 5 0

output:

0

result:

ok single line: '0'

Test #18:

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

input:

8
2 7 6 8 1 4 9 3
9 1 7 5 0 2 8 6
8 0 4 1 7 6 5 2

output:

777

result:

ok single line: '777'

Test #19:

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

input:

8
3 0 5 9 1 4 6 2
0 4 6 1 2 9 5 8
6 9 1 4 2 8 5 0

output:

0

result:

ok single line: '0'

Test #20:

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

input:

9
7 6 4 3 5 1 2 9 0
9 6 5 4 7 0 1 8 2
6 4 5 1 8 0 7 9 2

output:

777

result:

ok single line: '777'

Test #21:

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

input:

9
8 9 4 6 5 1 0 2 3
9 2 0 3 8 4 5 6 1
8 4 9 0 6 3 2 5 1

output:

0

result:

ok single line: '0'