This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
開一個陣列紀錄出現過的餘數 | |
過程大概是如此 | |
1.先歸零 | |
data [0] [1] [2] [3] [4] [5] [6]... | |
值 0 0 0 0 0 0 0 ... | |
2.每次計算餘數,就順便記錄下來 | |
比如1/7的餘數出現順序為 3 2 6 4 5 1 3 2 6 4 5 1......(或是1 3 2 6 4 5,看你的演算法怎麼設計) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
int main() | |
{ | |
int test_cases; | |
scanf("%d", &test_cases); | |
while(test_cases--) { | |
long long int x, y, N; | |
scanf("%lld %lld %lld", &x, &y, &N); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int test_cases; | |
while(scanf("%d", &test_cases) != EOF) { | |
while(test_cases--) { | |
int x, y, N; | |
scanf("%d %d %d", &x, &y, &N); | |
if(x <= 0 || y <= 0 || N <= 0 || N > 10000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int main() | |
{ | |
int test_cases, count = 1; | |
while(scanf("%d", &test_cases) != EOF) { | |
while(test_cases--) { | |
long long int x, y, N; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int main() | |
{ | |
int input_1, input_2; | |
while(scanf("%d %d", &input_1, &input_2) != EOF) { | |
int i, input_1_array[2]= {0}, input_2_array[7] = {0}; | |
for(i = 1; i >= 0; i--) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int main() | |
{ | |
int test_cases; | |
while(scanf("%d", &test_cases) != EOF) { | |
while(test_cases--) { | |
int total_input; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int main() | |
{ | |
int test_cases; | |
while(scanf("%d", &test_cases) != EOF) { | |
while(test_cases--) { | |
int x, y; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int cube_power(int); | |
int main() | |
{ | |
int data[6]; | |
while(scanf("%d%d%d%d%d%d", &data[0], &data[1], &data[2], &data[3], &data[4], &data[5]) != EOF) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int main() | |
{ | |
int data[6]; | |
while(scanf("%d%d%d%d%d%d", &data[0], &data[1], &data[2], &data[3], &data[4], &data[5]) != EOF) { | |
int i; | |
for(i = 5; i >= 0; i--) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int data[100000 + 1]; | |
int main() | |
{ | |
int p, q; | |
while(scanf("%d %d", &p, &q) != EOF && q) { |