Code Submission Evaluation System Login

BOI 2016, day 1

Start:2016-05-12 09:00:00
End:2016-05-12 14:00:00
 

Tasks | Scoreboard | Statistics


CSES - BOI 2016, day 1 - Results
History
2016-05-12 13:59:5615
2016-05-12 13:55:150
2016-05-12 13:54:230
2016-05-12 13:53:36
2016-05-12 12:22:500
2016-05-12 12:21:420
2016-05-12 12:18:300
2016-05-12 12:14:320
Task:Spiral
Sender:JustasK
Submission time:2016-05-12 13:59:56
Language:C++
Status:READY
Score:15

Feedback

groupverdictscore
#1WRONG ANSWER0
#2ACCEPTED15
#3WRONG ANSWER0
#4WRONG ANSWER0
#5WRONG ANSWER0

Test results

testverdicttime (s)group
#1WRONG ANSWER0.04 / 1.501details
#2ACCEPTED0.05 / 1.502details
#3WRONG ANSWER0.05 / 1.503details
#4WRONG ANSWER0.05 / 1.504details
#5WRONG ANSWER0.05 / 1.505details

Compiler report

input/code.cpp:2:0: warning: ignoring #pragma comment  [-Wunknown-pragmas]
 #pragma comment(linker, "/STACK:167772160000")
 ^

Code

#define _CRT_SECURE_NO_DEPRECATE
#pragma comment(linker, "/STACK:167772160000")
#include <iostream>
#include <fstream>
#include <cstdio>
#include <stdio.h>
#include <cstdlib>
#include <stdlib.h>
#include <string>
#include <list>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <iomanip>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <sstream>
#include <assert.h>
#include <functional>
#include <climits>
#include <cstring>
typedef long long ll;
typedef std::pair<ll, ll> pll;
typedef std::pair<int, int> pii;
//typedef std::pair<long double,long double> pdd;
#define forn(N)          for(int i = 0; i<(int)N; i++)
#define fornj(N)         for(int j = 0; j<(int)N; j++)
#define fornk(N)         for(int k = 0; k<(int)N; k++)
#define forn1(N)          for(int i = 1; i<=(int)N; i++)
#define fornj1(N)         for(int j = 1; j<=(int)N; j++)
#define fornk1(N)         for(int k = 1; k<=(int)N; k++)
#define PI 3.1415926535897932384626433
#define v vector
#define ll long long
#define print(n) printf("%d ", (n));
#define printll(n) printf("%I64d", (n));
#define printline() printf("\n");
#define read(n) scanf("%d", &n);
#define read2(n, m) scanf("%d%d", &n, &m);
#define readll(n) scanf("%I64d", &n);
#define mp make_pair
using namespace std;

const ll mod = 1000000007;
void prnt(ll a) {
	ll g = a / mod;
	a -= g*mod;
	a += 10 * mod;
	cout << a%mod << endl;


}

int main()
{
#if defined(_DEBUG) || defined(_RELEASE)
	freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#else
	//(File".in", "r", stdin); freopen(File".out", "w", stdout);
	//freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#endif
	
	int n; cin >> n;
	
	int q; cin >> q;
	forn(q) {
		int x1, y1,x2,y2; cin >> x1 >> y1>>x2>>y2;
		if (x1==x2 && y1==y2){
			ll rad = max(abs(x1), abs(y1));
			rad++;
			ll start = 1 - (rad - 1) * 6 + 4 * rad*(rad - 1);
			rad--;
			start %= mod;
			ll x = x1; ll y = y1;
			if (x == rad)if (y > -rad) {
				prnt(start + y - rad);
				continue;
			}
			if (y == rad) {
				prnt(start + rad - x);
				continue;
			}
			start += 2 * rad;
			if (x == -rad) {
				prnt(start + rad - y);
				continue;
			}
			start += 2 * rad;
			if (y == -rad) {
				prnt(start + x + rad);
				continue;
			}
			start += 2 * rad;
			cout << (start + y + rad) % mod << endl;


		}


	}




	return 0;

}

Test details

Test 1

Group: 1

Verdict: WRONG ANSWER

input
1000 100
-709 0 1000 123
-621 -1000 -102 -435
-602 -560 276 -356
-945 -590 0 -468
...
view   save

correct output
788057008
633127082
507903329
53165899
558016315
...
view   save

user output
(empty)

Test 2

Group: 2

Verdict: ACCEPTED

input
1000000000 100
181053719 1000000000 181053719...
view   save

correct output
818946492
750635163
193830026
660632411
46072376
...
view   save

user output
818946492
750635163
193830026
660632411
46072376
...
view   save

Test 3

Group: 3

Verdict: WRONG ANSWER

input
100000 100
-88233 -87279 -49871 52277
-86645 -7997 48948 30702
-79916 -36210 -21257 -16821
0 57331 93163 100000
...
view   save

correct output
986592951
708386765
85336595
18263594
32233727
...
view   save

user output
(empty)

Test 4

Group: 4

Verdict: WRONG ANSWER

input
1000000000 100
1 1 21134200 719983102
1 1 929463279 1000000000
1 1 68450838 1
1 1 84417340 297177199
...
view   save

correct output
695961158
957360176
137575768
522232140
58884045
...
view   save

user output
(empty)

Test 5

Group: 5

Verdict: WRONG ANSWER

input
1000000000 100
-857489445 -1000000000 -432836...
view   save

correct output
902627632
581519884
819269364
857298983
278402948
...
view   save

user output
(empty)